Deluge Windows Builds

Specific support for Deluge on Microsoft Windows OS
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge Windows Builds

Post by mhertz »

I downloaded it anew when tested last, around 2 days ago, not using update script. I don't think I'm gonna run it again, but if do, I'll post you notes if any, though you can see yourself I'm sure. Thanks for reply.

Edit: What am I talking about... It was yesterday evening I redownloaded and retested some steps, not openssl etc, so comment-blocked some parts out. I just realized, going senile apparently.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge Windows Builds

Post by mhertz »

Ok, got the plugins working :)

I started fresh, as have no clue about spec files and would take too long to learn, so just used pyinstaller from command-line, and googled the instructions, needed args and the errors produced underway, while added to cmd-line one after one. The end-result showed same errors as doadin's, but when doing like I used to, and moved the deluge dir into the deluge-2.0.5-py37.egg dir, and rename the requires.txt in egg-info to end in '-off'(like doadin's script, deleting it), then started and now I could enable all plugins, own and 3'rd-party ones. I only built deluge.exe for this test, but should be same with rest components.

Here's my pyinstaller line:

Code: Select all

C:\Python37\Scripts>pyinstaller deluge-script.pyw --hidden-import gi --hidden-import cairo --hidden-import deluge --additional-hooks-dir C:\Python37\Scripts\hooks -n deluge
Edit: Forgot post the custom hook for deluge used, probably can be used on command-line alone, but I just took the instructions from a post I googled - I add that additional hooks dir command as per above, and then added a folder named hooks with a file named hook-deluge.py:

Code: Select all

from PyInstaller.utils.hooks import collect_all

datas, binaries, hiddenimports = collect_all('deluge')
Hope you can use this info for your next build doadin.

Edit2: Spec-file produced by pyinstaller for above command-line, e.g. to add rest deluge-components into:

https://paste.c-net.org/ReachNewbie

Edit3: Can omit the hook by adding extra arg to cmd-line, so:

Code: Select all

C:\Python37\Scripts>pyinstaller deluge-script.pyw --hidden-import gi --hidden-import cairo --hidden-import deluge --collect-all deluge -n deluge
Spec-file: https://paste.c-net.org/IndoorsMornin
highvoltage
Leecher
Leecher
Posts: 57
Joined: Mon Apr 11, 2016 11:11 pm
Location: Brazil

Re: Deluge Windows Builds

Post by highvoltage »

great mhertz, this is fantastic.

@doadin I will be looking forward to the next build

@DjLegolas merge > https://github.com/deluge-torrent/deluge/pull/329 :)

@doadin open port on the firewall, simply deluge is closed
https://i.imgur.com/jIo4kl5.gif
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge Windows Builds

Post by mhertz »

Thanks highvoltage, you're always so appreciative :)

Just thought as last thing post the updated spec with all exe's included, not that you need it, but just might as well regardless when made it. Thanks again doadin.

https://paste.c-net.org/OrchidsYapping

Edit: I was in python's scripts folder, so added full icon-path of deluge ico to exe's in spec, but I see on doadin's github that he changed the deluge source path, so have changed it now, plus might as well use relative path to ico, since pyinstaller normally run in deluge source folder regardless.

https://paste.c-net.org/UraniumMookie

