Archive: Run exe from within script


Run exe from within script
In my install script, I want to see if a certain registry key exists...which I know how to do...and, if it does, I want to issue a message saying that you must uninstall App X before installing this app. I could either exit out of my install right then and there, or start the uninstaller for App X. The first option is simple, but I'm not sure how to do the latter. Can I call the other uninstaller and exit out of my installer??? Thanks in advance!!


You can use Exec, ExecWait, ExecShell or nsExec to execute the uninstaller. If the uninstaller was built using NSIS see the FAQ about using it with ExecWait.


Yes, the uninstaller is built with NSIS.

I'm away from my home PC (where my NSIS Documentation is installed)so, this may be answered when I get a chance to read the FAQ at home. If I want to run the uninstaller then continue with my installer after the uninstallation...and, the uninstaller that I call requires a reboot, will my installer pick up where it left off after the reboot? Or, should I simply ingnore the reboot and continue anyway...then reboot after the installation? OR, maybe this is a moot point and is taken care of with the ExecWait function you described below?

By the way, I don't know how to do any of what I just described, so any pointers would be much appreciated ;)

Thanks again!!


The FAQ is online and can be found here: http://forums.winamp.com/showthread....hreadid=102650

The documentation can be found here: http://nsis.sf.net/Docs

The installer will not continue from where it stopped, that's up to you. But according to what you've described above all you need is to run the installer again because you will be checking on start-up.

As for rebooting, that's totally up to what you're doing in the installer and the uninstaller.