Generating an EXE from MSI in Wix

2019-09-14 02:01发布

问题:

I'm tring to generate EXE file from MSI in Wix installer, I added a new project (Bootstrapper) but I can specifying the path of my MSI file

<Bundle Name="Bootstrapper" Version="1.0.0.0" Manufacturer="" UpgradeCode="e45fdbb6-192c-46f7-b4db-d04af69edada">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
    <Chain>
        <!-- TODO: Define the list of chained packages. -->
         <MsiPackage SourceFile="WixSetup.msi" /> 
    </Chain>
</Bundle>

Can you help ?

Thanks in advance

Abdulsalam

回答1:

Add a reference of your msi's wixproj to your bootstrapper application.

You can now reference the msi file like this

<MsiPackage SourceFile="$(var.WixProjName.TargetPath)" />

This will automatically point to the debug location or release location depending on your build mode.

You can see a list of well-defined vars passed to candle.exe in the output when building. You'll see a bunch of defines like "-dWixProjName.Property=Value" and then you can use those values in your bundle xml like so $(var.WixProjName.Property) which will get replaced by the Value before compiling.

You can see a list of the defined properties when you reference another project here: http://wixtoolset.org/documentation/manual/v3/votive/votive_project_references.html



标签: wix