我有两个组件,其中一个组件具有simple.exe
,另一个组件具有sample.dll
一个 MSI。如果我同时安装 MSIsimple.exe
并将sample.dll
安装和在某个文件夹下的程序文件中,它有两个是.exe
和.dll
。如果我对整个 MSI 进行重大升级,它会将在程序文件中创建的文件夹替换为新文件夹。.exe
那么,如果我更改/提供文件更新,如何使 wix 不被替换.dll
,反之亦然。在提供更新的同时,我将使用一些文件.dll
注册和注销密钥。.bat
请帮我解决我需要有条件的重大升级,当我更改它们时将替换特定文件。
请找到以下代码:
product.wxs
<?xml version="1.0" encoding="UTF-8"?>
<?define ProductVersion = "0.0.4"?>
<?define ProductUpgradeCode = "d3170abf-b41c-4274-a3a0-85576052f35c"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="saranSample" Language="1033" Version="$(var.ProductVersion)" Manufacturer="example" UpgradeCode="$(var.ProductUpgradeCode)">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of product is already installed." AllowSameVersionUpgrades="no" AllowDowngrades="no" />
<MediaTemplate EmbedCab="yes" />
<Upgrade Id="$(var.ProductUpgradeCode)">
<UpgradeVersion Minimum="$(var.ProductVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/>
<UpgradeVersion Minimum="0.0.0" Maximum="$(var.ProductVersion)" IncludeMinimum="yes" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED"/>
</Upgrade>
<InstallExecuteSequence>
<Custom Action="Filecleaner" After="InstallFinalize"></Custom>
</InstallExecuteSequence>
<Condition Message="A newer version of this software is already installed.">NOT NEWERVERSIONDETECTED</Condition>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="saranSample_$(var.ProductVersion)">
<Component Id="exeFiles" Guid="12345678-1234-1234-1234-222222222222">
<File Id="exe" Source="$(sys.CURRENTDIR)npp.7.5.7.Installer.exe" KeyPath="yes"/>
</Component>
<Component Id="dllFiles" Guid="12345678-1234-1234-1234-222222222223">
<File Id="dll" Source="$(sys.CURRENTDIR)saran.dll" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="saranSample" Level="1">
<ComponentRef Id="exeFiles"/>
<ComponentRef Id="dllFiles"/>
</Feature>