Archive: Exec Strangeness


I cannot get either Exec or ExecWait to work at all in my NSI script. I know it must work because the sample viewhtml.nsi works properly. However, when I try the same code in my own functional script, it never launches the application... The script compiles properly, and the command appears in the install details--but the executable never gets launched and the error flag gets set. Anyone have an idea of what could be causing this problem? I'm on Windows 2000 SP2 and I'm simply doing this:

ExecWait '"$PROGRAMFILES\Internet Explorer\iexplore.exe"'

I have also tried:

Exec "C:\WINNT\notepad.exe"

Just for kicks...same result.

Ideas?


What about shellexec? Same result?

The first line in your code...

ExecWait '"$PROGRAMFILES\Internet Explorer\iexplore.exe"'


had single quotes ('...') wrapped around double quotes ("..."), was that intentional?

-=Gonzotek=-


No, ExecShell works...
No, ExecShell works... and yes the extra quotes were intentional. I had just cut 'n paste from the viewhtml.nsi which had the following line which included the extra quotes:

ExecWait '"$PROGRAMFILES\Internet Explorer\iexplore.exe" "$INSTDIR\makensis.htm"'

I'm assuming this is simply grouping the two statements into one arg. So, I don't think the extra quotes affect the actual execution of the statement. That is one reason I pulled them out on the second example.

But again, ExecShell works... why would one work and not the other two? I really need to use ExecWait if at all possible.


If the sample works properly, maybe you could work back from there. Take out everything from the example that you can, then build a new script around it. Or perhaps Exec and ExecWait have an incompatibility eith compliling under WIN2k SP1?

What about

EXEC FILE.EXE


in the directory that you are currently working in?

-=Gonzotek=-


Ah Ha!
Fixed it! For some reason, I had to place and SetOutPath statement prior to calling Exec or ExecWait for it to work. I when through the viewhtml.nsi sample, and commented it out line by line. When I removed the SetOutPath statement in the default section the Exec didn't launch Internet Explorer. So, I just added a dummy SetOutPath statement in the function where I call Exec and sure enough, it worked!

I suppose that is a bug, so like I said, to reproduce it, just comment out the line that says SetOutPath $INSTDIR in the viewhtml.nsi sample script.


That seems to be a bug for sure, but I had also experienced problemls with opening html pages. If you do a
ExecShell "open" "C:\test.html"
it might not open a webbrowser. It works perfectly if NS is the standard browser, but IE didn't seem to set html to open correctly via that scheme (got bug reports from a couple of persons)


How about using start.exe instead of open,
or maybe it´s "start.exe c:\temp.html"?
Try with start.exe anyway!
/arune