Search code examples
wix

Install two MSI and one EXE with an api Call


I just started studying wixtoolset (https://wixtoolset.org/).

My need would be to install two msi files given by our supplier and one exe file on different machines.

Each machine will have its specific configuration, so my idea is to download this configuration via an API call.

How can I structure the project? I've read that to install two msi I need to use a bundle but I couldn't find information on how to use a customaction.

Can I not use a bundle and call the msi installer?


Solution

  • You're right. To install multiple MSI files, you create a bundle (single .exe file) and use the "Chain" element to include each individual package. Some examples here: https://wixtoolset.org/docs/tools/burn/#chain

    As for how custom actions are used:

    Windows Installer custom actions are useful when the developers of an installation package needs implement scenarios that are not provided by default. For example validating user input, encrypting user input or showing custom progress information (time remaining) on the installation UI. https://seshuk.com/2021-07-18-wix-customaction-admin/

    Official documentation for custom actions (Wix4) https://wixtoolset.org/docs/tools/wixext/

    To answer your question, you should be able to make API calls through a custom action, as it is just a separate C#/C++ or VB project. Then, in your bundle you can configure when/how the custom action is executed, plus some additional logic.

    As for a UI, you can either use the WixStandardBootstrapperApplication which offers themes for most use cases. https://wixtoolset.org/docs/tools/burn/wixstdba/

    Or, if you need custom pages for your bundle, you can build your own (using custom actions to handle any custom user input etc.) and define your own installer sequence.