Archive: Uninstall before install


Uninstall before install
Hi,
In my install script, I need to check something before I install the application. I want to check and see if an older application exists. This is my first install script with NSIS for this application, so I don't think I can use any olderVersion ideas. I have found the Uninstall key in the Registry, and it will always be this key, but I don't know what to do about it. Also, what if the key isn't there? How can I do this check?

Thanks!


Use ReadRegStr to get the registry key and StrCmp to check whether it's empty or not.


How can I run an uninstall.exe program from just a registry key?

Thanks!


Var APPFILE

ReadRegStr $APPFILE HKLM "mystr" "myvalue"

Exec $APPFILE


I attached a code snippet which I used to accomplish this. You want to set the product name variables to something suitable obviously.