Archive: Exec does not work?


Exec does not work?
Hello,

On Windows XP at least, I am unable to get any of the Exec instructions to work: I setup the installer to extract a program and then execute it immediately (to register some environment variables, see my previous question), anyway, the program doesn't get started. Here are the lines I'm trying to use:

ExecWait '$INSTDIR\bin\envEdit.exe -a test hello'
ExecShell "open" $INSTDIR\bin\envEdit.exe "-a Path $INSTDIR\bin"

As you can see, I tried to use two different formats (I've tried may others too), but none seem to work.


Can you verify that the examples provided with NSIS are working or are not working (that is, are any of the EXEC statements working or is it only your script)...I've seen someone else having the same problem with either NT4.0 or 2000. And since they are all based on the NT kernel, I suspect it something in there and almost definitely not something you're doing wrong.

And sorry for leading down a wrong path...my bad :)
-=Gonzotek=-


Doh! I messed up, but there is still a problem
Hi,

I realized that I messed up, but that there is still a problem:

My original problem was that this:

ExecWait '$INSTDIR\bin\evnEdit.exe -a Path $INSTDIR\bin'

Should have been this:

ExecWait '$INSTDIR\bin\envEdit.exe -a Path $INSTDIR\bin'

Subtle problem yes? In fact, I wrote the entire evnEdit program yesterday, meaning to call it envEdit. So when I came to work today, I coded up the nsi as envEdit... Damn.

However, there is still a problem. This line does not function properly:

ExecWait '$INSTDIR\bin\envEdit.exe -a Path $INSTDIR\bin'

I also tried this line, which didn't work either:

strcpy $0 $INSTDIR
ExecWait '$INSTDIR\bin\envEdit.exe -a Path $0\bin'

But this one does:

ExecWait '$INSTDIR\bin\envEdit.exe -a Path INSTDIR\bin'


When I say, "doesn't work", I mean the program is executed, but it doesn't receive the 3rd parameter as would be expected.

This leads me to believe that only the first variable gets evaluated in ExecWait, or something like that.

I should point out that envEdit is supposed to set an environment variable, but doesn't do anything if it doesn't get enough parameters. I think what happens is that because the $INSTDIR\bin evaluates to "", envEdit only gets 2 parameters instead of its expected 3, and quits. When I remove the second $, it gets a 3rd parameter, and works correctly.