[英]WiX UNinstalling files and Reg Keys on Install
I have a WiX installer on my Windows Form Application. 我的Windows窗体应用程序上有一个WiX安装程序。 I always do a major upgrade so every build will serve as an installer(new customer) and an updater(previous customer).
我总是进行重大升级,因此每个版本都将充当安装程序(新客户)和更新程序(以前的客户)。 The problem I am having is that the Installer is removing registry keys and config files that were previously installed by the installer and subsequently modified.
我遇到的问题是安装程序正在删除先前由安装程序安装并随后被修改的注册表项和配置文件。
For example, on initial install, I put in a file in C:\\programdata\\myConfig.xml. 例如,在初始安装时,我将文件放在C:\\ programdata \\ myConfig.xml中。 After Install the user modifies the file by replacing it with his config.xml.
安装后,用户通过用config.xml替换文件来修改文件。 When my Installer runs on an upgrade, the installer removes this file.
当我的安装程序在升级上运行时,安装程序将删除此文件。 When the Installer runs and the file does not exist, it installs myconfig.xml correctly.
当安装程序运行且文件不存在时,它将正确安装myconfig.xml。
I want the installer to never overwrite an existing file, and NEVER remove it either. 我希望安装程序不要覆盖现有文件,也不要删除它。
<DirectoryRef Id="myFolder">
<Component Id="CMP_ConfigFile" Guid="{some guid}" NeverOverwrite="yes">
<File Id="myConfiguration.xml" Source="RefFiles\myConfig\xml" KeyPath="yes"/>
</Component>
</DirectoryRef>
Above is the code block from my WiX installer. 上面是我的WiX安装程序的代码块。 I am having the same issue with my registry keys.
我的注册表项存在相同的问题。 WiX is removing them on Upgrade.
WiX会在升级时删除它们。
<Component Id="RegistryEntriesOne" Guid="{some guid}" Directory="TARGETDIR" NeverOverwrite="yes" >
<RegistryKey Root="HKLM" Key="SOFTWARE\myCompany\myApp" Action="create">
<RegistryValue Type ="string" Name="ConfigurationFilePath" Value="C:\ProgramData\myConfig.xml" KeyPath="yes"/>
</RegistryKey>
</Component>
Thoughts? 思考? Kurt
库尔特
You need to add the Permanent attribute to the component and set it to yes that will prevent the component from being uninstalled 您需要将Permanent属性添加到组件并将其设置为yes,这将防止组件被卸载。
<Component Id="CMP_ConfigFile" Guid="{some guid}" NeverOverwrite="yes" Permanent="yes">
<File Id="myConfiguration.xml" Source="RefFiles\myConfig\xml" KeyPath="yes"/>
</Component>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.