Archive: ExecWait with parameters?


ExecWait with parameters?
My program requires .Net framework so I do a check for it and if its not installed, I install it like so:

File /oname=$PLUGINSDIR\dotnetfx3.exe "..\..\Support\dotnetfx3.exe"

ExecWait '$PLUGINSDIR\dotnetfx3.exe /q /norestart' $R0

Doing it this way requires packing the .net installer into my installer which makes the size of my installer pretty big. What I want to be able to do is just call the .net installer directly from the "..\..\Support\dotnetfx.exe" directory. So I tried doing this:

ExecWait '$PLUGINSDIR\dotnetfx3.exe /q /norestart' $R0

The reason the directory structure is different for this call is because the NSIS Script and the Executable it produces are in two different directories. When I call the .net installer this way it wont recognize the parameters and it just launches the regular installer. But I need the .net installer to run in silent mode. What am I doing wrong?

Note: Eventually I want to be able to pack all this onto a CD, if that changes anything


you forgot to RTFM ;)


ExecWait '"path\app.exe" /param1 /param2="foo bar"' $0

Sorry there was a mistake in my first post. The second ExecWait call should have been:

ExecWait 'Support\dotnetfx3.exe /q /norestart' $R0.

Also ive already tried this:
ExecWait '"Support\dotnetfx3.exe" /a /norestart' $0

That didnt work either.


Okay a new discovery

If I specify the full path like this:

ExecWait '"C:\Somefolder\Anotherfolder\Support\dotnetfx3.exe" /a /norestart' $0

Everything works fine, the parameters are recognized and the silent installer is deployed.

If I do it using relative path as I was trying to do:

ExecWait '"Support\dotnetfx3.exe" /a /norestart' $0

The paramaters are not recognized and the regular installer is deployed. I want to do it using a relative path because eventually I will have the installer on a CD and will not know what drive letter the CD drive is. What am I doing wrong?


did you try ".\Support\dotnetfx3.exe . . ."?

when in doubt, add ".\" (this is shorthand for current working directory in the same way that ..\ is up one level from the current directory)

also, make sure the current directory is the right one. use the SetOutPath to set your current directory.