1

As I put in title, the question is how does Wix decide to install a particular file?

So I have exe file and when I change something in exe file and rebuild it, it will not get reinstalled if I don't change version. But if I change something in resource file, resource file will be replaced even if I don't change version of my application. So how wix is deciding if he need to replace file during upgrade or not.

I am using wix3.9. MajorUpgrade is schedule afterInstallFinalize.

Ivan Vasiljevic
  • 5,478
  • 2
  • 30
  • 35

1 Answers1

1

Versioned files get replaced based on file version, yes, but data files get replaced based on whether you have specified file hash or not. I think WiX generates file hases by default, so this is the overwrite rule:

https://msdn.microsoft.com/en-us/library/aa370532(v=vs.85).aspx

and it's a Windows Installer rule that applies to all MSI settup, not a WiX decision.

P.S. afterInstallFinalize isn't an ideal place. afterInstallExecute is safer, and it will have the same overall result. The issue is that after InstallFinalize means that the new product is installed. If the uninstall of the older product then fails and rolls back you will end up with both old and new products installed, otherwise known as a mess. afterInstallExecute makes everything part of the transaction so you get the original product installed if there is a failure to uninstall it.

PhilDW
  • 20,260
  • 1
  • 18
  • 28