Archive: Detect old version and uninstall before installing new version


Detect old version and uninstall before installing new version
I know how to install a new version of an application. But I want the installer to detect if there is any older versions of the application and run the unstaller script before it installs the newer one. I have looked in the documentation but I didn't see anything that specifically addresses this type of installation.


1. On install write information into a known location about where the application is stored.

2. In the installer, check the location pointed to by the registry.

3. If the application is found there, use the code included in the manual to get the executable's version number.

4. If the version number is less than the app being installed, run the uninstaller.