New Windows Version

Specific support for Deluge on Microsoft Windows OS
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: New Windows Version

Post by johnnyg »

I can confirm that it's not adding torrents; it looks like the included libtorrent doesn't have geofiltering:

Code: Select all

[ERROR   ] 09:16:15 core:179 Unable to load geoip database!
[ERROR   ] 09:16:15 __init__:1021 'session' object has no attribute 'load_country_db'
Traceback (most recent call last):
  File "deluge\core\core.py", line 177, in run
AttributeError: 'session' object has no attribute 'load_country_db'
also the blocklist seems to be not working due to not being able to read the blocklist file:

Code: Select all

[DEBUG   ] 22:36:40 core:179 Unable to read blocklist file: 'tuple' object is not callable
normally I would edit the .py files to try and fix the problem however it seems that only the .pyc files are included?
ther0n
Member
Member
Posts: 20
Joined: Sat Jan 17, 2009 8:40 am

Re: New Windows Version

Post by ther0n »

johnnyg wrote: normally I would edit the .py files to try and fix the problem however it seems that only the .pyc files are included?
yeah, latest .zips posted in this thread contain .pyc only
afaik only official 1.1.3 (and earlier) tarball contains .py files which can be edited

so seems that libtorrent posted on dependencies page is not the right version then?
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: New Windows Version

Post by johnnyg »

ther0n wrote:
johnnyg wrote: normally I would edit the .py files to try and fix the problem however it seems that only the .pyc files are included?
yeah, latest .zips posted in this thread contain .pyc only
afaik only official 1.1.3 (and earlier) tarball contains .py files which can be edited

so seems that libtorrent posted on dependencies page is not the right version then?
quite possibly, I'm sure andar will sort that out.
zifix
New User
New User
Posts: 3
Joined: Wed Feb 18, 2009 5:41 pm

Re: New Windows Version

Post by zifix »

Just an idea to straighten up the dependency stuff: How about using cygwin (http://cygwin.com/)? I found at least python and gtk in there nicely packed in a full fledged package management. Perhaps you could ask these folks to include a windows version of deluge?
jesperl
Moderator
Moderator
Posts: 89
Joined: Sun Dec 14, 2008 10:03 pm
Location: Copenhagen

Re: New Windows Version

Post by jesperl »

I succeeded in building deluge 1.1.3 from source on Windows XP Home (with a few tweaks), and to get the add torrents dialog to work

This is what I did, step-by-step

1) Install the dependencies listed here, except of course from the last MSI file which is deluge itself.
- Python and everything else was installed to the default location C:\Python25. I added c:\python25 to my PATH manually, but I don't think that this is needed if you are willing to type c:\python25\python instead of just python when building.
- The GTK 2.12 runtime can be installed anywhere as long as the location of the 'bin' directory is in the PATH (the GTK runtime installer sets up the PATH automatically).

2) I had to make two modifications to the 1.1.3 source

2a) deluge-1.1.3/deluge/core/core.py
Remove (comment out) the following lines

Code: Select all

      # Load the GeoIP DB for country look-ups if available
      geoip_db = pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat"))
      if os.path.exists(geoip_db):
          self.session.load_country_db(geoip_db)
Otherwise, deluged won't start and I get this error in the log

Code: Select all

[ERROR   ] 09:16:15 core:179 Unable to load geoip database!
[ERROR   ] 09:16:15 __init__:1021 'session' object has no attribute 'load_country_db'
Traceback (most recent call last):
I'm not sure what's going on here, but I get country flags for my peers without these three lines in core.py.

2b) deluge-1.1.3/deluge/ui/gtkui/preferences.py
Apply the patch in revision 4820 mentioned by andar earlier in the thread, that is change line 437 to

Code: Select all

self.glade.get_widget("chk_ntf_popup").set_sensitive(False)
instead of

Code: Select all

self.gtkui_config["ntf_popup"].set_sensitive(False)
Without this patch the preferences windows will not open when clicked upon.

3) Now we can build and install deluge
From the root source directory run these commands

Code: Select all

python setyp.py clean -a
python setup.py build
python setup.py install
Now, deluge should be working (check that by running deluge.exe in c:\python25\scripts), but we need to make sure that only one deluge and deluged instance is started, and the file association with .torrent must be set up manually. Also, I want to get rid of the CMD window displaying 1.1.3 (the deluge version) that's "hanging" until I close deluge.

4) Get the startX application from here, and put startX.exe somewhere. In my case, the exe will be located at c:\mybin\startX.exe (the deluge Windows installer for 1.0.7 put startX.exe in C:\windows, but I prefer a different location).

5) Create a CMD file, called run-deluge.cmd (or whatever), with the following content

Code: Select all

@ECHO OFF
SET DELUGEFOLDER=c:\python25\scripts

