Building Gpg4win installer package
Learn how you can build the Gpg4win installer packages on your own.
Conventional ".exe installer"
Building a new Gpg4win installer package is mostly automated. The build procedure can be executed on a GNU/Linux system or within a virtual machine on Windows and other systems.
What you need is:
- Build Gpg4win on GNU/Linux:
In principle, any current GNU/Linux system is sufficient as the base system. Some minor adaptations might be necessary though. The specific GNU/Linux guide is tested with a Debian GNU/Linux 'Etch' 4.0 system.
Furthermore, you need at least 503 MByte on your hard disk and an acceptable fast internet connection for downloading about 60 MBytes.
- Build Gpg4win on Windows:
In principle, any current Windows system is sufficient as the base system. Some minor adaptations might be necessary though. The specific Windows guide is tested with Windows XP SP2.
Furthermore, you need at least 1.5 GBytes on your hard disk and an acceptable fast internet connection for downloading about 360 MBytes.
MSI InstallerAttention: The Gpg4win MSI Installer is only supported since Gpg4win 1.9.0beta.
What you need is:
- A complete conventional installer as described above with the same version and contents as you want for the MSI package.
- Perl 5 on the GNU/Linux System.
On Debian GNU/Linux 4.0 you can install Perl 5 this way:
# apt-get install perl
- A Windows XP SP2 system, with the following tools installed.
- Windows Installer XML (WiX) toolset Version 3.0. This can be downloaded from http://wix.sourceforge.net/.
- WiX requires the .NET Framework. Successfully tested is .NET 2.0
- Finally, you need a method to access the file tree where your built your conventional installer from your Windows system This could done via an SMB network connection or simply by transferring the whole file tree to Windows (attention: it is several 100 MBytes). See also the section below.
Now you need to execute the following steps:
- Change into the src/ directory of the Gpg4win source code where you built the
conventional installer before (compare
Build Gpg4win under GNU/Linux):
$ cd src
- Execute make-msi.pl to create the required WiX source files:
$ make msi
- Now switch to the same directory ("src") on the Windows system
and execute script "make-msi.bat" to create the MSI package:
> make-msi.bat gpg4win-Version.wix
or > make-msi.bat gpg4win-light-Version.wix
where "Version" is the complete version number of the just created installer, e.g. "1.9.0-svn595". You will find the resulting .wix files in the same directory.
This routine assumes that WiX is installed in a default location. In case it is not, you need to adapt the search path (PATH system variable).
- The MSI package is now ready and stored as file "gpg4win.msi".
You can install it in the following way:
> msiexec /i gpg4win.msi
and also de-install it:
> msiexec /x gpg4win.msi
How to access the Gpg4win build files from WindowsThe WiX software requires access to the file tree where the installer was created. Although this can be done in many ways, only three options are illustrated here. As these are not step-by-step procedures and they need to be adapted for your individual environment.
- Mounting a virtual ext3 build partition:
If you build Gpg4win as described on the special guide for Windows in a virtual GNU/Linux system, then the required file tree is located inside a hard disk image named
build.img. It can be accessed directly from Windows with the free tools ext2fsd and FileDisk.
If ext2fsd and FileDisk are installed as described, you can mount the build partition after shutdown of the virtual GNU/Linux with this command:
filedisk /mount 0 C:\path\to\build.img H:
Of course 'C:\path\to\build.img' needs to be replaced with the actual path to the image file. Now the build partition is available as drive H: on your Windows system.
- Ubuntu with VirtualBox and Samba:
You can run Windows XP as a virtual machine under VirtualBox and access the file tree via SMB by running a Samba server on the Linux host system. The file tree is accessible as a so-called "Share" (e.g. via the right mouse button menu for the respective folder "gpg4win" in Nautilus). After this, the network share can be made available in Windows:
> net use H: \\10.0.2.2\gpg4win
Where H: is the drive letter to use and gpg4win the name of the network share.
- Using the archive tool "tar":
A list of all required files is stored in the file make-msi.files by the script make-msi.pl. This list can now be used to pack all required files for transport:
$ cd gpg4win
$ tar -T src/gpg4win-Version.files cjf gpg4win-msi.tar.bz2
where "Version" should be the complete version number of the current installer, e.g. "1.9.0-svn595". You will find the respective .files files in directory "src".
Additional to gpg4win-msi.tar.bz you need src/gpg4win-Version.wix and src/make-msi.bat on your Windows system. You should store them in the respective src/ directory.