I use NSIS for a variet of products, but the one feature we'd like to add is that the uninstaller, for a previous product is run, *before* the new installation is started.
The following
CopyFiles /SILENT "$INSTDIR\uninstall.exe" "$TEMP\uninstall.exe"
ExecWait '"$TEMP\uninstall.exe" /KEEPCACHE /S _?=$INSTDIR'
So here's what happens, ExecWait runs the uninstaller, but then exits, and even after it exits, the uninstallation is still taking place, so when I run the installation phase, the product is in an incomplete installation state, as some files installed by the installer, are also being deleted by the uninstaller which is still running.
I've read the docs, and looked for help here, and I am using NSIS 2.24, and they say to use the _? commandline param. That using this will ensure that the uninstaller will be completed. But in my testing, this obviously isn't true.
Problems running uninstaller before I do an install.
5 posts
I'd suggest update to the latest version.
Take a look at the included example makensis.nsi
Take a look at the included example makensis.nsi
hey dude, take a look in my script:
it's working aight, it loads the uninstaller in case a previous installation is present, however it fails to restart the installer after it's done... yet to be solved🙁http://forums.winamp.com/showthread.php?s=&threadid=272368
Originally posted by ShlomikalfaAs already mentioned dude, all you have to do is to take a look at the included example makensis.nsi.
hey dude, take a look in my script:
it's working aight, it loads the uninstaller in case a previous installation is present, however it fails to restart the installer after it's done... yet to be solved🙁http://forums.winamp.com/showthread.php?s=&threadid=272368
It is a real world installer which shows the way to go.
Re: Problems running uninstaller before I do an install.
the problem is that you are trying to use the NEW uninstaller for the NEW version to do the uninstall of the PREVIOUS version.
So your product should write some entries in the registry
e.g.
The newer version should try to read the registry for the old version info/uninstall key.
If it exists, use
Originally posted by 99999999Hi,
I use NSIS for a variet of products, but the one feature we'd like to add is that the uninstaller, for a previous product is run, *before* the new installation is started.
The following
CopyFiles /SILENT "$INSTDIR\uninstall.exe" "$TEMP\uninstall.exe"
ExecWait '"$TEMP\uninstall.exe" /KEEPCACHE /S _?=$INSTDIR'
the problem is that you are trying to use the NEW uninstaller for the NEW version to do the uninstall of the PREVIOUS version.
So your product should write some entries in the registry
e.g.
And perhaps version information e.g.
HKLM Software\MyCompany\MyProduct Uninstall = $INSTDIR\uninst.exe
The newer version should try to read the registry for the old version info/uninstall key.
If it exists, use
to perform the uninstall of the former version BEFORE running into the Install section of the new installer.
ExecWait $UninstallString