windows-installermajor-upgradewix5

MSI generated with WIX5 not upgrading executable on major upgrade


Package Version is changed from "1.0.1" to "1.0.2"

MajorUpgrade is scheduled as "afterInstallExecute".

  1. Running only the MSI 1.0.2 installs the version correctly.

  2. Running the MSI 1.0.1 installs the version correctly. But running MSI 1.0.2 after it, does not replace the executable file.

(If MSI 1.0.2 is executed with writing to log, searching the executable name in the log, leads to the following line: The file represented by File table key 'MyExecutable.exe' has no eligible binary patches)

  1. Right clicking on MSI 1.0.2 and selecting "REINSTALL" replaces the executables correctly.

First: The executable is .NET 8 stand alone application. Its own "version" is not changing. But the file "content" is different. Does the MSI just check the version of the executable, and conclude that there are no "binary patches"?

Second: Do you have any idea how to fix / force replace / work around this?


Solution

  • 6 Days later...

    While I was looking for alternative installer to solve my problem, I come across this guide:

    https://www.advancedinstaller.com/user-guide/control-events.html#section133

    The specific information that I needed:

    Set reinstall mode - ReinstallMode This event allows the author to specify the validation mode or modes during a reinstall. For the Argument field it can use a combination of these values:

    o - reinstall if the file is missing or is an older version

    e - reinstall if the file is missing or is an equal or older version

    As it turns out, my current project actually supports this.

    And now that I knew what I have to do, I did additional search, and as it turns out, people are using this:

    MSI with WIX: setting REINSTALLMODE="amus" triggers "LGHT1076: ICE40: REINSTALLMODE is defined in the Property table. This may cause difficulties"

    One line in the code for setting REINSTALLMODE to "emus" and everything does what I want it to do:

    User edited files survive upgrade. Binaries get overridden even with same version.