Search code examples
c#installationwixwindows-installercustom-action

Force Installation Every Time


How do I force my Wix installer to always install an application? Currently, when I run an .msi file for the second time, the installer proceeds to go to the uninstall screen, but I want to ensure that the installer always installs my application like it did the first time. Are there some best practices for this or anything?

A better question might be...how does the Windows installer know that the product is up for maintenance when you run an .msi file again after its initial install? Because if it just checks the registry, I can remove the registry keys after uninstall...does anyone know? I could really use the help on this one.

EDIT: I figured it out. Installer will install a fresh installation of your .msi if you delete the reference in HKEY_CURRENT_USER/Software/Microsoft/Installer/Products/YOURPRODUCTGUIDHERE. So at the end of your install, throw in a custom action to delete that registry key, for the next install to work :)


Solution

  • I figured it out. Installer will install a fresh installation of your .msi if you delete the reference in HKEY_CURRENT_USER/Software/Microsoft/Installer/Products/YOURPRODUCTGUIDHERE. So at the end of your install, throw in a custom action to delete that registry key, for the next install to work :)