WIX 安装文件,覆盖 [英] WIX installing files, override

查看:25
本文介绍了WIX 安装文件,覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 WIX 和下面的代码将文件安装到目录中.

Hi I am installing files into a directory using WIX with the code below.

 <Directory Id="CMSICONSDIR" Name="CMSIcons">
    <Component Id="CMSICONSDIR_C" Guid="B0328FBF-D9F7-4278-B16C-28650016FF86" SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no" Location="either">
       <CreateFolder/>
       <File Id="AddCamera.png" Name="AddCamera.png" DiskId="1" Source="..\..\OrionVEWorld\bin\Release\CMSICons\AddCamera.png" KeyPath="no"  />
       <File Id="aldownloadsmall.png" Name="al-download-small.png" DiskId="1" Source="..\..\OrionVEWorld\bin\Release\CMSICons\al-download-small.png" KeyPath="no"  /> 

我的应用程序的工作方式是用户可以在该目录中复制他们自己的文件,覆盖他们喜欢的内容.

They way my application works is that a user can copy their own files in that directory overriding with what they prefer.

问题是当我为更新进行下一次安装时,它会使用安装中规定的文件覆盖这些文件.

The problem is when I do my next install for an update, its overrides those files with the files stipulated in the install.

如何确保在运行安装时不会覆盖现有文件,而只会添加新文件.

How do I ensure that when I run my install it does not override the existing files that are there and only adds new ones.

不幸的是,在其他情况下,我确实需要覆盖现有内容的文件.

Unfortunately in other case I do need files that override what is there.

我确实有一个升级脚本部分,它会影响如下

I do have an upgrade script section which can affect this as below

<Upgrade Id="$(var.UpgradeCode)">
  <UpgradeVersion Minimum="$(var.ProductVersion)" OnlyDetect="no" Property="NEWERVERSIONDETECTED"/>
  <UpgradeVersion Minimum="1.0.0.0"
                  IncludeMinimum="yes"
                  OnlyDetect="no"
                  Maximum="$(var.ProductVersion)"
                  IncludeMaximum="no"
                  Property="PREVIOUSVERSIONSINSTALLED" />
</Upgrade>

感谢任何建议.

推荐答案

您可以尝试通过修改 RemoveExistingProducts 操作.您可以将它放在 InstallFinalize 之后(链接文章中没有 4 选项).

You could try changing the upgrade order by modifing the sequence of RemoveExistingProducts action. You could place it after InstallFinalize (no 4 option in the link article).

另外这篇文章解释了 Windows安装程序处理整个文件覆盖逻辑.

Also this article explains how windows installer handles the whole file overwrite logic.

同时向组件添加永不覆盖"属性.

Also add the "Never overwrite" attribute to the components.

这篇关于WIX 安装文件,覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