Windows Installation
From grecipe-manager
Contents |
For Users
In Windows, all you need to do to run gourmet is to get the latest executable installer from this SourceForge page, and install Gourmet, just like any other application. Make sure to get the "full_gtkglade" installer, unless you really know what you are doing. Please note that at present the Windows release is several releases behind the latest version. We are waiting for more Windows developers to help remedy this problem.
The latest windows installer (as of 10/14) is: 12.0-pre1 http://downloads.sourceforge.net/grecipe-manager/gourmet-0.12.0-pre1-full_gtkglade-2.8.8.exe?use_mirror=superb-west
For Developers
With most developers primarily on Linux, the Gourmet project is currently understaffed in the Windows department. Several things changed since the latest Windows release, so the instructions below are no longer valid for recent versions of Gourmet. If you would like to get involved in Gourmet on Windows, which would be highly appreciated, the best way to start would probably be to get the Gourmet CVS HEAD and follow the instructions here.
#WDeveloperStep1
1. Required Packages
To run Gourmet from source on Windows takes a bit of doing, since Windows does not come with a lot of development tools by default. So first, you will need to download and install a few open-source development packages. They are as follows.
- Python
- Version 2.3 acceptable, but you really should be using 2.4 unless you have a good reason not to.
- GTK/Glade
- Older versions acceptable, but best to get the latest version. Just the runtime environment is sufficient
- PyGTK
- This is the python binding for GTK. Get the installer for your python version (you installed 2.4 just like we recommended, right?), and your GTK version. You need all three packages provided, PyCairo, PyGObject and PyGTK.
- PyWin32
- Python Win32 Extensions. Download the latest installer for your python version.
- Python Imaging Library (PIL)
- This allows image processing by python. Get the latest windows package, make sure you get one for your python version.
- PyRTF
- This is to support RTF (rich text format) export by Gourmet. Get the latest version. Download the source package (in tar.gz format), extract, and follow instructions to install.
- Reportlab
- This allows PDF output from python, which is also used for printing on Windows.
- PySqlite2
- This is the database backend for Gourmet.
- Metakit
- This is the old database backend for gourmet. New versions will need to compile this in if they want to provide upgrade support for old versions of Gourmet. Otherwise, the installer should probably present a warning telling users to export recipes before updating or something like that. You want to download both metakit.py, as well as Mk4py.dll.gz. (You can find them in the download directory.) Unzip Mk4py.dll.gz to extract the DLL file, then place both of these files into C:\Python24\Lib\site-packages (where C:\Python24 is the default python installation directory. If you installed python somewhere else, use your python install directory.)
- SQLAlchemy
- For versions 0.14.0 and later, you need this for database handling.
Note, that some packages are in unix-style zip formats (.gz, .tar.gz), and may not be supported by WinZip. If you are having trouble extracting/decompressing those, get 7-Zip - an excellent open source compression utility that supports multiple formats.
2. Getting the Source
Now that you have all this set up, on your machine, you can run gourmet from source, right? The only thing that remains is to actually get the source! There are two main ways of doing that:
- You can go to the file releases section on the SF project page, and download the source package (the one with .tar.gz extension), and extract to a directory of your choosing
- You can pull the source directry from CVS. We recommend WinCVS as the windows CVS client. Alternatively, you can use the traditional command-line CVS client. CVSNT is a good command line client for Windows.
- If you decide to pull from CVS, make sure to pull the correct branch/revision. The source tree is not always tagged with the latest release, so if you are not sure, just ask through the mailing list or the forums which branch/revision to extract.
- While teaching you how to use CVS is beyond the scope of this document, here are a few things to get you started:
- If using WinCVS, create an empty directory where you want to store your gourmet source, then right click on that, and choose "Checkout module..."Do not forget to set up the cvs server to be "grecipe-manager.cvs.sourceforge.net" and the module as "cvsroot/grm".
- When updating, right click on the root dir of your source, and select "Update". Make sure to select the correct release in the Update Options tab.
- Check out SourceForge documentation. They have all the details about how to work with their CVS system, and even some outdated instructions about WinCVS (one thing of note: you do not need to get PuTTY separately, as an SSH client seems to be included by default into WinCVS distribution nowadays.)
3. Installing and Running Gourmet
Now that you got the source too, how do you run gourmet? For once, this is pretty simple.
- First, let us setup gourmet properly. Open up a command prompt, go to the directory where you put the gourmet source tree, and type
C:\Python24\python.exe setup.py install
- There is, however one caveat for Vista users: take care that you open up the command prompt as administrator - otherwise, any actions you take from that prompt and that would normally create or change files on your harddisk are "sandboxed" and only operated on in a subdirectory of your user dir (<user>\AppData\Local\VirtualStore) - in particular, you wouldn't find the files that the installation script creates in the location they should go to.
- Now, gourmet is installed properly, and you can, in the same command prompt, type
C:\Python24\python.exe C:\Python24\gourmet\gourmet
- where you of course make sure to replace "C:\Python24" with the path where you installed python.
- Vista users can do this from a normal (non-admin) prompt - files that are created and/or changed by Gourmet while you're running it should be associated with you as a user anyway and therefore go to <user>\AppData\Roaming\Gourmet, by default.
This last command should start Gourmet, and you are in business!
Note: If you make a change in the source, (say, to fix a bug), you have to run "setup.py install" again to propagate the change, before running Gourmet. Otherwise you will not see the results.
4. Freezing the Executable
This step is optional - only if you want to freeze the source into an executable file. You would ordinarily not have any reason to do this if you already have gourmet running from source. Only if you are one of the people who is helping us make Windows distribution packages [or if you want to make your own executable because you are paranoid and do not trust other people's executables], would you ever care about this step. If you are still with me, well, read on.
- We use py2exe to freeze the executable from source. So get the latest py2exe package, and install it.
- Open up a command prompt, go to the directory where you have the Gourmet source, and type
C:\Python24\python.exe setup2.py py2exe
- That will create a set of executables and the associated libraries in the "C:\Python24\dist" directory by default. If that directory is for some reason unsatisfactory for you, you will have to edit setup2.py and change it.
- Our script creates two executables - one for "debug" purposes, which shows the console where diagnostic messages can be printed, and one without. Both of these executables will also write any console output to a log file.
Congratulations, you now have frozen your very own Gourmet executables. Now, why did you do that? Might it be because you also want to create your own installer package? If so, read on to the next step.
5. Creating the installer distribution package
This step is also completely optional - only if you want to create an installer exe package, which you could only want to do if you are one of the people helping us make Windows releases. Of course, you can only follow these steps AFTER you have frozen the executables, as per Step 4.
- First, you need to get some software. You need the Nullsoft Scriptable Install System (NSIS). You also want to get the nice HM NIS Edit, which is kind of an IDE (Integrated Development Environment) for NSIS files that makes editing and compiling NSIS scripts a much easier task.
- Remember that GTK/Glade package you downloaded and installed back in Step 1? Well, if you want to create an installer with GTK/Glade bundled in, you will now place that installer into the same directory as the NSIS script, so that it can be bundled.
- Now, open up HM NIS Edit, and from within that, open up our NSIS script, which is currently called "gourmet-installer-script-2.nsi" and is located in the "windows" subdirectory of the Gourmet source tree.
- First, you may want to edit the version number. Unfortunately, NSIS cannot automatically pull the version number out of source, it has to be input manually. The version is defined close to the top, on a line that looks like:
!define GOURMET_VERSION "0.8.5.14"
- Change that to whatever version it is that you are running.
- If you did not install Gourmet into "C\:Python24", you will have to do some more editing of this file, because the script assumes that python is in "C\:Python24". Specifically, you want to scroll down to the section that is called "Gourmet Install Section", and replace every instance of"C\:Python24" with your python install directory.
- Additionally, the script assumes that the executables that you have frozen are in "C:\Python24\dist". If they are not, that is something you will have to edit, as well. This is also located in the "Gourmet Install Section".
- If you want to make one with GTK/Glade integrated, then you will uncomment the line (close to the top) that looks like:
!define WITH_GTK
- If you want to make one without GTK/Glade, then you will comment it out. (You comment stuff out with a semicolon.) If you want to make these two different installers, you have to compile once with that line commented, and once uncommented. Unfortunately, there is no other way about it.
- Now, you are ready to compile the executable. Just press the "compile script" button in the toolbar, or use the keyboard shortcut "Ctrl-F9".
And you are done!
