HOW TO BUILD ZIM DESKTOP WIKI INSTALLER FOR WINDOWS

Zim Desktop Wiki computer program copyright (c) 2005, 2008 Jaap G
Karssenberg. Install script for Zim Desktop Wiki copyright (c) 2009
Brendan Kidwell <brendan@glump.net>.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Currently the process for building the Windows installer for Zim
Desktop Wiki is not completely automated. There are several steps
involved, and you will need a few pieces of free software:

* Nullsoft Scriptable Install System (NSIS)
  <http://nsis.sourceforge.net/>

* Venis IX -- NSIS IDE <http://www.spaceblue.com/products/venis/>
  [optional]

* Camelbox -- Self-contained Perl + GTK for Windows
  <http://code.google.com/p/camelbox/> (Tested with
  "2008.304.0742Z-odin" release.)

* Zim Desktop Wiki source from <http://zim-wiki.org/downloads.html>
  (Tested with 0.28 release.)


Do the following:

1. Extract the contents of this package to $WORK.

2. Extract your Zim source code to $WORK\main.

3. Run the camelbox installer. Choose only the default options. Then
   remove the "Perl Database Support" and "Database Tools Package"
   options. A base Perl + GTK installation will be placed in
   C:\camelbox.

4. Grab the contents of C:\camelbox and place it in $WORK\main\camelbox.

5. Run the camelbox installer again. This time start with "The
   Vapourware - Nothing" and add these two packages:
  * Development Packages -> Minimal GNU for Windows (MinGW) Toolkit
  * Development Packages -> dmake Makefile Processor
   The existing packages you already installed will be left alone.

6. Open a command prompt window and run "cpan". Issue the following
   commands:
  * install File::BaseDir
  * install Win32::Process
  * force install File::MimeInfo
   The force option is inserted because some of the test cases in the
   File::MimeInfo package fail. Don't worry; Zim will still work.

7. Build Zim:
  * cd $WORK\main
  * perl Build.PL
  * perl Build

8. Grab the following files from under C:\camelbox\ and copy them to
   the appropriate place under $WORK\main\camelbox\:
  * site\lib\auto\Win32\Process\*
  * site\lib\File\MimeInfo\*
  * site\lib\File\MimeInfo.pm
  * site\lib\File\DesktopEntry.pm
  * site\lib\File\BaseDir.pm
  * site\lib\Win32\Process.pm

9. Cleanup: Delete the following files and folders under $WORK\main:
  * _build
  * blib
  * t
  * Build*.*
  * Config.PL
  * configure
  * Lingua.PL
  * Makefile.PL
  * META.yml
  * pod2html.tmp
  * pod2htmi.tmp
  * zim.pot

10. Use http://convertico.com (or any convenient utility) to convert
    $WORK\main\share\pixmaps\zim.png to $WORK\zim.ico. (This step is
    only necessary if the icon needs to be updated.)

11. Grab the main logo PNG file from http://zim-wiki.org to
    $WORK\zim-logo-big.png. Resize to 57x57 and then pad (centered)
    into 150x57, and save as $WORK\zim-logo-big.bmp.

12. Make sure the version number for Zim Desktop Wiki appearing in the
    first block of code in create-zim-setup.nsi is correct.

11. Run create-zim-setup.nsi and you should get
    ZimDesktopWiki-setup-{VERSION}.exe.

12. Uninstall camelbox if you won't be using it anymore. The copy of
    Zim you get from ZimDesktopWiki-setup-{VERSION}.exe has its own copy that is
    independent of the system-wide installation.


Limitations and Comments

* The installer is quite large (23MB packed, 66MB installed). We are
  actually installing a complete self-contained Perl + GTK environment.
  I chose this route because it took me a day just to figure out how to
  install Zim with one particular Perl environment (camelbox), and
  camelbox doesn't lend itself well to automated install + extra
  dependencies.

* The launcher script (in Program Files\Zim Desktop Wiki) sets up $PATH
  correctly for camelbox and then creates $HOME/.config/zim if it finds
  no configuration, but this happens in a transient "DOS" window that
  disappears once Zim Desktop Wiki is launched.

* Should work fine with multiple users, since no user configuration is
  created during the install phase.


This document lated updated: 27 February 2009
