0

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?

0

2 Answers 2

0

Does the MSI just check the version of the executable...?

Yep. The verbose log file should also show you why the Windows Installer chose to skip installing a file.

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

First, version your binaries properly. If an executable changes, update its version. That's simply a good programming practice.

Second, I'd schedule the major upgrade earlier. Better yet, I'd remove the MajorUpgrade element completely and let the default in WiX v5 take care of it for you.

Sign up to request clarification or add additional context in comments.

6 Comments

Correct me if I am wrong, but if you have a file that the user changes somehow (lets say config file), the schedule "afterInstallExecute" allows the upgrade process to keep the changes made to the file, because it is not replaced on upgrade?
Yes, late major upgrade can change the handling of modified unversioned files. If you really want that behavior then you need to follow the Component Rules and version your files properly. Early major upgrade is more forgiving, late upgrades require you to be more disciplined.
And there is no easy way to preserve user modified files, and replace same version binaries at the same time? (Easy understand as no custom action.)
You'll find "replace same version binaries" isn't an optimized scenario.
So what are my options really? Is there really no way to say "override this file" in wix?
|
-1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.