Search code examples
wix

How to conditionally install third party applications in WiX Bundle


I have a WiX installer and I have created a bootstrapper project for the same in order to install my pre requisites. However, I would like pre-requisites to only get installed if they are not already there on the system. Is it possible to add such a condition to my code?

This is the code I have right now, where in it installs my application. But I would like to add the conditions to it.

<Fragment>
        <PackageGroup Id="OpenTAP">
            <ExePackage
              SourceFile="..\..\..\External\Prerequisites\OpenTAP\ITS_OpenTap.9.18.5_Installer.exe"
              DetectCondition="ExeDetectedVariable"
              InstallCommand="/q /ACTION=Install"
              RepairCommand="/q ACTION=Repair /hideconsole"
              UninstallCommand="/q ACTION=Uninstall /hideconsole" />
        </PackageGroup>
    </Fragment>

Solution

  • The ExePackage will only install if the DetectCondition is false. So, as long as you are setting the ExeDetectedVariable correctly then Burn will behave exactly as you desire.