Archive: changing the working directory?


changing the working directory?
hi, i'm using NSIS as an installer for a game i'm making, and it's absolutely beautiful!

i'm just having one problem, though. if the user tells the installer to launch the game at the end of setup, the game crashes because the working directory upon launch is wrong, and it can't get access to the game files.

is there a way to change the directory prior to launching the game?

i should probably note that i'm using HM NIS Edit 2.0rc1's wizard to create the script, so most of the functionality is encapsulated in macros. i'd like to keep using the macros, but if the only way to change the directory on launch is to script it out, then so be it.

thanks
-byron


Use SetOutPath.


it seems to me that these two lines


!define MUI_FINISHPAGE_RUN "$INSTDIR\ipc.exe"
!insertmacro MUI_PAGE_FINISH


should use SetOutPath before running the executable so that it runs with $INSTDIR at the working directory. am i wrong in assuming that?

where can i find documentation for the macros? i looked all around the NSIS site and even googled it but can't seem to find documentation.

See the Modern UI Readme. If you want use SetOutPath for that application create a custom function (MUI_FINISHPAGE_RUN_FUNCTION).


haha awesome! thanks very much, that solved the problem

-byron