Here's my situation.
I need to integrate the installation files of Erlang, RabbitMQ and my Msi package into one single Wix Bundle. I am currently using a Bootstrapper project to help me do it, and I'm still struggling with how to check the availability of Erlang and RabbitMQ inside my local machine. As far as I know, there're 3 options:
Do the RegistrySearch with the RememberProperty pattern: This one seems impossible since after uninstalling Erlang, the reg key is still there.
Use the CustomAction to run a check by cmd line. This one is not very likely too since Window Installer does not support return value from CustomAction.
Do the Directory and FileSearch. We cannot make the assumption about where users install the files on their local machine, so this one is also not likely.
What do I miss? Did I do wrong somewhere else? Can you guy help me with this? How can I validate the existence of RabbitMQ and Erlang by using Wix?
Below is my code:
Bundle.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?define BundleName = "My Bundle name" ?>
<?define BundleVersion = "1.0.0.0" ?>
<?define BundleFullVersion = "1.0.0.0" ?>
<?define BundleManufacturer = "My Company" ?>
<?define BundleUpgradeCode = "My Upgrage code" ?>
<Bundle Name="$(var.BundleName)"
Version="$(var.BundleVersion)"
Manufacturer="$(var.BundleManufacturer)"
UpgradeCode="$(var.BundleUpgradeCode)">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<bal:WixStandardBootstrapperApplication
SuppressOptionsUI="yes"
LicenseUrl=""
LogoFile=".\resources\images\my_logo.png"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="ExePackages"/>
<PackageGroupRef Id="MsiPackages"/>
</Chain>
</Bundle>
</Wix>
ExePackages.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<util:RegistrySearch
Root="HKLM"
Key="SOFTWARE\Ericsson\Erlang\ErlSrv\1.1\RabbitMQ"
Format="raw"
Variable="RabbitMQRegistrySearch"
Win64="yes"
Result="exists"/>
<util:RegistrySearch
Root="HKLM"
Key="SOFTWARE\Ericsson\Erlang\ErlSrv\1.1"
Format="raw"
Variable="ErlangRegistrySearch"
Win64="yes"
Result="exists"/>
<PackageGroup Id="ExePackages">
<ExePackage Id="Erlang"
DisplayName="Erlang"
Compressed="yes"
Permanent="yes"
Cache="yes"
PerMachine="yes"
Vital="yes"
DetectCondition="ErlangRegistrySearch"
SourceFile=".\Prerequisites\otp_win64_20.0.exe"/>
<ExePackage Id="RabbitMQ"
DisplayName="RabbitMQ"
Compressed="yes"
Permanent="yes"
Cache="yes"
PerMachine="yes"
Vital="yes"
DetectCondition="RabbitMQRegistrySearch"
SourceFile=".\Prerequisites\rabbitmq-server-3.6.5.exe"/>
</PackageGroup>
</Fragment>
</Wix>