3

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 :)

Alexandru
  • 12,264
  • 17
  • 113
  • 208
  • possible duplicate of [WiX-- always overwrite the previous version](http://stackoverflow.com/questions/775259/wix-always-overwrite-the-previous-version) – Christian.K Dec 19 '11 at 14:03
  • I already use a major upgrade but it does not work as described in that article; its a bit misleading. I just want a full install every time. Actually, my installer doesn't have to even uninstall because I'm working on an installer for my company that will only be used internally. However, it always has to install, just like the first time... – Alexandru Dec 19 '11 at 14:14

2 Answers2

2

I'm not a fan of forcing an installer like that (why not have it remove the existing product first? or try to get the upgrade to work), but you could try using the following from a batch script (or any script type for that matter):

msiexec.exe /fa your_msi_file.msi

This will force an installation of all files. See here for more details.

Jason Down
  • 21,731
  • 12
  • 83
  • 117
  • Its a requirement on my installer to not uninstall previous versions; its supposed to support multiple deployments. – Alexandru Dec 19 '11 at 17:00
1

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 :)

Alexandru
  • 12,264
  • 17
  • 113
  • 208