WiX Wednesday Part 1.0.5: Creating a WiX Project in Visual Studio

In a lot of my examples I am going to assume that you are using an IDE like Visual Studio. As of version 3, WiX would automatically install the WiX project template for use in Visual Studio. This enables us to leverage the capabilities of WiX with our solutions as well as use features such as Intellisense when creating WiX projects. The Visual Studio package is known as Voltive, an is available to Visual Studio 2005 and later. WiX appears to be perfectly capable when being scaled up to deploy enterprise-level solutions. If you are deploying many dlls with WiX you may want to to unload the project whilst running a large number of local F5 builds as it will re-compile the dlls all over again, meaning that you waste time compiling, then compiling again!

To create a WiX Project is very simple though you need to make sure you have WiX 3.0 or later downloaded and installed and using Visual Studio 2005 or later. It really is as simple as creating any other project in Visual Studio 2012:

Start Page - Microsoft Visual Studio_2013-04-28_19-45-40

Once created there is a single product.wxs file and nothing else. The name of this file is nothing significant, though I admit I’ve never renamed it as everyone knows it is going to be the start-up file and so for “the next guy” it’s probably a good idea to leave it as is. You can add other .wxs files (you can see why you would want to do this in later posts.)

If you open up the references and go to add references, scroll down to the bottom you will see quite a few prefixed “Wix”.

wixAddReference

If you are planning on creating a UI you do need to include a reference to the WiXUI dll in your project. WiXUI provides the user interface of a typical installer package, so it provides all typical wizard pages: licence agreement, customer information, different types of setup (typical/custom/complete), customisation of the target deployment folder, disk usage requirements etc.

WiXUtilExtension is a dll which will be leveraged in a later example, and if you are deploying an IIS based MSI then you will probably add references to the WixIIS and WiXFirewall extensions also. Obviously only add what you need!

Summary

Microsoft have made it straightforward to leverage the use of WiX within larger solutions in Visual Studio. There are also considerable references that we can utilise within our WiX projects so that they can be used to create a UI for our installers or if we are deploying different types of solutions.

Sources

  1. Download WiX from CodePlex here.
  2. As I said, I don’t think the manual for WiX is all that great. It feels like it’s been written by an expert in WiX for an expert in WiX. But I guess at least there is a manual.
  3. There’s also a very comprehensive tutorial written about WiX that explains it in far greater detail than I have here. It also provides plenty of examples. Such as in the advanced sections there is a tutorial on creating your own custom UI.
  4. I’ve probably short-changed msiexec. Aside from running msiexec /? in the cmdline, there’s plenty of examples on the TechNet site.
  5. There’s even a book available! I’ve not read it, however the reviews on amazon.com seem positive. For such an esoteric piece of software, and at a reasonable price it’s worth a go? Maybe I’ll buy it and review it at the end of this series….

Author: Richie Lee

Full time computer guy, part time runner. Full time Dad, part time blogger. Pokémon Nut. Writer of fractured sentences. Maker of the best damn macaroni cheese you've ever tasted.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s