Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wix在升级时保留应用程序设置文件_Wix_Windows Installer_Installation_Upgrade_Preserve - Fatal编程技术网

Wix在升级时保留应用程序设置文件

Wix在升级时保留应用程序设置文件,wix,windows-installer,installation,upgrade,preserve,Wix,Windows Installer,Installation,Upgrade,Preserve,我正在使用Wix为我的安装创建一个.msi。 我想在msi安装程序进行重大升级时保留一个配置文件 以下是my Product.wxs文件中的相关部分: 我的升级属性: <MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 根据我的理解,应该阻止删除我的配置

我正在使用Wix为我的安装创建一个.msi。 我想在msi安装程序进行重大升级时保留一个配置文件

以下是my 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 Id="MainApplication" Title="Main Application" Level="1">
  <ComponentRef Id="myapplication.exe" />
  ...
  <ComponentRef Id="Config" />
  ...
</Feature>

...
...
在创建此逻辑时,我遵循以下指南:

同时阅读一些其他问题和资料:

还有一些

有人能找出问题吗

如有需要,我会在问题中加入任何其他有关资料


感谢您的帮助

您还没有明确指出问题所在,因此我假设配置文件将被新升级安装的配置文件替换

您试图利用的规则是:

如果有哈希检查,则有一个相关规则,但日期规则仍然适用

因此,您只需要将主要的升级顺序安排在“早期”,例如安装初始化之后。然后,按照文件替换规则,在旧产品的基础上安装升级。旧的修改配置文件将不会被替换

如果这不起作用,那么可能是文件(在旧产品中)在第一次安装后没有更改,因此您可能只是安装了另一个副本,并且没有丢失任何内容。使用详细日志执行升级,查找文件名,并查看其中关于覆盖的说明:


msiexec/i[msi文件的路径]/l*vx[文本日志文件的路径]

我确实通过apling:Schedule=“afterInstallInitialize”设置了顺序。此外,文件在首次安装后会发生更改。如何使用详细日志?你能不能提供一个伪装?