I'm trying to create installer using WiX. My problems is that I have to install a third party software only if it is not already installed or its version is older than the current version of the included one. See my example below. Also It would be great if you give me some suggestions for this third party software. How to prevent uninstalling it if it is used by another program or just keep it permanent?
I prefer not to use registry search. This software I'm trying to add is Dokan driver.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="MyApp" Version="1.2.0.0" Manufacturer="Me"
UpgradeCode="{GUID}" IconSourceFile="..\icon.ico">
<BootstrapperApplicationRef
Id="WixStandardBootstrapperApplication.RtfLicense" >
<bal:WixStandardBootstrapperApplication
LogoFile="..\lo64.png" LicenseFile="License.rtf"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="NetFx45Web"/>
<ExePackage
SourceFile="..\ThirdPartySoftware_0.6.0.exe"
Permanent="yes"
InstallCondition="NOT Installed"/>
<MsiPackage SourceFile="..\MyApp.msi"/>
</Chain>
</Bundle>
</Wix>
With this edit I now have installer that checks if Dokan is installed and if not installs it.
I tried checking version but the file is not versioned and it gives me NULL exception.
<util:FileSearch
Id="CheckDokan"
Path="[ProgramFilesFolder]Dokan\DokanLibrary\dokanctl.exe"
Variable="Dokan"
Result="exists"/>
<Chain>
<PackageGroupRef Id="NetFx45Web"/>
<ExePackage
SourceFile="Dokan.exe"
Permanent="yes"
InstallCommand="/q"
DetectCondition='Dokan'/>
<MsiPackage SourceFile="MyApp.msi"/>
</Chain>
I could say that @Yawar helped me.