Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 13th June 2001, 09:17   #1
petersa
Senior Member
 
petersa's Avatar
 
Join Date: Apr 2001
Location: Melbourne, Australia
Posts: 207
Sorry if this is a bit hard to understand...

code:
SetOutPath $TEMP
File SPLASH.EXE
Exec SPLASH.EXE



If SPLASH.EXE also exists in the same folder as the installer, that copy is run. If I change the line to:

Exec $TEMP\SPLASH.EXE

The right copy runs, but it doesn't work the way it should.

SPLASH.EXE waits for a file that NSIS will extract to the directory, but it's looking in the directory of the installer, because NSIS apparently hasn't set the working dir to $TEMP.

The documentation says that $OUTDIR is the working directory for Exec and ExecWait, but for me it isn't. Am I doing something wrong?

I know I can change SPLASH.EXE to look in the actual directory, but this looks like a bug. So I thought I'd point it out.
petersa is offline   Reply With Quote
Old 13th June 2001, 11:05   #2
Edgewize
Member
 
Join Date: Apr 2001
Posts: 89
SetOutPath only seems to affect file extraction, not the actual working directory.

I'll have to check if changing the working directory breaks anything before I fix this, so it might not make 1.44e. But I'll try to include it...
Edgewize is offline   Reply With Quote
Old 13th June 2001, 18:18   #3
justin
Moderator Alumni
 
Join Date: Apr 2000
Location: USA
Posts: 315
the output path doesn't actually change the currenet directory of the installer .. but when you go to execute, it uses that path to set the current directory of the process that you execute.
hence, you still need to do:

Exec $TEMP\whatever.exe

-Justin
justin is offline   Reply With Quote
Old 13th June 2001, 20:28   #4
Edgewize
Member
 
Join Date: Apr 2001
Posts: 89
Gotcha. I forgot CreateProcess could even do that. I use this in my headers
#define ExecApp(path) CreateProcess(0,path,0,0,0,0,0,0,0,0)
Edgewize is offline   Reply With Quote
Old 14th June 2001, 11:08   #5
petersa
Senior Member
 
petersa's Avatar
 
Join Date: Apr 2001
Location: Melbourne, Australia
Posts: 207
Okay...

...so if I did

SetOutPath $TEMP
Exec C:\WINDOWS\NOTEPAD.EXE

would the working dir for Notepad be $TEMP or C:\WINDOWS?
petersa is offline   Reply With Quote
Old 14th June 2001, 17:10   #6
Edgewize
Member
 
Join Date: Apr 2001
Posts: 89
According to the source code for NSIS, the current dir should be $TEMP.

If that doesn't seem to be the case, NOTEPAD could either be overriding the default output directory, or else the CreateProcess API call isn't working as documented or something.

I'll do some experimentation with this one.
Edgewize is offline   Reply With Quote
Reply
Go Back   Winamp 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