Automatic account creation is now enabled. Captcha authentication required for account creation and editing unless you are trusted here.

Embed a Third Party Cab File

From WiX Wiki at MindCapers

Jump to: navigation, search
Question
How do i embed and install a 3rd party msi (eg. directx or wse runtime) if not already installed?
Answer
I regularly install DirectX as part of my WiX packages, here's the code for a file I just include for the functionality to 'appear':
<?xml version='1.0' encoding="utf-8"?>
<Include xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>
    <Feature Id="DirectX9" Title="DirectX9" Level="100" Description="DirectX9"
             AllowAdvertise="no" Display="hidden">
	<ComponentRef Id="DirectX9" />
    </Feature>
	
    <Property Id="DirectXDll">DirectX9\dsetup.dll</Property>
    <Property Id="InstallDX">No</Property>
    <CustomAction Id="SetInstallDX" Property="InstallDX" Value="Yes" />
    <CustomAction Id="MsiInstDX" BinaryKey="MsiCustomActions"
        DllEntry="MsiInstDX" Impersonate="yes" />
    <CustomAction Id="MsiInstDXProp" Property="MsiInstDXDeferred"
        Value="[UILevel];[SourceDir][DirectXDll]" Impersonate="yes" />
    <CustomAction Id="MsiInstDXDeferred" BinaryKey="MsiCustomActions"
        DllEntry="MsiInstDX" Execute="deferred" Impersonate="yes" />

    <InstallExecuteSequence>
        <Custom Action="SetInstallDX" After="LaunchConditions">(NOT Installed) AND
((DXMajorVersion < 4) OR (DXMajorVersion = 4 AND DXMinorVersion <9))</Custom>
        <Custom Action="MsiInstDX" After="InstallInitialize">(NOT Installed) AND
(InstallDX = "Yes")</Custom>
        <Custom Action="MsiInstDXProp" After="MsiInstDX">(NOT Installed) AND
(InstallDX = "Yes")</Custom>
        <Custom Action="MsiInstDXDeferred" After="MsiInstDXProp">(NOT Installed)
AND (InstallDX = "Yes")</Custom>
    </InstallExecuteSequence>
	
    <InstallUISequence>
        <Custom Action="SetInstallDX" After="LaunchConditions">(NOT Installed) AND
((DXMajorVersion < 4) OR (DXMajorVersion = 4 AND DXMinorVersion <
9))</Custom>
        <Custom Action='SetRebootRequired' After='SetInstallDX'>(NOT Installed)
AND (InstallDX = "Yes")</Custom>
    </InstallUISequence>
	
    <DirectoryRef Id="TARGETDIR" >
        <Directory Id="DirectX9" Name="DirectX9" src="Installs\Common\DirectX9c">
            <Component Id="DirectX9" Guid="80A814B2-E059-4A83-9533-C9A9A694C869" DiskId="1">
                <File Id="DX9BDA.cab" Name="BDA.cab" Compressed="no" />
                <File Id="DX9BDANT.cab" Name="BDANT.cab" Compressed="no" />
                <File Id="DX9BDAXP.cab" Name="BDAXP.cab" Compressed="no" />
                <File Id="DX9DirectX.cab" Name="DirectX.cab" Compressed="no" />
                <File Id="DX9dsetup32.dll" Name="dsetup32.dll" Compressed="no" />
                <File Id="DX9DSETUP.dll" Name="DSETUP.dll" Compressed="no" />
                <File Id="DX9dxnt.cab" Name="dxnt.cab" Compressed="no" />
                <File Id="DX9DXSETUP.exe" Name="DXSETUP.exe" Compressed="no" />
                <File Id="DX9ManagedDX.CAB" Name="ManagdDX.CAB" LongName="ManagedDX.CAB"
                    Compressed="no" />
            </Component>
        </Directory>
    </DirectoryRef>
</Include>
Personal tools