Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include prerequisites with msi/Setup.exe in WIX

I'm trying to combine my package in a single setup EXE file and upload it to the Internet.

I have created a Microsoft bootstrapper that contains Setup.exe with project MSI output, and pre-requisite .NET Framework 2.0, Windows Installer 3.1 , Visual C++ 2005 redistributables, and Microsoft ReportViewer. I have created a setup project using Visual Studio 2008.

Now I'm trying to create a single compressed setup using WiX 3.6. I have installed it in Visual Studio 2008.

I have attached the setup.exe and MSI file using following commands.

<ExePackage SourceFile ="setup.exe" Compressed ="yes"/>
<MsiPackage SourceFile ="myproject.msi" Compressed ="yes" />

But it is unable to find the MSI file. How can I include the above prerequisites with it?

Or can I download the above prerequisites from the Internet while installing? How do I do it?

like image 411
Narayan Avatar asked Dec 27 '22 00:12

Narayan


1 Answers

I have removed the default setup.exe from Visual Studio and used the MSI file and dependencies from Visual Studio to create a WiX 3.6 Bootstrapper:

<?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">

    <Bundle Name="My Application"
            Version="1.0"
            IconSourceFile ="E:\logo.ico"
            Manufacturer="My company"
            UpgradeCode="4dcab09d-baba-4837-a913-1206e4c2e743">

        <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
            <bal:WixStandardBootstrapperApplication
                LicenseFile="E:\License.rtf"
                SuppressOptionsUI ="yes"
                LogoFile ="logo.ico" />
        </BootstrapperApplicationRef>

        <Chain>
            <ExePackage
                SourceFile ="ReportViewer\ReportViewer.exe"
                Compressed ="yes"
                Vital ="no"
                Permanent ="yes"/>
            <ExePackage
                SourceFile ="vcredist_x86\vcredist_x86.exe"
                Compressed ="yes"
                Vital ="no"
                Permanent ="yes"/>
            <MsiPackage
                SourceFile ="MySetup.msi"
                Compressed ="yes"
                DisplayName ="My Application"
                ForcePerMachine ="yes"/>
        </Chain>
    </Bundle>
</Wix>

It compresses into an single EXE file with prerequisites.

like image 138
Narayan Avatar answered Dec 28 '22 17:12

Narayan