p4bl0
p4bl0

Reputation: 11

Avoid uninstall when WiX AllowSameVersionUpgrades is Yes?

I have the WiX's Product Id="*" and AllowSameVersionUpgrades="yes", so I can have 1 installer with different features (different sample images, but same .exe).

And I want to be able to install the multiple versions in the same machine so only the new features are added and the old features remain in the folder. But the old features are always being deleted. Is there a way to handle the correct way, maybe using Custom Actions?

Upvotes: 0

Views: 569

Answers (1)

p4bl0
p4bl0

Reputation: 11

For anyone with a similar problem the solution I've found was create a property:

<Property Id="DELFILES" Secure="yes"/>

Secure="yes" is very important otherwise the property's value won't be read when running the installer.

And then add this condition for the custom action:

<![CDATA[(REMOVE = "ALL") AND (DELFILES = "TRUE")]]>

Finally to install I just call the .msi and pass the parameter:

MsiExec.exe /x MyInstaller.msi DELFILES="TRUE"

Upvotes: 1

Related Questions