I have this WiX fragment:
<Component Id="AppData" Guid="{30967EFB-4B86-4EBB-8486-5271D051082E}">
<Condition>NOT KEEPAPPDATA</Condition>
<RemoveFile Id="PurgeAppData" Name="*.*" On="uninstall" />
<RemoveFolder Id="RemoveAppDataFolder" On="uninstall" />
</Component>
in the appropriate <Directory>
element for the directory under application data that the program stores data. However both
msiexec /xpath-to-msi.msi KEEPAPPDATA="TRUE"
and
msiexec /xpath-to-msi.msi
remove the folder, so the condition is not working. I have also tried this condition:
<Condition>KEEPAPPDATA == ""</Condition>
with the same results.
What is the correct way of passing a parameter to msiexec to change behaviour during uninstall? It seems that parameters are just getting ignored.
By default component conditions are not evaluated during uninstall. Here is a similar Stackoverflow question with an answer from Rob Mensching. He suggests using Transitive attribute. From documentation: