Old 1st May 2004, 02:38   #1
TitusByronicus
Junior Member
 
Join Date: May 2004
Posts: 3
Question 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
TitusByronicus is offline   Reply With Quote
Old 1st May 2004, 09:02   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Use SetOutPath.
Joost Verburg is offline   Reply With Quote
Old 1st May 2004, 14:56   #3
TitusByronicus
Junior Member
 
Join Date: May 2004
Posts: 3
it seems to me that these two lines

code:

!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.
TitusByronicus is offline   Reply With Quote
Old 2nd May 2004, 09:06   #4
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
See the Modern UI Readme. If you want use SetOutPath for that application create a custom function (MUI_FINISHPAGE_RUN_FUNCTION).
Joost Verburg is offline   Reply With Quote
Old 2nd May 2004, 20:21   #5
TitusByronicus
Junior Member
 
Join Date: May 2004
Posts: 3
haha awesome! thanks very much, that solved the problem

-byron
TitusByronicus is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump