Blog Home  Home Feed your aggregator (RSS 2.0)  
.Net Jonesie - Fun with Wix
A simple programmers blog
 
# Tuesday, May 09, 2006
I've spent about a day and a half creating a MSI to install my project using Wix.  I wanted to use Wix because the MSI has to be built during my build process automatically.  After a confused start I now have a working installer that:
  • Displays a nice splash page
  • Displays a license agreement with a checkbox for confirmation
  • Checks for minimum OS version and .Net 2 Fx
  • Lets the user choose a Typical, Custom or Complete install.  Under custom they can choose Client and/or server components and specify directories for each.
  • Prompts the user to enter config parameters for the client and server and updates the corresponding exe.config and web.config files
  • If the server components are installed it creates a virtual directory in IIS
The next step is to add an option to create the SQL database but given my progress so far I don't expect this will be too hard. Then I need to figure out how to send out patch installs - I suspect this might be a tad harder.
 
Along the way I've discovered a few things about Wix so here's a list of stuff that might help others (and probably myself when I've forgotten this in a few weeks time :).
  • Use the v 2 latest revision.  I used 2.0.4103.0.  Get the source code and binaries - you'll need the source to create custom dialogs.
  • Use the Tutorial.  It's a bit vague in places but just hack something together and you can usually figure out the options.
  • Google 'wix anything' and you will find an answer quickly.
  • Join the wix-user mail list.  The chaps there are very helpful and friendly.
  • Creating a custom dialog is a piece of cake if you follow the tutorial but a GUI tool to create the dialog layouts would be nice.  Maybe there is one ?
  • There is a Visual Studio addin for Wix projects but I had problems with this - maybe my fault - so I just used the tried and true command line method and Visual Studio to edit the raw wxs files.  You should add the provided schemas to your VS schema directory and create a CMD or BAT file to compile and link your MSI.
  • Updating config / xml files from Wix is easy but you have to escape the xpath expression correctly, e.g.: 

    ElementPath="/configuration/applicationSettings/Airways.SUMS.Properties.Settings/setting[\[]@name='FirstDayOfWeek'[\]]/value"

  •  The syntax can be a little wordy in places but in general it all makes sense.  A ComboBox control in a custom dialog looks like this:

    <Control Id="FirstDay" Type="ComboBox" X="115" Y="70" Width="190" Height="15" TabSkip="no" Property="CC FIRSTDAYOFWEEK" ComboList="yes" Sorted="yes">
     <
    ComboBox Property="CC FIRSTDAYOFWEEK"
    >
      <
    ListItem Text="Sunday" Value="0"
    />
      <
    ListItem Text="Monday" Value="1"
    />
      <
    ListItem Text="Tuesday" Value="2"
    />
      <
    ListItem Text="Wednesday" Value="3"
    />
      <
    ListItem Text="Thursday" Value="4"
    />
      <
    ListItem Text="Friday" Value="5"
    />
      <
    ListItem Text="Saturday" Value="6"
    />
     </
    ComboBox
    >
    </
    Control>

  • You can edit the supplied Bitmaps to include your product or company logo.  In fact you can customise everything.
So, I don't know how this compares with InstallShield, Wise etc but I'm quite taken with Wix and I found it quite fun to use.  I'm certainly no expert on installers and MSI's but I've managed to create a slick installer with minimal effort.  Most importantly, Wix passes my 20 minute rule:  I have to be able to produce something useful in 20 minutes or it's no good for me.
 
Tell me what you think.
Tuesday, May 09, 2006 3:34:05 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [2]   General  | 
Tuesday, May 09, 2006 3:43:21 PM (New Zealand Standard Time, UTC+12:00)
Interesting. I started watching the Channel 9 video on this today but got bored halfway through! The guy they were interviewing was obviously passionate about Wix though.
Wednesday, May 10, 2006 10:22:35 AM (New Zealand Standard Time, UTC+12:00)
wow, thats changed a bit since last year, when I was looking at using it. LAst year, it had NO docs, NO help, NO support forum/maillist, no samples worth a damn, and the author said "just google for it" (except, there was nothing out there - even he couldn't find it in the end)

Glad it's got better - it's rather good for automated builds :)
Comments are closed.
Copyright © 2012 Peter G Jones. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: