giFT/OpenFT's Installation Guide for Windows

Author: Ross Smith

Original version

Author: Markus Kern

Major revision

Abstract

This document explains building giFT using Microsoft Visual Studio 6.0.


Table of Contents

1. Introduction
2. General preparation
3. Getting giFT
4. Preparing third party libraries
4.1. ZLib
4.2. Berkeley Database (libdb)
4.3. libvorbis
4.4. libxml2
5. Building giFT
6. Building the plugins
6.1. Building OpenFT
6.2. Building Gnutella
6.3. Building giFT-FastTrack
7. Putting it all together
8. Miscellaneous
8.1. Logging
8.2. More information

1. Introduction

A small notice to begin with. The windows port may not always be up to date with the rest of giFT and hence you are on your own when building giFT on windows. Do not ask for support or even binaries of giFT on windows!

It is also important that you do not make windows binaries of giFT available. giFT/OpenFT is currently in a state which would make it crumble under the influx of the large number of users which a binary release for windows would most likely cause. If we think that giFT/OpenFT can handle a sufficient number of users we will make binaries for windows available.

This guide describes how to build giFT on the command line. The Visual Studio IDE is not maintained and most likely won't work.

You should create an empty directory in which the build environment will be set up. This directory will be referred to as "/" within this document.

It is assumed that you are going to make a debug build. To turn debugging off (not recommended) added RELEASE=1 to all nmake invocations.

2. General preparation

Before you can build giFT at the command line, make sure you have the following environmental variables defined:
	PATH=C:\Program Files\Microsoft Visual Studio\VC98\Bin:%PATH%
Optionally, you use can use the DOS 8.3 name:
	PATH=C:\PROGRA~1\MICROS~2\VC98\Bin:%PATH%
Also define:
	LIB=C:\Program Files\Microsoft Visual Studio\VC98\Lib:%LIB%
	INCLUDE=C:\Program Files\Microsoft Visual Studio\VC98\Include:%INCLUDE%
In Windows 95/98/ME, add these statements to the end of C:\AUTOEXEC.BAT. In Windows NT/2000/XP, add these to the end of each environment variable (using Start/Settings/Control Panel/System/Advanced/Environment Variables/System).

3. Getting giFT

First you will need to download the latest giFT tarball from http://gift.sourceforge.net/download.php. Or optionally get it from cvs.

Extract giFT to /giFT and proceed with installing the third party libraries.

4. Preparing third party libraries

There are a few third party libraries which you will need to build giFT

4.1. ZLib

Zlib is used in several places by giFT, OpenFT and Gnutella.

Get http://prdownloads.sourceforge.net/libpng/zlib114.zip and extract it to /zlib. Copy /giFT/win32/zlib.mak to /zlib and run:
	> cd /zlib
	> nmake /f zlib.mak

4.2. Berkeley Database (libdb)

OpenFT uses libdb for efficient data storage and access. If you want to function as a SEARCH node (a node that handles searches for other nodes) you'll need libdb. This document assumes you are using version 4.1.x.

Get http://www.sleepycat.com/update/snapshot/db-4.1.25.zip and extract it to /libdb. Follow the instructions in /libdb/docs/ref/build_win/intro.html to build both the Release and Debug DLL.

4.3. libvorbis

Meta data from Ogg Vorbis files is extracted using libvorbis.

Get http://www.vorbis.com/files/1.0/windows/OggVorbis-win32sdk-1.0.zip and extract it to /vorbis. No further steps are required.

4.4. libxml2

libxml2 is used by Gnutella for meta data support. You can skip his step if you don't want to compile Gnutella with meta data support. This is not recommended however.

Get ftp://xmlsoft.org/libxml2-2.6.4.tar.gz and extract it to /libxml2. The libxml2 configure script is written in JScript so make sure this works on your box (it should by default on all newer versions of windows). Go to /libxml2/win32 and run:
	> cscript configure.js ftp=no http=no html=no catalog=no docb=no iconv=no 
	          valid=no xml_debug=no reader=no writer=no walker=no pattern=no 
	          compiler=msvc static=no schemas=no "cruntime=/MDd"
	> nmake /f Makefile.msvc

5. Building giFT

Change to the giFT dir and build giFT using the following commands:
	> cd /giFT
	> nmake /f Makefile.msvc ZLIB=1 VORBIS=1 LIBDB=1 win32-dist
This will create a directory /libgift which contains libraries and headers needed by plugins. It will also create /win32-dist to which we will come back later.

6. Building the plugins

In order for giFT to do anything usefull you will need one or more network plugins which giFT uses to connect to different filesharing networks.

6.1. Building OpenFT

OpenFT is the primary network used with giFT

Download the latest OpenFT tarball from http://gift.sourceforge.net/download.php. Or optionally get it from cvs.

Extract OpenFT to /OpenFT and run
	> cd /OpenFT
	> nmake /f Makefile.msvc ZLIB=1 LIBDB=1 win32-dist
This will build OpenFT and copy relevant files to /win32-dist.

6.2. Building Gnutella

The Gnutella plugin allows giFT to participate in the gnutella network.

Download the latest Gnutella tarball from http://gift.sourceforge.net/download.php. Or optionally get it from cvs.

Extract Gnutella to /Gnutella and run
	> cd /Gnutella
	> nmake /f Makefile.msvc ZLIB=1 LIBXML2=1 win32-dist
This will build Gnutella and copy relevant files to /win32-dist.

6.3. Building giFT-FastTrack

giFT-FastTrack is a plugin for connecting to the FastTrack network (Kazaa, imesh, etc.).

Download the latest giFT-FastTrack tarball from http://developer.berlios.de/projects/gift-fasttrack. Or optionally get it from cvs.

Extract giFT-FastTrack to /FastTrack and run
	> cd /FastTrack
	> nmake /f Makefile.msvc win32-dist
This will build giFT-FastTrack and copy relevant files to /win32-dist.

7. Putting it all together

This step will build a self extracting installer for giFT using the files in /win32-dist. If you do not build the installer you will have to set up a suitable environment for giFT to run in yourself.

Get Nullsoft's Scriptable Install System from http://nsis.sourceforge.net and install it on your system.

Execute the following commands to build the installer:
	> cd /win32-dist
	> perl nsisprep.pl
	> MakeNSIS.exe gift.nsi

Use the resulting package giFT-x.x.x.exe to install giFT on your machine.

8. Miscellaneous

8.1. Logging

giFT keeps a logfile giftd.log which contains information about both giFT and OpenFT (and any other plugins). This file is created on startup, so don't restart giFT immediately when it crashes, but check the log and report the problem.

8.2. More information

More information about the giFT project and giFT/OpenFT can be found in the other documentation at our website.

If you want to learn about the interface protocol (that clients use to connect to giFT) read the Interface Protocol documentation. Please check other client projects first before starting your own.

See the contact page for more information about the preferable ways to ask for help and/or contact us.