====== Installation of Zim on Windows ======

This page describes how to install Zim on Windows manually. We are still looking for a volunteer to build and maintain a self-contained windows executable.

===== Preparations =====

==== Download ====
To run Zim on Windows, you need:
* Perl: ActivePerl can be obtained from ActiveState (http://www.activestate.com/)
* Gtk+ 2: the Gtk2 runtime environment can be obtained from GIMP (http://gimp-win.sourceforge.net/stable.html)
* Gtk2-Perl bindings from gtk-perl (http://gtk2-perl.sourceforge.net/win32/ppm/)
	* use the ''ALL-Gtk2-Perl-XXXX.tgz'' package as this contains all the packages required - you may also choose to download the packages individually

Note: //There seems to be a compatibility problem between the 2.8 Gtk2 runtime environment and the pre-compiled Gtk2 perl bindings, try using version 2.6 of the runtime environment.//


==== Install ====

=== Perl ===
Install ActivePerl by running the installer. Usually, its installed in "''C:\perl''"; you can also use "''C:\Program Files\Perl''". This directory will be called PERLDIR in the following. Make sure the executable directory (''PERLDIR\bin'') is added to the PATH. The installer usually does this automatically.

You should now have a working perl interpreter, to check this run "''perl -v''" or "''perl -V''" from  the command-line.

Now install some additional packages:
The current version(5.8.8. build 819) contains a graphical package manager instead of the usual command-line ppm tool. It can be started from the Start menu (ActivePerl 5.8.x Build xxx -> Perl Package Manager).
You need to search and install the following packages:
* Module-Build
* File-MimeInfo

If you are using the old command-line installer (build 818 and before), type the following commands in a command shell:

	> ppm install Module-Build
	> ppm install File-MimeInfo


=== Gtk+ ===
Run the installer. It usually installs in "''C:\Program Files\Common Files\GTK\2.0''". On non-english Windows systems, the path is called differently (e.g., "''C:\Programme\Gemeinsame Dateien\GTK\2.0''" on German Windows). This directory will be called GTKDIR in the following. Again, make sure that the directory "''GTKDIR\bin''" is added to the PATH.

=== Gtk-Perl ===
Unpack the zip file and run the following commands in a command shell:

	> ppm install ExtUtils-Depends.ppd
	> ppm install ExtUtils-PkgConfig.ppd
	> ppm install Glib.ppd
	> ppm install Gtk2.ppd
	> ppm install Gtk2-GladeXML.ppd

Now it should be possible to run perl with gtk+-bindings. You can check this by running "''perl -MGtk2 -e 1"'' from a command line, if this does not give an error, perl knows where to find Gtk+.

If dlls such as ''iconv.dll'', ''charset.dll'', ''libgmodule-2.0-0.dll'' or ''libglib-2.0-0.dll'' are not found, make sure that:
* they can be found in ''GTKDIR\bin''
* this directory is in the PATH
* or try restarting the cmd shell

If one or more of this dlls are not in the directory, download them from http://www.gimp.org/~tml/gimp/win32/. You may need ''glib-XXX.zip'' and/or ''libiconv-X.X.X.bin.woe32.zip''. Unpack them into the GTKDIR, or somewhere else on the PATH.


===== Zim =====
Download the current version of Zim [[http://zim-wiki.org|from the website]]. Unpack it and run the following commands in a command shell in this directory:

	> perl Build.PL
	> perl Build
	> perl Build test
	> perl Build install

You will get a warning that only File-MimeInfo version 0.11 could be found, yet a version >= 0.12 is requested. Ignore this. It works anyway.

The Zim files are installed in PERLDIR. You can start Zim by typing ''zim'' into some command line or the Windows "Run" menu. Also, you can create a shortcut to PERLDIR\bin\zim.bat. To have an icon for the shortcut, you can convert PERLDIR\share\pixmaps\zim.png into an .ico file, using a program like for example IrfanView.

==== Configuration ====
After creating a notebook there will be a file in the notebook directory called "''notebook.zim''" use the "Open with .." item from the file browsers context menu to set zim as the default application for this file type. This will allow you to open notebooks by clicking on the config file.

==== Shortfalls ====
=== TrayIcon ===
The TrayIcon plugin does not work; I'm not sure whether the Win32 tray icons are at all supported by Gtk2.

=== MimeInfo ===
The 0.12 and 0.13 versions of File-MimeInfo do not install on ActivePerl; this has to be looked into.

When starting, Zim gives the message:
"You don't seem to have a mime-info database.
 See http://freedesktop.org/Software/shared-mime-info
 Could not use 'File::MimeInfo::Applications', disabling application bindings"
This can be ignored.

=== Langinfo ===
When starting, Zim gives the message: "No langinfo available. Defaulting to utf8". I have not yet looked into this ... utf8 is probably not a good idea on windows which uses the ansi charset (Windows-1252) in most countries.

==== Alternatives ====
As an alternative you can consider installing [[http://www.cygwin.com|CygWin]], within this environment you should be able to install Zim following the installation instructions for [[unix]]. Although on the moment of writing it seems that there are issues installing ''Module::Build'' on CygWin.

===== References =====
This guide is a composition of the original Zim installation notes, "installing Zim on Windows XP" (http://dewarim.de/wms/programme/installing_zim.html), Vedanta Barooah's "Gtk2-Perl on ActivePerl",  http://netvoodoo.net/index.php?/archives/59-Gtk2-Perl-on-ActivePerl.html and my own experiences

In my case, the windows system was XP Professional German, Sp2; Gtk+ "2.6.10 release a" was already installed. I updated ActivePerl from 5.8.8 build 818 to 819 in the hope of finding the Gtk+ bindings, yet this does not make any difference.

Concerning the licensing of the various packages, please check yourself whether the licenses allow your planned usage.

//Written by Sebastian Brandt SBrandt@nospam@gmx.de//
//Updated by pardus@cpan.org//
