How to create and edit WiX files? [closed]
Asked Answered
W

3

6

Microsoft is moving away from the Visual Studio built-in MSI setup projects. WiX seems to be one alternative. But the tutorials I've found for WiX are all about five years old. For example, WiX: Hints for New Users (Part 1 of 3) is one from 2007.

  1. Are there newer/better tutorials for WiX?

    That article and others mention Votive as a way to create and edit WiX files.

  2. Is Votive still an active project?

    WixEdit claims to be the only active project for a WiX editor, but it isn't integrated into Visual Studio.

  3. Should I use WixEdit or Votive?

Worth answered 4/10, 2012 at 16:41 Comment(1)
I'm tempted to edit your question, because it's badly worded. You've asked 3+ questions (kindof) and you want to use Visual Studio with Intellisense for WiX (i.e. votive) but you are also asking about tutorials, which is a much better question that I've answered below.Season
S
10

Here's an answer I've posted before here. I'm not going to update it except to add Joy of Setup (from bob-arnson) and all the links in his blog sidebar will also be of use, less so in learning from scratch but very useful in knowing more once you get up to speed.

I dove into WiX about 4-5 years ago and it took me a good 6+ months before I felt I knew what I was doing and 12+ months to feel confident. There is a LOT that could be done to make it easier to get started from scratch - but the problem that most people don't realise is that if first you learn Windows Installer/MSI, then WiX is damn simple.


Go pick up a copy of The Definitive Guide to Windows Installer. I've lost count of how many times I've recommended it to people who are getting stuck on the concepts and are struggling to understand how Windows Installer works. Make sure you grab the Windows Installer SDK as well.

Getting to grasp with Windows Installer is the first stage of your learning, once that's sunk in you'll understand how InstallShield works (or doesn't work as the case may be..). Wise, InstallShield, etc try to shield you from the underlying concepts and have their own trickery/hacks to get around the limitations of Windows Installer.

Stage two (if you're serious about understanding Windows Installer) is learning WiX (The WiX Tutorial isn't too bad, although it's a bit out of date and targeted at WiX 2.0 rather than 3.0) and joining the wix-users mailing list. Don't join the users list until you've finished the book mentioned above, you'll be well in over your head. Questions from those who don't understand the Windows Installer concepts largely go ignored, however questions from people who have done their homework will find it a great resource.

What's not covered in the book is Vista, Robert Flamings blog entries on Understanding UAC and Vista (written when Vista was in it's beta stage) are the best information you'll find on the topic.

One thing that both the Windows Installer and WiX teams is really good at is keeping the documentation (Help files) up to date. Whenever I'm working on setups I'll generally have Wix.chm and Msi45.chm open on one monitor ;)

Along with the documentation, blogs from people on the WiX and Windows Installer teams are great for learning new tricks, etc. Far too many to list here, but once you know the terminology you'll find most of them popping up in google results.

If this all seems too much, then check out NSIS. Great for simple "I just need to copy files" type installations, not so great for enterprise deployments. If you're torn between the two then maybe go take a look at Rob Mensching's old blog when setup isn't just xcopy. Articles there are probably what convinced me that diving in and learning the underlying Windows Installer concepts would pay off in the long run. And it has :)

Update - since my original post, WiX: A Developers Guide to Windows Installer XML has been released and is also a good resource for beginners. (I didn't find it that great myself though.) I still suggest reading The Definitive Guide to Windows Installer as a starting point. Windows Installer and WiX isn't something you just pick up in a few days, it'll take a few months.

Season answered 5/10, 2012 at 5:26 Comment(3)
The Problem is: Some people only want to install fairly simple programs. They do not want to program Installers for a living, but Installers a simply a necessity. And therewe are lost: Building a simple Wix-Bootstrapper is WAY more complicated than it ought to be. Not because Wix is bad, but because no one bothered with writing some comprehensive introductory manuals.Extend
"it took me a good 6+ months before I felt I knew what I was doing and 12+ months to feel confident... WiX is damn simple." This is by far the funniest thing I've read on stack overflow. The irony of that statement is hilarious.Blakeley
WIX is the language, Windows Installer is the API. Most engineers can pick up a new language and be productive in a few weeks if they already understand the underlying libraries they are using.Season
F
5

I used the book WiX: A Developer's Guide to Windows Installer XML to get up to speed with WiX.

You can get Visual Studio integration from the WiX home at CodePlex.

Fief answered 4/10, 2012 at 17:36 Comment(1)
I've just done the "Look inside" for that book at Amazon. It is just what I need. From that quick look I now understand better what I've been struggling with all this week. I've ordered my copy.Worth
T
5

Download WiX and look at the tutorials in the manual (which is also installed as a .chm). When you install WiX, it will install the necessary files and templates so that it integrates nicely with Visual Studio.

Note: Every tool in WiX begins with a letter that helps signify its use. Votive is just the piece that integrates with Visual Studio.

Examples:

  • Votive = Visual Studio
  • Burn = Bootstrapper / Bundle
  • Candle = Compiler
  • Light = Linker
Teresetereshkova answered 4/10, 2012 at 18:58 Comment(3)
Is Votive part of the Wix Toolset that you linked? I installed that toolset yesterday, and I don't see how to start Votive in VS 2010. I don't see how to open Votive outside VS either.Worth
Yes it is. Select File > New > Project. In the Installed Templates window, select Windows Installer XML. Then select "Setup Project" as your standard WiX project to create a MSI.Teresetereshkova
Thanks. I've been using that, and didn't know it was Votive. (I expected something more, like a GUI to make a setup project, Custom Dialogs, a GUI to add files to install to the project, etc.)Worth

© 2022 - 2024 — McMap. All rights reserved.