我正在使用 Wix 为我的安装创建一个 .msi。当 msi 安装程序进行重大升级时,我想保留一个配置文件。
这是我的 Product.wxs 文件中的相关部分:我的升级属性:
<MajorUpgrade
Schedule="afterInstallInitialize"
DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
根据我的理解,应该阻止删除我的配置文件的组件:
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="Content" Name="Content">
<Component Id="Config" Guid="432FF769-1011-47CF-BFFD-0BF780768C45">
<File Source="$(var.MO.Packing.Wpf.TargetDir)\Content\StationConfig.xml" Name ="StationConfig.xml"
Id="config" KeyPath="yes" />
</Component>
</Directory>
</DirectoryRef>
添加我的 Feature 属性以防它是相关的:
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="myapplication.exe" />
...
<ComponentRef Id="Config" />
...
</Feature>
在创建这个逻辑时,我遵循了这个指南:http: //blogs.msdn.com/b/astebner/archive/2008/10/19/9006538.aspx
另请阅读其他一些问题和资料: wix v3.8 中的主要升级时如何保留配置文件?
https://msdn.microsoft.com/library/aa371197.aspx
还有一些……
任何人都可以识别问题吗?
如有必要,我会在我的问题中添加任何其他相关数据。
任何帮助表示赞赏!