I tested all exe's working, except deluge-console had some issues, but I think it's because of the freezing, as lists overrides and decorators.py in error at one time, where inspect.stack() (@overrides > decorators.py > inspect.py) )also failed in my stuff's deluge-console.exe, because of using alternative loader which also bypasses python.exe like freezed version, and so I had to patch out those overrides(just for deluge-console.exe) which I didn't like but worked fine in my testings so did that in end there. (Edit: No, didn't work here, doing same "trick")
doadin
Seeder
Seeder
Posts: 111
Joined: Mon Jun 30, 2014 9:24 am

Re: Deluge Windows Builds

Post by doadin »

mhertz wrote: Tue Jan 04, 2022 2:30 am Thanks highvoltage, you're always so appreciative :)

Just thought as last thing post the updated spec with all exe's included, not that you need it, but just might as well regardless when made it. Thanks again doadin.

https://paste.c-net.org/OrchidsYapping

Edit: I was in python's scripts folder, so added full icon-path of deluge ico to exe's in spec, but I see on doadin's github that he changed the deluge source path, so have changed it now, plus might as well use relative path to ico, since pyinstaller normally run in deluge source folder regardless.

https://paste.c-net.org/UraniumMookie

I tested all exe's working, except deluge-console had some issues, but I think it's because of the freezing, as lists overrides and decorators.py in error at one time, where inspect.stack() (@overrides > decorators.py > inspect.py) )also failed in my stuff's deluge-console.exe, because of using alternative loader which also bypasses python.exe like freezed version, and so I had to patch out those overrides(just for deluge-console.exe) which I didn't like but worked fine in my testings so did that in end there. (Edit: No, didn't work here, doing same "trick")
Changes the icon path but not the path to scripts :P . Its ok though I made my own edits to work for my use case. Appreciate the help, saved me some copy pasting adding in all the scripts. Appreciate it!

Thanks for testing too, glad we can use plugins now. Ill be uploading a new build soon.
doadin
Seeder
Seeder
Posts: 111
Joined: Mon Jun 30, 2014 9:24 am

Re: Deluge Windows Builds

Post by doadin »

mhertz wrote: Tue Jan 04, 2022 2:30 am Thanks highvoltage, you're always so appreciative :)

Just thought as last thing post the updated spec with all exe's included, not that you need it, but just might as well regardless when made it. Thanks again doadin.

https://paste.c-net.org/OrchidsYapping

Edit: I was in python's scripts folder, so added full icon-path of deluge ico to exe's in spec, but I see on doadin's github that he changed the deluge source path, so have changed it now, plus might as well use relative path to ico, since pyinstaller normally run in deluge source folder regardless.

https://paste.c-net.org/UraniumMookie

I tested all exe's working, except deluge-console had some issues, but I think it's because of the freezing, as lists overrides and decorators.py in error at one time, where inspect.stack() (@overrides > decorators.py > inspect.py) )also failed in my stuff's deluge-console.exe, because of using alternative loader which also bypasses python.exe like freezed version, and so I had to patch out those overrides(just for deluge-console.exe) which I didn't like but worked fine in my testings so did that in end there. (Edit: No, didn't work here, doing same "trick")
I wonder if a = Analysis([os.path.abspath(os.path.join(sys.executable, os.pardir)) + '\Scripts\deluge-console-script.py'], would work
Then if we run from deluge source dir it will find the script and the icon and won't rely on python being installed in a specific dir.
doadin
Seeder
Seeder
Posts: 111
Joined: Mon Jun 30, 2014 9:24 am

Re: Deluge Windows Builds

Post by doadin »

highvoltage
Leecher
Leecher
Posts: 57
Joined: Mon Apr 11, 2016 11:11 pm
Location: Brazil

Re: Deluge Windows Builds

Post by highvoltage »

@doadin great job, plugins works, test port works, deluge.exe works.

Could you please create a new build deluge 2.0.5 updated as on my system some trackers do not allow dev version.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge Windows Builds

Post by mhertz »

Thanks doadin, and sorry for missing that doh :) That, or something of that sorts is great idea. Anyway, just wanted to quickly say thanks for your post, and reply.

Edit: The failing checking-required-distributions problem, needing delete/rename requires.txt, can be overcome in spec by additionally importing 'copy_metadata' and a couple extra 'datas':

Code: Select all

from PyInstaller.utils.hooks import collect_all, copy_metadata
datas += copy_metadata('deluge', recursive=True)
datas += copy_metadata('service-identity', recursive=True)
Still need copy deluge into deluge-2.0.5.py3.7.egg though.

Edit2: I'll leave this windows stuff now again, but last thing i'll add, is that in addition to above, then you don't have to do any extra stuff anymore, like moving deluge dir, delete requires.txt + deluge-console.exe works now, by adding additionally to above in spec, under the other 'datas += ...' at top:

Code: Select all

datas += [ ('deluge', 'deluge-2.0.5-py3.7.egg/deluge') ]

That section supports globs, atleast for files, so could probably use a glob instead of fixed version for dest-dir - Note I still was using the stable deluge as used your little older build-scripts for initial installing/download, and I ran from the deluge source folder and used your code for analyzing scripts from scripts dir, and works good, thanks. Anyway, i'm sure there are better ways doing this, e.g. adding deluge dir to PYTHONPATH instead of copying over, maybe through runtime hook, and also currently uses extra space for an extra deluge dir copy - You could save space by deleting the deluge dir, but then deluge-console.exe however breaks again. As said you can probably find better solution, but untill then, then this works, and for all exe's, and I didn't wanna spend more time than already, coming up with better solution, when having a working one already. Thanks again mate. (btw, didn't need any extendpathdeluge/pathex, and did need 'import sys' for your analyze code to find scripts, when being in deluge-source dir)

Edit3: just noticed your draft PR, awesome work :)

Edit4: Sorry, nagged me that my previous posted solution, upped install size with 22mb or something, and didn't realize that initially, so as last thing wanted better way, and I think this is pretty OK: Official deluge instructions states to install from source through 'pip install .' When doing such, then there's only a deluge folder under site-packages(and it's dist folder) and not that stupid deluge-2.0.5.py3.7.egg dir which 'python setup.py install' makes. However, the scripts under python's Scripts dir is in exe, so cannot add to pyinstaller easilly, but after not finding a way to mod this in a nice way, then I'd suggest installing with as said first 'pip install .' and then afterwards run 'python setup.py install_scripts', which copies those to python's Scripts dir, and then when using above added spec lines, then works without needing do anything, and deluge-console.exe works, and install size not gone up, plus not two deluge package folders anymore, but only one as normally should. I just repost spec file ammends/additions here also, so everything in one place(note, only new lines, or changed lines, posted here) :

Code: Select all

from PyInstaller.utils.hooks import collect_all, copy_metadata
datas += copy_metadata('deluge', recursive=True)
datas += copy_metadata('service-identity', recursive=True)
import sys
(Edit: Complete spec: https://paste.c-net.org/MoralsPleasing. All 8 exe's tested working - from deluge source dir ran 'pip install .', 'python setup.py install_scripts' and finally 'pyinstaller deluge.spec'')

Sorry for long posting, but just wanted to get that final thing out of my head lol :)
highvoltage
Leecher
Leecher
Posts: 57
Joined: Mon Apr 11, 2016 11:11 pm
Location: Brazil

Re: Deluge Windows Builds

Post by highvoltage »

@doadin splendid work, thanks very much for all

@cas finally we will have an official installer :D everyone did an amazing job
Post Reply