How can I make my NSIS silent installer block until complete? - nsis

When I run a silent NSIS installer (from the console, as in installer.exe /S /D=C:\Foo) it immediately moves to the background. I'd like to wait until it has finished installing before I do anything else. Is there a flag I can pass to tell the installer to be blocking?

You don't say anything about how you start the process in your question! NSIS installers are always "blocking", for a silent installer this means you just have to wait for the child process to end.
If the parent process is also a NSIS installer you can do ExecWait '"c:\path\to\installer.exe" /S /D=C:\Foo' or if it is a batch file you must use start "" /WAIT "c:\path\to\installer.exe" /S /D=C:\Foo

Related

Inno Setup Exec doesn't wait for InstallShield uninstallation to complete

Trying to uninstall a software using the uninstall string (and running that with Exec in InitializeSetup) before installation, it doesn't wait for the un-installation to complete but proceeds to the next step of installation in Inno Setup.
I am using the following code and the software I am trying to un-install in an Installshield product:
Exec(
ExpandConstant('{pf}\InstallShield Installation Information\{{XXX8X88X-XX8X-88X8-X8XX-88X888X88888}\setup.exe'),
'-s -runfromtemp -l0x0004 -removeonly -remove', '',
SW_SHOW, ewWaitUntilTerminated, ReturnCode)
The setup.exe most probably executes a subprocess for an actual uninstallation and exits itself. So Inno Setup seemingly does not wait for the process to finish. This is a common behavior, as the uninstaller needs to delete itself, what it cannot do, if it still running. So it creates a copy of itself (or another executable) in a temporary folder and (re)executes from there.
As per InstallShield documentation, you can try adding /w or /Clone_wait switches to the command-line:
/w ... For a Basic MSI project, the /w option forces Setup.exe to wait until the installation is complete before exiting.
/Clone_wait ... This parameter indicates that the original setup should wait for the cloned setup process to complete before exiting.

Open File during Installation

I am using NSIS to create installer. Also I need to install other program (I have his installation file). How add second installer to automatically run it during first installation?
The simplest is to run the file (which must be first extracted to some directory,. e.g. $TEMP) with
ExecShell "open" "$INSTDIR\app.exe"
or with
ExecWait '"$INSTDIR\someprogram.exe"' $0
if you want to wait for program to finish.
Also consider many possibilities: whether the app should be run with some parameter, in Silent mode or elevated with admin rights or run as original user...

How to set the whole installer invisible while using 'ExecWait' in NSIS?

I'm installing a program with my installer and run it with 'ExecWait'.
Is there a way to hide the window of the installer while the program is executed?
The installer should show up again and continue when the user quits the executed program.
Is there any way to achieve that?
HideWindow
ExecWait '"$InstDir\Foo.exe" "space bar" /baz'
BringToFront

How to disable an extra window to restart system even after selecting not to do so in files in use dialog in installshield

I am doing an upgrade for the existing exe file using installshield. when installing the update , in files in use dialog I select the option to automatically close and restart the application instead of the other option to reboot the system.
But I get an extra window which tells me to restart the system again after installation is complete. How to disable this window? Please help :)
You can try to run the installation silently with REBOOT=ReallySuppress (update the paths). Please note that I haven't had the chance to test all these command lines:
msiexec.exe /I "C:\IsWiX.msi" /QN /L*V "C:\msilog.log" REBOOT=ReallySuppress
/I is for install
/QN is silent mode
/L* is verbose logging
If you have an EXE file instead of an MSI file I would extract the MSI to an administrative image (file extract from setup.exe basically) using the following command:
setup.exe /a
Then specify an extract location for the files in the EXE file. You can also run it directly with the Installshield command lines for EXE files. Something like:
Setup.exe /v"REBOOT=ReallySuppress /qn"
Or silently with logging:
Setup.exe /v"/l*v c:\test.log REBOOT=ReallySuppress /qn"
There are also some simplified command line macros from Microsoft. Most of the time these can be used. Other times you need the full command line interface.

Run uninstaller and wait until terminated

all/
There is app, installer for app is created by InstallShield (not msi project)
I need uninstall app and wait until uninstaller terminated.
I read registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{MyAppGuid}, UninstallString and try start uninstaller
in my case UninstallString = "C:\Program Files\InstallShield Installation Information{9F2A3D76-7785-492F-89E5-3F0FE2D205DC}\setup.exe" -runfromtemp -l0x0419 -removeonly
but in cmd.exe
"start /wait {UninstallerString}" don't wait until uninstaller terminated. I think uninstaller run same temp exe and terminated immediately. but then how can I resolve ny problem? Any idea??
Installshield added a /clone_wait switch at some point which solves your problem, as seen here:
This parameter indicates that the original setup should wait for the cloned setup process to complete before exiting.
Your uninstall string will look like this:
UninstallString = "C:\Program Files\...\setup.exe" -runfromtemp -l0x0419 -removeonly /clone_wait
-clone_wait will probably work too but I've tested and used it with /clone_wait.

Resources