IF ""%1"" == """" ( 
  C:\mybin\StartX.exe /B /D%DELUGEFOLDER% "%DELUGEFOLDER%\deluge.exe" 
) ELSE (  
  C:\mybin\StartX.exe /B /D%DELUGEFOLDER% "%DELUGEFOLDER%\deluge.exe "%1""
)
Be careful about the double quotes, they are needed to handle file names with spaces properly (the above syntax corrects a bug in 1.0.7 which could not open torrent files with spaces).

The IF-ELSE part is needed because if I pass an empty string "" to deluge (no argument to run-deluge.cmd), the add-torrents windows will open, even though there is no torrent to add. I guess this a bug in deluge (?), but until this is fixed, the above can be used as a workaround.

IMPORTANT: Before proceeding to the next step, test the CMD file by dragging-and-dropping torrent files onto it. If deluge is running, the current instance of deluge should be used, and if deluge is not running, it should be started by startX. Make sure that things work this way.

6) Set up the file association for TORRENT files
From Windows Explorer, choose "open with" and select run-deluge.cmd. Remember to check the "Always use this program.." box. Now, you should be able to add torrents automatically.

Comments are welcome, including suggestions about things to check (my main interest is connecting to the deluge daemon on my Linux home server, but I will be happy to test deluge+deluged on a single machine). I don't have access to Windows Vista (or WinXP Pro), so if something works differently on Vista compared to XP, I will not be able to help out.
Last edited by jesperl on Sat Mar 07, 2009 1:49 am, edited 1 time in total.
ther0n
Member
Member
Posts: 20
Joined: Sat Jan 17, 2009 8:40 am

Re: New Windows Version

Post by ther0n »

yeah and when you build this, did preferences dialog open alright on windows xp?
because mine didnt (windws xp professional x86)
what i did is use previous version 1.1.0 to make configuration files in "C:\Documents and Settings\%USER%\Application Data\deluge\"
and then run 1.1.3 version, to use those files
jesperl
Moderator
Moderator
Posts: 89
Joined: Sun Dec 14, 2008 10:03 pm
Location: Copenhagen

Re: New Windows Version

Post by jesperl »

ther0n wrote:yeah and when you build this, did preferences dialog open alright on windows xp?
Yes it does if you apply the patch in 2b (posted by andar earlier in the thread).
hordak
Leecher
Leecher
Posts: 59
Joined: Thu Apr 10, 2008 10:59 pm

Re: New Windows Version

Post by hordak »

Thank you jesperl.

Your install procedure works fine with Windows XP Pro SP3 32 Bit.

I lost the blocklist plugin. It is no big deal, since I prefer using peerguardian.

I also lost the label plugin, which I still have yet to figure out. Therefore, that did not affect me as well.

Edit: I copied the blocklist plugin and label plugin egg files from C:\Program Files\Deluge\Lib\site-packages\deluge\plugins in Deluge 1.1.0 to C:\Documents and Settings\hordak\Application Data\deluge\plugins and got them working with Deluge 1.1.3.

Edit 2: FlexRSS filters do not like 1.1.3. It locks up once it hits the name to download on the list.
Last edited by hordak on Sun Mar 08, 2009 1:29 am, edited 2 times in total.
jesperl
Moderator
Moderator
Posts: 89
Joined: Sun Dec 14, 2008 10:03 pm
Location: Copenhagen

Re: New Windows Version

Post by jesperl »

With build/package instructions from andar, I have made zip file for other Windows users to test

Grab it from here (about 20 MB).

Installation instructions (temporary while testing; if you want to, you can change the file location by editing the files run-deluge.cmd and torrent-association.reg).

1) Please make a backup copy of %APPDATA%/deluge first

2) Unzip deluge-1.1.3-4.zip in the root of your C: drive

3) Click on C:\deluge-1.1.3-4\torrent-association.reg to register the application for .torrent files

4) To start deluge, click on run-deluge.cmd
ther0n
Member
Member
Posts: 20
Joined: Sat Jan 17, 2009 8:40 am

Re: New Windows Version

Post by ther0n »

i just built newest 1.1.4 from tarball and something is wrong - preferences are not saved.
or perhaps they are saved but are not read back when deluge is restarted.

i did complete delete old config from "C:\Documents and Settings\USER\Application Data\deluge"
before running new version.
now there is new file "core.conf.new" wich seem to contain correct settings,
but when deluge is restarted, it opens with default settings. and deluge.log lists:

[ERROR ] 09:34:29 config:284 Error backing up old config..
[ERROR ] 09:34:29 config:284 Error backing up old config..
[ERROR ] 09:34:34 config:284 Error backing up old config..
[ERROR ] 09:34:35 config:284 Error backing up old config..
[ERROR ] 09:34:40 config:284 Error backing up old config..
Post Reply