Archive: Silent Installer


Silent Installer
I am writing an installer that can run silently (with the /S switch) from the command-line. However, I need to the setup application to not give control back to the command-prompt until it has finished execution. Is this possible?


If we are speaking about batchfiles, I know the following behavior:

MyNsisInstaller.exe /S

The win command promt waits till MyNsisInstaller.exe is closed.

start MyNsisInstaller.exe /S

The win command won't wait and runs further immediatly.

Hope, this helps.

That is the problem I'm having (the win command prompt won't wait and runs further immediatly). I've tried
Setup.exe /S
and
start Setup.exe /S
but both don't solve the problem. Is there a switch that will not fork when I run Setup.exe?


Nevermind, I did start /? and have put the /WAIT option so I'm running start /WAIT Setup.exe /S and that's working.

Just as a side note to the developers: a good feature would be a command-line switch to not fork the process when the installer file is run (similar to InstallShield's /sms switch).


your idea is not so bad.


As far as I know, it's impossible. It doesn't wait because the installer is not a command line application but a GUI application.


It's possible to code a program to output to a console despite having a form open - see SF projects like DOSBox and ScummVM for examples of programs that do this. If the console part of the program is set to wait until the form no longer exists (either by checking for its presence or by waiting for a callback of some sort), this would do the trick.

NSIS could be coded to have such a feature, but only use it if a certain switch is specified on the commandline. I think a basic implementation would only involove assigning the form to a variable and constantly check if it isn't NULL, but it's not something I've tested.


Both ScummVM and DOSBox are built as console applications. Look for "/subsystem:console" in here and here.


IDEA:

Build a small console application that starts your Installer
and goes in a waiting loop, then in your installer JUST before all is done you write e.g. and infile and yor starter console detected this in the waitloop. then the console knows that the install is done and can close itself.

Success, be creative and adhere to the API ;)