Contrary to Tidosho's comments there is nothing wrong with our instructions, I recommend users follow our official wiki/git instructions and only use this for reference if they encounter issues. - Cas
It isn't very well documented on this site how to actually build Deluge for Windows properly, as it's mixed in with all the Linux instructions. Here's my guide on compiling it and then getting the installer to build.
1. First, follow the instructions on the Installing/Source page, starting from the
Windows Dependencies section, installing all the first set of dependencies from the links.
2. Where the page says:
Code: Select all
The following packages do not have Windows installers but are straightforward to install.
PyXDG
Zope Interface
Mako
Chardet
DO NOT download anything from those links, we'll sort that out next. The page is written in a way that confuses you into clicking the links and downloading/installing manually. DON'T, instead, continue on.
3. After you've installed all the first set of dependencies, open a command console (Start, Run, type cmd, hit Enter) and type:
Code: Select all
C:\Python26\Scripts\easy_install.exe zope.interface chardet mako pyxdg
This will download and install that second set of dependencies automatically. Continue on to my next step!
4. Download the ZIP version of the source code, and extract it into the root of C:\ so you will have a folder structure like C:\deluge-1.3.5, inside which is the source code. If you have a double deluge-1.3.5 structure, cut and paste the source files into the root deluge-1.3.5 folder and delete the duplicate. Make sure your folder has a Win32 folder in it, the tar.gz versions of the source don't seem to.
5. Next we need to add Python to your PATH. Right click My Computer, click Properties, Advanced System Settings, then the Environment Variables button. This is for Windows 7, XP might be a little different, I haven't used it in a while. Next, in the System Variables section at the bottom find the Path part, click it and hit Edit. Add "C:\Python26;" to the beginning (without quotes), and close all windows by OK'ing and Applying them.
Install the GTK+ Windows runtime by googling for it. The latest version will do, but make sure that during the install YOU MUST select the option to include GTK in your PATH, the installer will do this for you, unlike Python. Next, install NSIS Installer from [url]http:\\nsis.sourceforge.net[/url].
6. Once the GTK is installed, the first step you should do is make sure you have a clean build environment. Open your command prompt again, and type:
Code: Select all
C:\deluge-1.3.5\python setup.py clean -a
7. Now to actually do the build:
Code: Select all
C:\deluge-1.3.5\python setup.py build
If you get any build errors saying modules weren't found, you can use the easy_install command like we did previously, for example I had "pefile" and "altgraph" modules missing, so I typed:
Code: Select all
C:\Python26\Scripts\easy_install.exe pefile altgraph
Repeat for any other modules as needed. While we're here type in
Code: Select all
C:\Python26\Scripts\easy_install.exe bbfreeze
as we'll need it later.
Next, you'll want to install the program, as just running build creates an EGG file, which is a Python Package. On Windows omit the "sudo" part of the install code as that's for linux, so you'd type:
Code: Select all
python C:\deluge-1.3.5\setup.py install
This will put the files in C:\Python26\Scripts. The installer will put it all together so don't worry, carry on.
8. That is the point you should STOP FOLLOWING the instruction page, the rest is for Linux. Now we need to concentrate on building the installer.
9. Go into the Win32 folder and open the deluge-win32-installer.nsi file into a text editor. Replace line 44:
Code: Select all
!define DELUGE_PYTHON_BBFREEZE_OUTPUT_DIR "..\build-win32\deluge-bbfreeze-${PROGRAM_VERSION}"
with this:
Code: Select all
!define DELUGE_PYTHON_BBFREEZE_OUTPUT_DIR "C:\build-win32\deluge-bbfreeze-${PROGRAM_VERSION}"
and line 119 which is this:
Code: Select all
OutFile "..\build-win32\deluge-${PROGRAM_VERSION}-win32-setup.exe"
Change it to this:
Code: Select all
OutFile "C:\build-win32\deluge-${PROGRAM_VERSION}-win32-setup.exe"
I put a specific drive letter on as NSIS kept giving me errors, changing it fixed the issue.
In your command prompt, enter:
Code: Select all
python C:\deluge-1.3.5\Win32\deluge-bbfreeze.py
This will bbfreeze it, and the whole thing will either end up in C:\build-win32, or the C:\deluge-1.3.5\build-win32 folder. If it is in the second, copy the deluge-bbfreeze-1.3.5 folder into the C:\build-win32\ folder.
Finally you should now be able to right click the installer script, and click Compile with NSIS. It will then build the installer, it will reside in C:\build-win32 as deluge-1.3.5-win32-setup.exe.
The Win32README.txt file is completely outdated as it uses older versions of components and requires lines in scripts to be changed that aren't needed as the newer versions are OK so DON'T refer to it. If anyone has any errors, post them here and I'll help. It took me a lot of messing about so all this was done in random steps but I think I've got it right finally!