Search code examples
windowswindows-installerinstallshield

How exactly does windows remember which programs are installed?


I am having trouble uninstalling a package from Windows 7 that I myself have created with InstallShield.

Running remove program from control panel only got 1/2 way before it aborted and rolled back. Funnily it reported the problem being one of my install steps, not one of the uninstall steps. Frustrated I used the Windows Install Cleanup and the package is no longer listed under Remove programs. However when I try to run the installer once more it reports that a previous version of the software must be uninstalled before it can proceed.

I was guessing that the Unique ID was still present in the registry but is not. How exactly does windows determine that a previous version of the software is installed on my machine?


Solution

  • The best solution to an uninstall issue that prevents the product from being uninstalled is to debug the issue (often a custom action) and fix it or delete it, then rebuild the MSI with the same ProductCode. Then reinstall it with a command line:

    msiexec /I [path to msi file] REINSTALL=ALL REINSTALLMODE=vomus

    which updates the product in place and the re-cached fixed product will now uninstall. Otherwise (because you can't recreate the MSI) it is possible to go into the cached MSI in C:\Windows\installer and change the MSI manually with Orca, conditioning CAs not to run, for example. But you need to know what you're doing.

    In other words and unfortunately, it would have been better to get the uninstall issue dealt with before resorting to the installer clean up utility, which I believe may no longer be supported because it doesn't completely clean up the system.

    Your best approach now is to change your ProductCode, UpgradeCode and PackageCode because they'll be among the items on the system that Windows will use to see that your product is already installed. This stuff is in the registry, but it's obfuscated (rearranged guids) and scattered around.