Archive: Silent Installer Return


Silent Installer Return
Is there a way to make a silent install block until completed and return a value? For example, I want to silently run my install from the command line (batch file) and return 0 for success and 1 or more to represent a failure.

Is this possible?


Whether your installer 'blocks' until completed depends on your batch file method. By default, it should wait for your installer to exit.
( There are some batch utilities that let you run a program and continue with the batch process even while that program is still running - you'd have to look into their documentation on how to stop this ).

To set a return value, see the SetErrorLevel instruction.


Use start /wait

Stu


I'm calling the uninstaller.exe silently from another installer, both generated from nsis. I call the uninstaller.exe using ExecWait, but ExecWait doesn't block (or rather I don't think the uninstaller blocks).

To verify this I added a sleep command for 1 minute. Then on the installer I wrapped the Exec wait call with message boxes and they happen one right after the other, with no 1 minute delay. I verified the uninstaller indeed blocks for one minute even silently by calling it from the command line. The files it is uninstalling get removed after about a minute.

So, again, can you explain how to make a silent uninstaller block until it completes executing? Are there some make nsis flags I have to pass, or perhaps a directive at the top of my script?



Thanks,
Zach


Eh, I don't mean the uninstaller blocks, I mean there is a 1 minute delay after calling the uninstaller before the side effects (files removed) happen.

The uninstaller has the 1 minute delay before performing actions, but the installer's "ExecWait" which calls upon this uninstaller doesn't wait for this 1 minute delay, meaning the execwait isn't blocking until completion of the uninstaller.

I need this for an upgrade sequence I'm writing. Basically, I install version 1.0.0, then I want to run installer for 1.0.1 which will run the uninstaller of 1.0.0 with flags passed to leave the data intact, followed by installing the 1.0.1 files.

Can you help?


I also read from the NSIS.chm (D.1 Error Levels):
Note that uninstallers copy themselves to the temporary directory and execute from there so the original uninstaller can be deleted. This means the error level the uninstaller sets is not available to the executing process, unless it simulates this copy process and executes the copied uninstaller.

So, the uninstaller may not be blocking because it is being copied and then executed as a spawned process executing from another location. Can I, myself, call this extraction and manage it so that I can achieve the blocking behavior?


http://nsis.sourceforge.net/When_I_u...he_uninstaller

Stu


You sir, are the shiznit.


So, one last quick question. Is there a way to do the same thing with the installer.exe? The /D="path" for installer doesn't do it and neither does the _?="path"

Basically, you know of a page that you can point me to that will tell me how to make the ExecWait block for the installer?


It does block unless the installer you are launching has been scripted to do otherwise (i.e. launch another process). It is only the uninstaller that does this by default (by copying itself to a temp folder and re-executing itself from there).

Stu