如何在使用 Wix 卸载期间停止删除文件
How do I stop removal of files during uninstallation using Wix
卸载我的应用程序时,我想将 Wix 设置配置为 NOT 以删除安装过程中添加的几个文件。卸载程序似乎从 MSI 文件中删除了所有最初安装的文件。我怎么做?
这是我希望永久保存的文件
<Binary Id="RootCABinary" SourceFile="Assets\Certificates\RootCA.cer" />
<Binary Id="SubCABinary" SourceFile="Assets\Certificates\SubCA.cer" />
我已经使用 WixIIsExtension.dll
将这些证书安装到 windows 商店。
也将您的二进制文件放入单独的 WiX component and make it permanent. Have a look at this thread
Overwrite: Is it important that the file never gets overwritten? If so, add
"Never Overwrite" to your component. WiX attribute: NeverOverwrite="yes"
. Remember to test upgrade scenarios!
Permanent Component:正如Pavel所述,您可以将组件设置为permanent:
<Component Permanent="yes">
<File Source="License.rtf" />
</Component>
空白 GUID:另一种方法是设置一个 blank component GUID
.它本质上意味着 "install and then leave alone"。不应进行修复或卸载(如果文件不应被覆盖,请记住添加 NeverOverwrite="yes"
):
<Component Guid="" Feature="MainApplication">
<File Source="SubCA.cer" KeyPath="yes" />
</Component>
只读复制:我有时会把文件安装到per-machine path
(例如程序文件下的某处),然后在应用程序启动时将它们复制到 per-user location
(用户配置文件中的某处),然后对它们执行需要的操作不应删除这些文件。这在您想要更改相关文件(它们需要可写)的情况下非常有用。然后从部署问题中 "untangle" 它们是好的(文件根本不会被安装程序操作干扰 - 安装程序不知道它们)。虽然可以卸载安装到程序文件的原始只读副本(不再需要?)。
其他方法:您也可以在安装过程中使用自定义操作创建此类文件(通常只有文本文件),您可以下载在应用程序启动时从您的网站获取有问题的文件(使文件易于管理和更新/替换?容易受到连接问题的影响 - 防火墙等......)并且应用程序可以使用 "internal defaults" 在主目录中创建文件启动时可执行。毫无疑问,还有更多我想不起来的方法。
卸载我的应用程序时,我想将 Wix 设置配置为 NOT 以删除安装过程中添加的几个文件。卸载程序似乎从 MSI 文件中删除了所有最初安装的文件。我怎么做?
这是我希望永久保存的文件
<Binary Id="RootCABinary" SourceFile="Assets\Certificates\RootCA.cer" />
<Binary Id="SubCABinary" SourceFile="Assets\Certificates\SubCA.cer" />
我已经使用 WixIIsExtension.dll
将这些证书安装到 windows 商店。
也将您的二进制文件放入单独的 WiX component and make it permanent. Have a look at this thread
Overwrite: Is it important that the file never gets overwritten? If so, add "Never Overwrite" to your component. WiX attribute:
NeverOverwrite="yes"
. Remember to test upgrade scenarios!
Permanent Component:正如Pavel所述,您可以将组件设置为permanent:
<Component Permanent="yes">
<File Source="License.rtf" />
</Component>
空白 GUID:另一种方法是设置一个 blank component GUID
.它本质上意味着 "install and then leave alone"。不应进行修复或卸载(如果文件不应被覆盖,请记住添加 NeverOverwrite="yes"
):
<Component Guid="" Feature="MainApplication">
<File Source="SubCA.cer" KeyPath="yes" />
</Component>
只读复制:我有时会把文件安装到per-machine path
(例如程序文件下的某处),然后在应用程序启动时将它们复制到 per-user location
(用户配置文件中的某处),然后对它们执行需要的操作不应删除这些文件。这在您想要更改相关文件(它们需要可写)的情况下非常有用。然后从部署问题中 "untangle" 它们是好的(文件根本不会被安装程序操作干扰 - 安装程序不知道它们)。虽然可以卸载安装到程序文件的原始只读副本(不再需要?)。
其他方法:您也可以在安装过程中使用自定义操作创建此类文件(通常只有文本文件),您可以下载在应用程序启动时从您的网站获取有问题的文件(使文件易于管理和更新/替换?容易受到连接问题的影响 - 防火墙等......)并且应用程序可以使用 "internal defaults" 在主目录中创建文件启动时可执行。毫无疑问,还有更多我想不起来的方法。