问题
The MajorUpgrade element in WiX seems to be uninstalling the existing version. But I have a requirement wherein I have to upgrade from 1.0.0 to 2.0.0 without uninstalling 1.0.0. But this doesn't mean, it will have both 1.0.0 and 2.0.0 showing in the Add/Remove Programs. My 1.0.0 version has a file, a registry entry, a custom windows service and so on. My 2.0.0 essentially, will modify an existing file and add a new file. In our case, it is possible to make only changes like these and still increment the major version. But for this, I don't want to uninstall and reinstall the services and so on. But if it's a fresh install, all the components will have to be installed. For example, if a customer has 7.9.0 version installed and wants to upgrade to 8.0.0 (This technically might be a major upgrade because major version is updated or minor upgrade because there may be only incremental changes going from 7.9.0 to 8.0.0?), uninstalling 7.9.0 completely may lead to issues like loss of data and so on. Is there a way to achieve this? If so, can anyone please provide some steps / examples or provide some links showing this? Note: I am not talking about Patch. I am able to get a patch working. But I am also confused between Minor upgrade and Small update.
FireGiant's Tutorial talks about using <Upgrade> element whereas there are many other articles which talk about using <MajorUpgrade> element.
回答1:
jbudreau is correct. There are two different types of major upgrades. The early major upgrade uninstalls the existing version prior to installing the new version. This is the behavior you explain in your post.
Look at the execute sequence table and move the RemoveExistingProducts
action to after InstallFinalize
and this will now become the late upgrade, where it overwrites existing files using component rules and then remove any files that should be removed.
来源:https://stackoverflow.com/questions/47307640/wix-upgrade-without-uninstallation-of-existing-version