Windows Installer XML (WiX) toolset

With WiX, you can create msi installer packages for MS Windows. You can run the WiX tools on Linux using Wine and Mono.

Here is how to create an example msi package:

# 
# Instructions to create msi packages on Linux with Wine, Mono and Wix.
#

# Create testing dir
WIX_TEST_DIR=/tmp/wix-test
mkdir -p $WIX_TEST_DIR

# Create wine directory
export WINEPREFIX=$WIX_TEST_DIR/wine
mkdir -p $WINEPREFIX

# Check your wine version. These instructions have been successfull
# with wine-1.1.24, but to be sure, use wine-1.2
wine --version

# Download mono
cd $WIX_TEST_DIR
wget 'http://ftp.novell.com/pub/mono/archive/2.4/windows-installer/6/mono-2.4-gtksharp-2.12.8-win32-6.exe'

# Install mono
wine mono-2.4-gtksharp-2.12.8-win32-6.exe
# (choose to just install mono, no need for mono-gtk, accept license, etc, ...)

# Download Windows Installer XML (WiX) 3.0 (Beta) binaries
wget 'http://kent.dl.sourceforge.net/sourceforge/wix/Wix3.0.4805.0-x86-setup.zip'

# Unpack WiX binaries
unzip Wix3.0.4805.0-x86-setup.zip

# Install WiX binaries
msiexec /i Wix3.msi

# Download example files from Windows Installer XML (WiX) 3.0 (Beta) sources
# (note: newer versions of these sources contain non-working examples,
# so we use a rather old source).
wget 'http://ufpr.dl.sourceforge.net/sourceforge/wix/wix-3.0.2925.0-sources.zip'

# Unpack WiX sources
mkdir -p wix-src
cd wix-src
unzip ../wix-3.0.2925.0-sources.zip

# Goto first example dir
cd examples/public/first

# Run candle
wine 'C:\Program Files\Windows Installer XML v3\bin\candle.exe' product.wxs
# (ignore two warnings)

# Copy winterop.dll to here
cp $WINEPREFIX'/drive_c/Program Files/Windows Installer XML v3/bin/winterop.dll' .

# Run light
wine 'C:\Program Files\Windows Installer XML v3\bin\light.exe' -sval product.wixobj

Open issues

The above recipe works fine for the example package, but there are some issues to consider:

* You will have to use '-sval' to turn of validation.

* The recipe is only tested with the simplest example package, so it might not work with more complicated packages.

Questions

* Can't you avoid using WINE altogether by downloading the Wix binary zip instead of the installer, and using Mono directly? I believe that's what Mono does for their Gtk# installer - see http://anonsvn.mono-project.com/viewvc/trunk/win32-installers/ -- GabrielBurt 2009-09-28 21:22:55

  • Answer: Wix uses functions from msi.dll, so Mono needs this library. On Linux, msi.dll is not available natively, but you can use Wine's msi.dll.so. The easiest way to do this is to run Mono for Windows under Wine. In theory it might also be possible to run a Mono for Linux that can load Wine's dll.so's, but that probably requires some sort of Mono-Wine bridge to setup a Windows like environment for msi.dll.so to run in. Either way, you cannot avoid Wine. -- HibEris 2009-10-21 18:22:31

Projects/GTK/Win32/WiX (last edited 2018-12-05 15:46:03 by EmmanueleBassi)