Saturday, December 22, 2007

Integrated WiX support in SharpDevelop


In fact, WiX is the Open source toolset which generates Windows Installation packages or MSI files. WiX provides command line tools to build MSI packages.


Wikipedia describes the WiX toolset as follows:

The Windows Installer XML toolset (WiX), pronounced "wicks", is a free, open-source toolset that builds Windows Installer (MSI) packages from an XML document. It supports a command-line environment that developers may integrate into their build processes to build MSI and MSM setup packages. ...

The developer has to create an xml file with .Wxs extension. This file contains all files, folders, registry keys, SQL databases, IIS directories, users, shortcuts, … which must be included in the installation. Creating the .Wxs file is not that easy. Currently, there is no user-friendly application to create this file. There is already an Open Source project, called WixGUI, but they haven’t released anything yet ...


Compilation process


To build our MSI file with WiX, we need 2 executables: Candle.exe & Light.exe.
1.Candle compiles the .Wxs file into a .WixObj file. (intermediary xml file)
2.Light transforms the .WixObj into the final MSI package

You can create your own batch file with following commands:
candle Test.wxs
light.exe -out Test.msi Test.wixobj

Sharp Developer



Did you ever heard about SharpDevelop? SharpDevelop is the Open Source Integrated Development Environment in contrast to Visual Studio IDE. SharpDevelop has also integrated WiX support. You can visually create your .Wxs file. You can also design custom installation dialogs and watching the result before executing the installation package. By pressing F5 (alias ‘Build solution’) the Candle and Light executables are automatically executed. So by building your solution, your MSI file will be created automatically!

SharpDevelop has Setup projects which has built-in WiX support:


In the Setup project you have a tree-structure with all files, directories, components, ... which can be added visually.


You can also view the resulting customized installation dialogs, without executing the installation package:



Remarks


There is also a project, called Votive, which provides WiX support for Visual Studio .NET/2005/2008. This integration allows you to have intelliSense in the Wxs file, but you cannot create files, directories, etc… visually!


References


SharpDevelop Community
WiX online tutorials
Article on SharpDevelop and integrated WiX support

No comments: