Archive: Silent Uninstall?


I have used the silent switch on the install exe that NSI generates... does the same switch exist on the generated uninstaller? I'd love to be able to silently uninstall a previous version of the installed software when a user attempts to upgrade...


No. There is no way (that is said in the documentation) to do so. But what you can do is in newer versions that you install with NSIS is add the following code:

Section "Newer Version"
SectionIn
SetOutPath $INSTDIR
Delete "$PROGRAMFILES\myprogram1\MyProgram0101.exe"
Delete "$PROGRAMFILES\myprogram1\uninst-myprogram.exe"
File MyProgram1010.exe

For example.

Or you could just run the uninstaller before installing a new version, but that would leave more responsibility on the installer. Or just overwrite with the new program by adding the tag:

SetOverWrite ifnewer


Hope that helps,
Duane Jeffers
Developer; On-Demand Audio