RikSaunderson
RikSaunderson

Reputation: 3765

WiX: Install and uninstall third party dependencies

I have an application which I have built in Visual Studio 2012, one part of which is in C# and one part of which is in C++. The GUI for the application uses a third party GUI control.

Consequently I have three dependencies that need to be checked for and installed with my project:

  1. The Microsoft Visual C++ redistributable
  2. The .NET framework 4.5
  3. The GUI control

My installer for the project is currently built using WiX. Is there a way to make WiX do the following?:

  1. At install time check for the presence of (e.g.) the C++ redistributable and install it if it is not present
  2. Remove these components at uninstall (if and only if they were installed at install time, obviously)

If not, my guess would be that the answer is to create another C# project which can run each msi in turn, but I'd like to be able to do the whole thing through WiX - is it possible? If so, how?

Upvotes: 3

Views: 6876

Answers (2)

Marco
Marco

Reputation: 31

You could create a bootstrapper to install your application and its prerequisites.

WiX toolset provides all necessary tools for you to create a bundle that contains different packages, one of it would be your own MSI.

Have a look at Burn and the WiX toolset documentation. The How To Guides show ways to achieve exactly what you want, for example there is a tutorial describing how to Install the .NET Framework using a bootstrapper.

Maybe the Standard Bootstrapper Application is what you are looking for. Or have a look at customized Managed Bootstrapper Applications. For example the fancy Visual Studio 2012 installer is a WiX MBA. But be warned, in my opinion a MBA is a lot of work.

Upvotes: 1

Tom Blodget
Tom Blodget

Reputation: 20802

WiX has added to its original purpose of being a Windows Installer toolset. It now has a bootstrapper/chainer/bundler/reboot manager/package manager, sometimes called Burn. In Visual Studio, it is accessible via the WiX Bootstrapper project template.

You'd need to have a WiX Setup project for your application. Then define a chain sequence for the four setups. VC and .NET should be marked permanent because you don't known if and when they should be uninstalled. Same thing probably goes for the GUI control. That leaves your application, which the bootstrapper will uninstall when it is uninstalled.

Upvotes: 4

Related Questions