Skip to content

Scripts for building a Windows installer package for Clutter and its deps

Notifications You must be signed in to change notification settings

clutter-project/clutter-msi

Repository files navigation

====== Intro ======

This documents how to build Clutter and Cogl and them make a Windows
installer containing the binaries and all of the dependencies using
WiX. WiX is an open source package from Microsoft for generating MSI
files. These instructions assume you are cross compiling Clutter/Cogl
from a Linux installation and running WiX with Wine.

====== Basic setup ======

Make sure you have Wine and the MinGW compiler installed. On Fedora
these can be installed with:

 sudo yum install mingw32-gcc wine

====== Installing Mono ======

Set this as the Wine prefix so we can also install WiX there.

 export WINEPREFIX="$PWD"

To run WiX we also need mono, so let's install that now:

MONO_DIR="http://ftp.novell.com/pub/mono/archive/2.10/windows-installer/5/"
MONO_INSTALLER="mono-2.10-gtksharp-2.12.10-win32-5.exe"
wget "$MONO_DIR/$MONO_INSTALLER"
wine "$MONO_INSTALLER"

Choose to just install mono, no need for mono-gtk, accept license,
etc. When running the installer Wine complained about requiring Gecko
but it seems to work to just hit cancel and ignore the complaint.

====== Installing WiX ======

Now install WiX:

wget -O Wix3.msi "http://download.codeplex.com/Project/Download/\
FileDownload.aspx?ProjectName=wix&DownloadId=119160&\
FileTime=129168985376800000&Build=17950"

msiexec /i Wix3.msi

WiX tries to use a library called msi.dll. Wine has a wrapper for this
but it doesn't seem to work with WiX. However it's possible to use a
copy from a native installation of Windows instead. The Makefile will
tell Wine not to use the override when it runs programs from WiX.

cp msi.dll $CLUTTER_MSI_ROOT/drive_c/windows/system32/msi.dll

Note that version 3.5 of Wix doesn't appear to work under Wine. It
seems to end up combining files that have the same size. There is some
info about this here:

http://osdir.com/ml/wine-bugs/2011-06/msg02153.html

====== Installing lib.exe ======

To compile Clutter applications with Visual Studio we need import
libraries for the DLLs. We can't generate these with MinGW but
Microsoft has a lib.exe tool to generate these from a .def file which
MinGW will generate. This is available for free with Visual Studio
Express or the Windows SDK. However, I couldn't get either of these to
install via Wine so instead I just installed them on a Windows machine
and copied the files over.

===== Setting the wine path ======

So that the build process can find the windows executables we've
installed, let's set the Wine path. Run regedit like this:

WINEPREFIX="$PWD" wine regedit

and then add a new string key to HKEY_CURRENT_USER\Environment called
PATH with the value:

c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;
c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;
c:\Program Files (x86)\Windows Installer XML v3\bin

====== Build the MSI file ======

Now that everything is setup we should just be able to run make to
build clutter.msi. If it works this should to the following:

* Fetch the clutter source from clutter-project.org

* Download all of the prebuild dependencies using the
  mingw-fetch-dependencies.sh script from the Clutter source. This
  will be extracted into a prefix called deps-install

* Generate a .lib file for json-glib so that it can be used with
  Visual Studio.

* Download the source for Cogl

* Patch it to fix some bugs in version 1.7.4

* Build and install cogl into the cogl-install prefix

* Make import libraries for cogl and cogl-pango

* Patch Clutter to fix some bugs in 1.7.6

* Build and install Clutter into the clutter-install prefix

* Make an import library for clutter

* Generate a .wxs using the directory structure in the three install
  prefixes

* Generate a .wixobj file

* Link the .wixobj into the final clutter.msi file.

About

Scripts for building a Windows installer package for Clutter and its deps

Resources

Stars

Watchers

Forks

Packages

No packages published