kraucer
23rd May 2011 16:27 UTC
Changing directory to call an executable?
I need to change the path at runtime. It would be the same command as the "change directory" cd. How can I do this in NSIS?
!define OCS_INSTALL_FILE "C:\ocs\install\ocs_setup.exe"
!define OCS_INSTALL_OPTIONS "/S /NP /NO_SYSTRAY /NOSPLASH /NO_SERVICE"
!define OCS_SERVER "http://myserver.com/ocsinventory"
ExecWait "'${OCS_INSTALL_FILE} ${OCS_INSTALL_OPTIONS} /SERVER=${OCS_SERVER}'"
The command "ExecWait" not working if called with the provided path. It only works if I call the direct path but for that I need to change the path.
ExecWait "ocs_setup.exe" is fine.
demiller9
23rd May 2011 16:37 UTC
SetOutPath C:\ocs\install
kraucer
23rd May 2011 17:06 UTC
No, the problem is not just this. The problem is that "ocs_setup.exe" can only be executed if he is in the same way my NSIS installer.
An example: if I save my instalador_nsis.exe and ocs_setup.exe in the directory.
c:\ocs\ocs_setup.exe
c:\ocs\my_install.exe
The way it works above. If the way down, does not work:
c:\ocs\install\ocs_setup.exe
c:\ocs\my_install.exe
kraucer
23rd May 2011 17:35 UTC
Resolved, added 'at the beginning and end of the path variable in ExecWait. Thank you for your attention.
Afrow UK
24th May 2011 10:05 UTC
You should never use relative paths. If you do need a path relative to the running installer, use $EXEDIR\.... And yes, you need quotes (the manual clearly states this). They should be double quotes too, so '"[path]"'.
Stu
MSG
24th May 2011 18:31 UTC
I don't think you need double quotes for any NSIS command. ' or ` work fine too.
Afrow UK
24th May 2011 18:44 UTC
Originally posted by MSG
I don't think you need double quotes for any NSIS command. ' or ` work fine too.
We're talking about the executable path for ExecWait (you need double quotes around it).
Stu
MSG
24th May 2011 21:07 UTC
Oh I see, the manual does show
ExecWait '"$INSTDIR\someprogram.exe"'
as the example. Guess it's the same as what Anders and I discussed about putting the ARP uninstall path between quotes. I'll add it to my checklist. :P