99999999
5th June 2007 22:50 UTC
Problems running uninstaller before I do an install.
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.
Red Wine
6th June 2007 06:26 UTC
I'd suggest update to the latest version.
Take a look at the included example makensis.nsi
Shlomikalfa
6th June 2007 10:01 UTC
hey dude, take a look in my script:
http://forums.winamp.com/showthread.php?s=&threadid=272368
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:(
Red Wine
6th June 2007 10:24 UTC
Originally posted by Shlomikalfa
hey dude, take a look in my script:
http://forums.winamp.com/showthread.php?s=&threadid=272368
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:(
As already mentioned dude, all you have to do is to take a look at the included example makensis.nsi.
It is a real world installer which shows the way to go.
AxelMock
6th June 2007 12:27 UTC
Re: Problems running uninstaller before I do an install.
Originally posted by 99999999
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'
Hi,
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.
HKLM Software\MyCompany\MyProduct Uninstall = $INSTDIR\uninst.exe
And perhaps version information e.g.
The newer version should try to read the registry for the old version info/uninstall key.
If it exists, use
ExecWait $UninstallString
to perform the uninstall of the former version BEFORE running into the Install section of the new installer.