Hi, I'm trying to do some MajorUpgrade but some .exes and .dlls are being deleted by the installer, with some tests I found out that if the file version is lower than the installed one, it will delete, is that correct? Is there a way to ignore this check and always overwrite or keep the files?
Thanks in advance.
hi, try to use property of file with { overwriteoninstall = true / false } . Like name say, it overwritefile on install yes or no. Wix marked this for msi and msi do his job. Not sure in majorupgrades, but try to find out, what best option for your
Thanks for your answer, yes I tried OverwriterOnInstall already but it keeps deleting lower version files.
Is there a way to ignore the last number from a file version or something? For example, our versions are something like this: X.X.X.*
I am afraid that the answer to that can only be found in WiX documentation. MSI/WiX is extremely complicated and in many cases unintuitive. I wouldn't be surprised if there is some "magic" xml attribute that does the trick.
If you find a pure WiX solution then it can be easily integrated with your WixSharp project.
I've had similar issues with trying to downgrade files to a lower version during a major upgrade. I ended up using a trick with "CompanionFile" attribute.
new File("PathToDLL") { AttributesDefinition = "Name=49F631DB-450A-4108-8F5C-434AF3FEE6DC.DLL" },
new File("PathToDLL") { AttributesDefinition = $"CompanionFile="DllToDowngrade.DLL"" }
More info here:
https://stackoverflow.com/questions/54763243/how-to-explicitly-remove-dll-during-majorupgrade-using-wix-toolset
Use REINSTALLMODE
C#
new Property("REINSTALLMODE", "amus");
Thank you Xaddan! It really worked after all.
I have added a feature request #638 based on the findings from in this thread.
Guys, please provide your input there on what is the most practical default value for Project.ReinstallMode feature.
Most helpful comment
I have added a feature request #638 based on the findings from in this thread.
Guys, please provide your input there on what is the most practical default value for
Project.ReinstallModefeature.