Archive: Registering EXE help


Registering EXE help
Hi All,

I need to register my exe after the installation but it doesnt work. My exe has to be registered with another application.

Here's my working batch code:
echo Registering Windows Sidebar

"%VAIOTOOLS%\regtlib.exe" "%ProgramFiles%\Windows Sidebar\sidebar.exe"
The real directory of %VAIOTOOLS% is "c:\program files\vaioxp\tools"
I've tried executing this command via the installer and it doesnt work.
Here is my NSIS exec call:

Function .onInstSuccess
Exec '"%VAIOTOOLS%\regtlib.exe %ProgramFiles%\Windows Sidebar\sidebar.exe'
FunctionEnd
Even I tried changing to the real directory and it still doesnt work
Exec '"$PROGRAMFILES\VAIOXP\tools\regtlib.exe %ProgramFiles%\Windows Sidebar\sidebar.exe'
And I also tried other EXEC formats ,but it still give me the same result:
Exec '"%VAIOTOOLS%\regtlib.exe" "%ProgramFiles%\Windows Sidebar\sidebar.exe"'
Exec '%VAIOTOOLS%\regtlib.exe %ProgramFiles%\Windows Sidebar\sidebar.exe'
NSIS is the best installer in thw world, I know this can be done. Please help me

Thank you

I guess $PROGRAMFILES\Windows Sidebar is the $INSTDIR so you may use $INSTDIR instead.
Also I think getting the regtlib location from registry would be a good idea.
If regtlib is a console application you may try nsExec.
You should take care of the quotes in every case, e.g.
[Exec '"$PROGRAMFILES\VAIOXP\tools\regtlib.exe %ProgramFiles%\Windows Sidebar\sidebar.exe']
has problem with quotes among others.
Something like e.g.
[Exec '"$PROGRAMFILES\VAIOXP\tools\regtlib.exe" "$PROGRAMFILES\Windows Sidebar\sidebar.exe"']
should work


yes, sidebar.exe is in $INSTDIR.

Will this work:

Exec '"$PROGRAMFILES\VAIOXP\tools\regtlib.exe" "$INSTDIR\sidebar.exe"'
Because I have tried it with this already ,it looks the same except the folder varialble but doesn't seemed to work:
Exec '"%VAIOTOOLS%\regtlib.exe" "%ProgramFiles%\Windows Sidebar\sidebar.exe"'

In NSIS %ProgramFiles% is not the same with $PROGRAMFILES therefore %VAIOTOOLS% is not recognized as a valid path.
However if %VAIOTOOLS% is an environment variable you may try ExpandEnvStrings,
http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.2.7


Oh i c,
Anyway, this seems to work just fine now.

Exec '"$PROGRAMFILES\VAIOXP\tools\regtlib.exe" "$INSTDIR\sidebar.exe"'
Thank you, Red Wine