I have two components in which one component have simple.exe
and another component has sample.dll
in one MSI. If i install MSI both simple.exe
and sample.dll
will install and in program files under some folder it is having two one is .exe
and .dll
. If I do a major upgrade to entire MSI, it will replace the folder that is created in the program files with new one. So how to make wix not replace .exe
if i change / provide update for .dll
file and vice versa. And while providing an update to .dll
I will register and unregister keys using some .bat
file. Please help me to solve I need a conditional major upgrade that will replace particular files when I change them.
Please find the below code:
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>