How to prevent Wix from removing registry entries on uninstall?
<RegistryKey Id="MyServerRegInstallDir" Root="HKLM" Key="Software\MyApp\Server" Action="create">
<RegistryValue Name="InstallDir" Type="string" Value="[INSTALLDIR]" />
<RegistryValue Name="DataDirectory" Type="string" Value="[MYAPPDATADIR]" />
</RegistryKey>
The subkeys InstallDir and DataDirectory is deleted on unin开发者_运维问答stall. How do I prevent it?
Ideally Action="create" must do it.
Set the Permanent="yes" attribute on the parent component.
http://wix.sourceforge.net/manual-wix3/wix_xsd_component.htm
Permanent
YesNoType
If this attribute is set to 'yes', the installer does not remove the component during an uninstall. The installer registers an extra system client for the component in the Windows Installer registry settings (which basically just means that at least one product is always referencing this component). Note that this option differs from the behavior of not setting a guid because although the component is permanent, it is still patchable (because Windows Installer still tracks it), it's just not uninstallable.
精彩评论