Opened 3 years ago

# Create Windows package (Py3-GTK3)

Reported by: Owned by: Cas major 2.1.x Packaging develop hi@…, tobbez@…, rick3162@…

With the move to a GTK3 UI we need a way to easily create the Windows package.

I am not sure what the best route is going to be but we need something that can always get the latest versions of GTK3 as we had to use outdated PyGTK versions as no other builds existed.

It would be good to drop the usage of MSVC and go with msys2 but there are hurdles to doing that with regards to Twisted and pywin32 (see #3181). These are the steps for another GTK3 project building with msys2:

Alternatively we continue with MSVC and roll our own GTK3 builds:

We will also need to move from bbfreeze to most likely pyinstaller but that is further down the road: Freezing comparison

Help or suggestions with this would be appreciated as primary development is on Ubuntu.

### comment:1 Changed 3 years ago by Cas

• Description modified (diff)

### comment:2 Changed 3 years ago by Cas

• Description modified (diff)

### comment:3 Changed 3 years ago by Doadin

Not sure if it will make a difference but back when I was first starting to make GTK3 changes to deluge I did some work updating bbfreeze to have better module finding and python 3 support. I got all of the python code to python 3 but the python c api portion I could not fix.(it doesnt need much) The code is on my github under ccfreeze if you want to try it out.

### comment:4 Changed 3 years ago by Cas

Yeah thanks, I remember I was impressed you got that working. However bbfreeze is a dead project now and doesn't officially support Python 3 or GTK3 so we need to move on, despite it serving us well.

Last edited 3 years ago by Cas (previous) (diff)

### comment:5 Changed 2 years ago by Cas

So I have had some success testing out building with gvsbuild scripts and I have created a fork of gvsbuild so the job artifacts can be downloaded from appveyor:

Currently there are a few windows specific issues with the deluge code:

• Remove py2-ipaddress lines from setup.py and requirements.txt.
• Comment out the entire last try..except in deluge.common.set_env_variable.

Extract the gvsbuild tarball and add to path. From console in deluge source dir:

set PATH=C:\gvsbuild\release;%PATH%
pip install C:\gvsbuild\release\python\pycairo-1.17.1-cp36-cp36m-win_amd64.whl
pip install C:\gvsbuild\release\python\PyGObject-3.28.3-py3.6-win-amd64.whl
pip install -r requirements.txt
pip install -e .

Last edited 2 years ago by Cas (previous) (diff)

### comment:6 Changed 2 years ago by Cas

To get a nicer theme create a file: C:\gvsbuild\release\etc\gtk-3.0\settings.ini with the following:

[Settings]
gtk-theme-name=win32


### comment:7 Changed 2 years ago by Cas

• Summary changed from GTK3 Windows build to Create Windows package (Py3-GTK3)

### comment:8 Changed 23 months ago by Cas

• Milestone changed from 2.0.0 to 2.1.x

Ticket retargeted after milestone closed

### comment:9 follow-up: ↓ 18 Changed 23 months ago by Cas

An update to the above steps:

1. Install python dependencies
pip.exe install C:\gvsbuild\release\python\pycairo-1.18.0-cp36-cp36m-win_amd64.whl
pip.exe install C:\gvsbuild\release\python\PyGObject-3.32.0-cp36-cp36m-win_amd64.whl


1. Install deluge
pip.exe install deluge deluge-libtorrent

1. deluge-libtorrent wheel currently needs OpenSSL 1.1.0 installed:
1. Install MC VC Runtime:
1. Check that libtorrent definitely imports with:
python -c "import libtorrent; print(libtorrent.__version__)"

1. Run deluge:
set PATH=C:\gvsbuild\release\bin;%PATH%
deluge.exe


The gvsbuild path can be added to global env vars to save setting each time.

Last edited 23 months ago by Cas (previous) (diff)

### comment:10 Changed 23 months ago by DjLegolas

Windows 10, python3.7, lt-1.2.1 confirmed working.

### comment:11 Changed 23 months ago by Doadin

I just restarted remaking my build systems to update for gtk3 testing again and pretty much same setup 64-bit and it works except still the libintl name change. https://github.com/deluge-torrent/deluge/pull/226/commits/34d24ebe0579fd0cde6934e5460762bb60152224 is that just me or? gtk 3.24? idk.

Last edited 23 months ago by Doadin (previous) (diff)

### comment:12 follow-up: ↓ 13 Changed 22 months ago by Doadin

Also still getting an error with the simulate() workaround in connection manager

  File "C:\Python\Python37\lib\site-packages\deluge-2.0b2.dev302-py3.7.egg\deluge\ui\gtk3\connectionmanager.py", line 144, in show
reactor.simulate()
File "C:\Python\Python37\lib\site-packages\twisted\internet\_glibbase.py", line 385, in simulate
timeout = min(self.timeout(), 0.01)
TypeError: '<' not supported between instances of 'float' and 'NoneType'


it seems a timeout is not set. seems like it would be better if the twisted code checked to see if timeout is set before calling it.

        if timeout is None:
timeout = 0.01
timeout = min(self.timeout(), 0.01)

timeout = min(self.timeout(), 0.01)
if timeout is None:
timeout = 0.01


but is there something we are missing?

### comment:13 in reply to: ↑ 12 Changed 22 months ago by Cas

Also still getting an error with the simulate() workaround in connection manager

  File "C:\Python\Python37\lib\site-packages\deluge-2.0b2.dev302-py3.7.egg\deluge\ui\gtk3\connectionmanager.py", line 144, in show
reactor.simulate()
File "C:\Python\Python37\lib\site-packages\twisted\internet\_glibbase.py", line 385, in simulate
timeout = min(self.timeout(), 0.01)
TypeError: '<' not supported between instances of 'float' and 'NoneType'


Create a new upstream ticket: https://twistedmatrix.com/trac/newticket

It is an issue with migrating Twisted to Python 3. Python 2 was happy to compare different types but Python 3 is stricter and raises a TypeError.

-        timeout = min(self.timeout(), 0.01)
-        if timeout is None:
-            timeout = 0.01
+        timeout = self.timeout()
+        if timeout is None:
+            timeout = 0.01
+        timeout = min(timeout, 0.01)


In Deluge probably just catch the error and pass or remove it, if it does nothing anymore. The associated comment is not so helpful:

# XXX: We need to call a simulate() here, but this could be a bug in twisted

### comment:14 Changed 22 months ago by Doadin

ok so i have reported up. and yea seems like we need something to change in deluge, though doesn't seem like we have too many options other than just ignore it as in python 3 this error stops the connection manager from opening at least the first few times you hit it.(i find if i open preferences then connection manager it opens first time). However this is almost as annoying as the issue simulate solves.

### comment:17 Changed 22 months ago by Jay-C

• Cc niklas.holm.271@… removed

Apparently I can't figure out how to just follow an issue. Hopefully leaving a comment will do the trick.

Keep up the good work :)

### comment:18 in reply to: ↑ 9 ; follow-up: ↓ 19 Changed 21 months ago by OishikR

An update to the above steps:

...

1. Install python dependencies
pip.exe install https://download.lfd.uci.edu/pythonlibs/t4jqbe6o/Twisted-19.2.1-cp36-cp36m-win_amd64.whl



...

Hey all, thanks for the great work you do (that goes straight over my head!). I'm just commenting to point out that these two links that I've pointed out in this reply are no longer valid, and will throw 404 errors. It seems the LFD website has been restructured, and there's not an easily apparent way to get to these modules. I'm trying to install Twisted and setproctitle via pip, and I'll update you guys if it goes wrong.

### comment:19 in reply to: ↑ 18 Changed 21 months ago by zamadatix

It seems the LFD website has been restructured, and there's not an easily apparent way to get to these modules.

I was able to find the latest links to the modules here https://www.lfd.uci.edu/~gohlke/pythonlibs/ (there is a clickable index at the top of the page)

### comment:20 Changed 21 months ago by corhsin

A few quick enhancements to the directions and some observations:

1. Only the 32-bit VC++ executable needs be installed if you are using a 64-bit system.
1. Hold the WIN (flag) KEY and press PAUSE(/BREAK) and click ADVANCED SYSTEM SETTINGS, or, open a RUN box, WIN+R, and type SystemPropertiesAdvanced?.exe.
2. Click ENVIRONMENT VARIABLES.
3. Under 'SYSTEM VARIABLES' (the second section) click PATH.
4. EDIT and verify or add (NEW) the following: C:\Program Files\Python36\Scripts\ C:\gvsbuild\release\bin C:\Windows\System32\OpenSSH\
5. If you did not install for 'All Users' these paths may instead need to be in your %userprofile% or %appdata% (not verified).
3. Python 3.7 cannot be utilized with the instructions because deluge-libtorrent is incompatible (it is version 36, and 37 is not in the store).
4. A Desktop or Start Menu / etcetera icon can be created if the PATH variables are set. The icon should point to: "C:\Program Files\Python36\Scripts\deluge.exe" . This relies upon default installation locations and an 'all users' configuration.
1. Make it pretty with the icon located at: C:\Program Files\Python36\Lib\site-packages\deluge\ui\data\pixmaps
5. The default plug-ins are not listed. They can be installed from: "C:\Program Files\Python36\Lib\Site-Packages\Deluge\plugins". They are currently non-functional (they do not add).
6. The button to associate Magnet links is non-functional.

Keep up the good work!

Last edited 21 months ago by corhsin (previous) (diff)

### comment:22 Changed 20 months ago by bengalih

So excited for Deluge 2, was a bit disappointed in the Windows state of things. I've been reading the bug as well as some forum posts. The title of this bug "Create Windows package (Py3-GTK3)" seems to infer that Deluge will work successfully on Windows, but that no easy package installer exists.

However, it appears from reading here that even with doing manual install of all the components, that Deluge will not be 100% functional on Windows. Specifically, just from this thread I can see:

• simulate() error in Twisted - due to Python 3 compatibility.
• Plugins don't work

I believe the former doesn't effect functionality (just a cosmetic thing?). However the lack of plugins seems a huge issue in Windows users being able to upgrade.

Is there a more comprehensive list (if more than the above) on why the plugins won't work. Or, is there a bug that discusses the status of the plugins for Windows?

I am bringing this up here because it seems to me that deluge not providing a simple installer is a bit different than deluge not being able to be run at full functionality *at all* on Windows systems.

I think there are many of us who would go through a manual 100 step process to get Deluge running on Windows if we knew it would be 100% functional.

As deluge is using multiple components and some of those components may simply not work with the chosen version of Python, or certain dependencies may not work properly on Windows at all, it starts to look bleak for actual implementation on Windows.

Could we get some more info regarding the status of the actual functionality and what limitations still need to be overcome for windows functionality exclusive of the fact there isn't a proper installer?

I'm not much of a Python coder, but if I knew a bit more about what integration issues we are looking at I wouldn't mind devoting some time to researching for the greater good here.

### comment:23 Changed 19 months ago by mhertz

The default plugins not working can be fixed by renaming the python version in there filenames from '3.7' to '3.6'.

The issues remaining should be about packaging and the instructions given to use it without an installer should give full functionality I believe(when renaming plugins).

It lacks a native windows theme and the magnet-association button was stated to be unfunctionel, though the association can be made manually and in this ticket Cas desribed how to get a windows 7 alike theme enabled also.

Untill a real installer emerges, I've made a 7z-sfx-installer of Deluge2, but it is simply an installer which will give you same result as if following the manual instructions, i.e it will be a much bigger install in size and also adds entries to the Path system-environment-variable.

Last edited 19 months ago by mhertz (previous) (diff)

### comment:24 Changed 19 months ago by obraca

To get a native windows theme just create an environment variable: GTK_CSD with value of 0

There are some details that don't work, like you don't see an arrow indicating a submenu, but overall it's usable and Windows native.

### comment:25 Changed 19 months ago by mhertz

Thanks for the tip obraca! I did previously read about that and experimented with it when I made my 7z-sfx-installer, but I stupidly just thought I could add the option to the settings.ini file, and I also tested adding it instead from terminal with "cmd /c set GTK_CSD=0 && deluge.exe", but both ways I couldn't see a difference so ditched it, but I stupidly did it wrong and so it never got applied propperly to deluge.exe. When doing it correctly, either by normal ways or e.g. using env.exe from win32 coreutils, then I see it infact does make a difference lol, so thanks for the tip :)

### comment:26 Changed 19 months ago by mhertz

I wanted to report that when following install-instructions then thinclient-mode doesn't work and you cannot exit deluge without killing deluge.exe or python from task-manager or terminal(when thinclient-mode enabled).

While trying to troubleshoot it, I funny enough found a workaround in simply enabling debug-logging :)

So, if using thinclient mode with the provided install-instructions, then add to end of your deluge shortcut-command: ' -L debug -l %userprofile%\deluge.log'

### comment:27 Changed 19 months ago by mhertz

Sorry, addendum to above, then I found that if you play with window size, and/or maximize/minimize, then when selecting connection-manager it will come through, and/or quiting deluge becomes possible, and sometimes more "playing around" is needed than othertimes. Debug-logging solves this still though.

### comment:28 Changed 18 months ago by mayli

How about borrow the packaging from quodlibet?

The unpack size is about 159 MB, with a copy of python3 and gtk stuff. It's building windows app using msys2, with https://github.com/quodlibet/quodlibet/tree/master/win_installer

$cd quodlibet-4.2.1-portable/$ du -sh *
943K    config
172M    data
4.0K    exfalso.lnk
4.0K    quodlibet.lnk

$du -sh data/* 61M data/bin 68M data/lib 43M data/share 686K data/ssl$ du -sh data/lib/*
4.0K    data/lib/ckport
76K     data/lib/engines-1_1
528K    data/lib/gdk-pixbuf-2.0
168K    data/lib/gio
2.8M    data/lib/girepository-1.0
37M     data/lib/gstreamer-1.0
60K     data/lib/modules
28M     data/lib/python3.7

\$ du -sh data/share/*
20K     data/share/GConf
36K     data/share/glib-2.0
28M     data/share/icons
568K    data/share/libthai
15M     data/share/locale
212K    data/share/openal


### comment:29 follow-up: ↓ 30 Changed 18 months ago by Paralel

Is there absolutely any way someone could upload the latest version of Libtorrent, compiled with all the latest components, for Windows x64 to PyPi? that is compatible with Python 3.6? The Deluge-Libtorrent currently on PyPi? is ancient at this point. I love Deluge, but I'd really like to keep my Libtorrent up to date.

I know what everyone here is going to say "build it yourself". I seriously would, but the only set of instructions I know of talk about how to do it in Windows using Python 2.7, rather than Python 3.6 like the Deluge-Libtorrent that is available through PyPi?. If someone wants to write a set of instructions on how I can do this myself (the old "Teach a man to fish... etc...") rather than just upload the file, I'm game. I'll sit here and beat my head against that wall until it gives I just honestly don't know enough on how to modify the instructions for the build using Python 2.7 in order to do it for Python 3.6.

### comment:30 in reply to: ↑ 29 ; follow-up: ↓ 31 Changed 18 months ago by mayli

The tricky part is that we have 2 (or more compilers) on windows, MSVC and MinGW/GCC. I've uploaded the linux wheel on test, and probably could work on windows wheel in this weekend.

Is there absolutely any way someone could upload the latest version of Libtorrent, compiled with all the latest components, for Windows x64 to PyPi? that is compatible with Python 3.6? The Deluge-Libtorrent currently on PyPi? is ancient at this point. I love Deluge, but I'd really like to keep my Libtorrent up to date.

I know what everyone here is going to say "build it yourself". I seriously would, but the only set of instructions I know of talk about how to do it in Windows using Python 2.7, rather than Python 3.6 like the Deluge-Libtorrent that is available through PyPi?. If someone wants to write a set of instructions on how I can do this myself (the old "Teach a man to fish... etc...") rather than just upload the file, I'm game. I'll sit here and beat my head against that wall until it gives I just honestly don't know enough on how to modify the instructions for the build using Python 2.7 in order to do it for Python 3.6.

### comment:31 in reply to: ↑ 30 Changed 18 months ago by Paralel

Ah, I understand. That didn't even cross my mind. I was strictly thinking about the instructions above in comment 9. I forgot about those that are using other compilers. Thank you for explaining that to me. It wasn't my intent to disregard other users or push for anything. I am more than happy to wait until whenever to see the end result.

The tricky part is that we have 2 (or more compilers) on windows, MSVC and MinGW/GCC. I've uploaded the linux wheel on test, and probably could work on windows wheel in this weekend.

Is there absolutely any way someone could upload the latest version of Libtorrent, compiled with all the latest components, for Windows x64 to PyPi? that is compatible with Python 3.6? The Deluge-Libtorrent currently on PyPi? is ancient at this point. I love Deluge, but I'd really like to keep my Libtorrent up to date.

I know what everyone here is going to say "build it yourself". I seriously would, but the only set of instructions I know of talk about how to do it in Windows using Python 2.7, rather than Python 3.6 like the Deluge-Libtorrent that is available through PyPi?. If someone wants to write a set of instructions on how I can do this myself (the old "Teach a man to fish... etc...") rather than just upload the file, I'm game. I'll sit here and beat my head against that wall until it gives I just honestly don't know enough on how to modify the instructions for the build using Python 2.7 in order to do it for Python 3.6.

### comment:32 Changed 18 months ago by tobbez

Issues I noticed while trying to run Deluge 2 on Windows:

1. start_daemon mixes bytes and str when calling subprocess.Popen: https://dev.deluge-torrent.org/ticket/3313#comment:2
1. The GdkPixbuf? (from gvsbuild) seems to have a problem that causes deluge to exit with an access violation¹ after attempting to loading a few .ico files (some of which are invalid). There are no messages in the debug log, but if running in a console it produces the following output:
c:\apps\deluge2\venv\lib\site-packages\deluge\ui\gtk3\common.py:75: Warning: cannot register existing type 'GdkPixbufGdipAnim'
return Pixbuf.new_from_file_at_size(filename, size, size)
c:\apps\deluge2\venv\lib\site-packages\deluge\ui\gtk3\common.py:75: Warning: g_once_init_leave: assertion 'result != 0' failed
return Pixbuf.new_from_file_at_size(filename, size, size)
c:\apps\deluge2\venv\lib\site-packages\deluge\ui\gtk3\common.py:75: Warning: g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' failed
return Pixbuf.new_from_file_at_size(filename, size, size)

For now I just patched deluge's get_pixbuf_at_size (in deluge\ui\gtk3\common.py) and prepended the 4 lines to it:
def get_pixbuf_at_size(filename, size):
# current GdkPixbuf is broken somehow and crashes after loading some number of ico files
if filename.endswith('.ico'):
return create_blank_pixbuf(size)

That prevents the crash, but obviously means you won't see icons for trackers that use .ico.
1. The twisted simulate issue that has been mentioned previously.
1. Deluge 2 fails to load a state file from Deluge 1.3.x:
Traceback (most recent call last):
File "c:\apps\deluge2\venv\lib\site-packages\twisted\internet\base.py", line 1292, in mainLoop
self.runUntilCurrent()
File "c:\apps\deluge2\venv\lib\site-packages\twisted\internet\base.py", line 913, in runUntilCurrent
call.func(*call.args, **call.kw)
File "c:\apps\deluge2\venv\lib\site-packages\twisted\internet\defer.py", line 460, in callback
self._startRunCallbacks(result)
File "c:\apps\deluge2\venv\lib\site-packages\twisted\internet\defer.py", line 568, in _startRunCallbacks
self._runCallbacks()
--- <exception caught here> ---
File "c:\apps\deluge2\venv\lib\site-packages\twisted\internet\defer.py", line 654, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "c:\apps\deluge2\venv\lib\site-packages\twisted\internet\task.py", line 866, in <lambda>
File "c:\apps\deluge2\venv\lib\site-packages\deluge\core\torrentmanager.py", line 239, in start
File "c:\apps\deluge2\venv\lib\site-packages\deluge\core\torrentmanager.py", line 832, in load_state
state = self.open_state()
File "c:\apps\deluge2\venv\lib\site-packages\deluge\core\torrentmanager.py", line 812, in open_state
builtins.UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 19: ordinal not in range(128)

This is likely only a problem when the state files contains non-ASCII, and can be worked around by manually converting the state file by opening a Python interpreter and running:
import pickle
with open('torrents.state', 'rb') as f:

with open('torrents.state', 'wb') as f2:
pickle.dump(d, f2)

1. When starting the daemon (deluged) when using the thin client, the daemon spawns a console window.

That happens because it's started by python instead of pythonw, which could be solved upstream by moving the deluged entry point in setup.py to gui_scripts².

It also seems like the extra entry point executables (deluge-debug.exe/deluged-debug.exe/deluge-web-debug.exe) specified in setup.py do not get installed.

As workaround (for users who just want to get this working locally) running something like the following to convert the executable should work:

# replace PYTHONDIR with the root of your Python installation
with open(r'PYTHONDIR\Lib\site-packages\pip\_vendor\distlib\w64.exe', 'rb') as f:
with open(r'...\path\to\deluged.exe', 'rb') as f:
with open(r'...\path\to\deluged.exe', 'wb') as f:
f.write(launcher)
f.write(d[d.rindex(b'#!'):])


But make a backup copy of deluged.exe first.

¹: echo %errorlevel% after it exits yields -1073741819 (= 0xc0000005)

²: Non-windows platforms should not be affected since gui_scripts are handled just like console_scripts there

### comment:33 Changed 18 months ago by mhertz

Thank you so much tobbez, you seriously rock! :) I have posted your findings on the deluge-forum also. I'll remake my "installer" tomorrow with your fixes and thank you many times again!

### comment:34 Changed 18 months ago by tobbez

In addition to my earlier comment, it also appears that the libtorrent provided by deluge-libtorrent (cf. comment:9) is not actually built/linked against OpenSSL, causing announces to https trackers to fail with unsupported URL protocol.

### comment:35 Changed 18 months ago by mhertz

Good finding again, thank you! I omitted the OpenSSL files from my 7z-sfx-installer,because it didn't seem to make a difference if including them or not, though didn't even think of testing https-trackers(I kinda thought it just was used by deluge to communicate with its daemon encrypted or something and the files already where in the OS possibly.) Thanks again.

### comment:36 Changed 18 months ago by mhertz

@tobbez, I accidentially asked you a question in wrong ticket, sorry, and I repost it here because you're not in the Cc list of that other ticket:

---

Do the code you posted for .5 work for you locally?

I used my deluge2 from Cas's install-instructions and because of admin-rights needed, I copied deluged.exe into my win10 VM's user(fooba) Downloads folder and changed your code to match my system and then runned it and it did change the file I could see from the file-properties, and then I overwrote deluged.exe from Downloads and back to correct place again(I did backup it first), but the result is same as before and I can see python and not pythonw.exe runs deluged.exe still and doesn't background itself.

I apologize in advance if messing up your instructions, as that is very likely ;)

# replace PYTHONDIR with the root of your Python installation
with open(r'C:\Program Files\Python36\Lib\site-packages\pip\_vendor\distlib\w64.exe', 'rb') as f:
f.write(launcher)
f.write(d[d.rindex(b'#!'):])


### comment:37 Changed 18 months ago by tobbez

Replace the last line (f.write(d[d.rindex(b'#!'):])) with:

f.write(d[d.rindex(b'#!'):].replace(b'python.exe', b'pythonw.exe'))

### comment:38 Changed 18 months ago by mhertz

Sorry for continuing to repeat myself, but i'm really gratefull of all your help mate, works beatifully! :) Thank you again.

### comment:39 follow-up: ↓ 40 Changed 18 months ago by mhertz

@Paralel, I've built latest libtorrent for use with my deluge2 windows 7z-sfx-installer posted on deluge-forum, and including https-tracker-announcing support. It was pretty daunting and timeconsuming getting it to work, as never did it before and no windows user, but seemingly works fine.

Especially getting openssl support to work was hardest - there is a bug I believe with defaulting to x32, even though all components used are x64 and setup as x64, but still, and finally when using x32 version of openssl then it worked, because of said bug I believe. I believe Cas did things correctly, e.g. see: https://ci.appveyor.com/project/cas--/libtorrent/builds/20499246 but just stumbled on same bug, and needing 32bit openssl, as with many runs of x64-openssl, and several different versions i.e tried 1.1.1, 1.1 and 1.0.2 and it didn't work, even though libtorrent is fixed to work with new names of dll's of openssl 1.1+. Ohh, newest boost didn't work for me, and I had go one version down. Here is bug I believe: https://github.com/conan-community/community/issues/164

### comment:40 in reply to: ↑ 39 Changed 18 months ago by Paralel

Thank you so much! Exactly what I was looking for. I really appreciate it. If you ran into that kind of trouble, I can only imagine how awful it would have been for me to attempt it. Your work on the installer is also greatly appreciated.

@Paralel, I've built latest libtorrent for use with my deluge2 windows 7z-sfx-installer posted on deluge-forum, and including https-tracker-announcing support. It was pretty daunting and timeconsuming getting it to work, as never did it before and no windows user, but seemingly works fine.

Especially getting openssl support to work was hardest - there is a bug I believe with defaulting to x32, even though all components used are x64 and setup as x64, but still, and finally when using x32 version of openssl then it worked, because of said bug I believe. I believe Cas did things correctly, e.g. see: https://ci.appveyor.com/project/cas--/libtorrent/builds/20499246 but just stumbled on same bug, and needing 32bit openssl, as with many runs of x64-openssl, and several different versions i.e tried 1.1.1, 1.1 and 1.0.2 and it didn't work, even though libtorrent is fixed to work with new names of dll's of openssl 1.1+. Ohh, newest boost didn't work for me, and I had go one version down. Here is bug I believe: https://github.com/conan-community/community/issues/164

### comment:41 Changed 18 months ago by mhertz

Thanks for the kind words and your welcome mate! :)

### comment:42 Changed 18 months ago by mhertz

@Paralel and others, I much apologise, but I found that I must have made a mistake previously, because I now managed to build libtorrent with x64 openssl libs, so I must have messed the added openssl build-options up I added to the config-file somehow. Still the command-prompt initially shows x32 mode as before and the boost build dir named bin.nt86 and not bin.nt86_64, though 64bit address mode is specified on b2 command-line I can see, but I was wrong in my previous assumption that x64 openssl libs couldn't be picked up obviously.

The old libtorrent.pyd I posted works fine, and I tested specifically with https trackers which openssl relates to and makes supported, and that worked fine in previous version, but it just seemed more correct to use x64 openssl libs nonetheless, so here is the updated build, and I apologise again: http://s000.tinyupload.com/index.php?file_id=01545958734472286363

### comment:43 Changed 18 months ago by mhertz

I'm sorry, there need to be 3 files added to same location as libtorrent.pyd which I previously posted zipped link too, which I didn't noticed before as already had them in my search-path.

Here's a zip with libtorrent.pyd and the three other needed deps, to unzip and overwrite in e.g. if using my installer: '%programfiles%\Deluge2\Lib\site-packages', and if using Cas's manual-install-instructions then the same path except exchange 'Deluge2' folder with 'Python36', and if you haven't installed python for all users, then instead of '%programfiles%, then '%userprofile%\AppData?\Local\Programs\Python\Python36', or something along those lines.

Sorry for inconvenience and oversight again, and I will not spam this ticket more if finding other issues, and so if using this, then please instead check my thread on deluge-forum for more updates if other issues should occure.

### comment:44 Changed 17 months ago by mhertz

Since Cas's install instructions in this thread results in not being able to announce to https trackers, then i'm trying to build libtorrent v1.1.13 with openssl, but even without openssl, then it doesn't work right in deluge2 for me, even though I can import it fine in a python terminal still outside of deluge2. I can build latest libtorrent v1.2.2 and run in deluge2 fine, but just not v1.1.13, and don't get it.

The strange thing also, is that often then right after building it, then when adding it to deluge2 and firering it up, then deluge2 start fine with it, but then if disconnecting from daemon and closing deluge2 and starting it again, then it never works regardless of how many times trying. It shows an error 10061 of connection actively refused by destination computer, and loading it into dependency walker and profiling it(deluged.exe), shows this error:

Second chance exception 0xE06D7363 (Microsoft C++ Exception) occurred in "KERNELBASE.DLL" at address 0x00007FFB59ED50D8.


In the debug-log of deluge2 it states:

00:59:07 [DEBUG   ][deluge.ui.client                  :302 ] sslproxy.disconnect()
00:59:07 [DEBUG   ][deluge.ui.gtk3.connectionmanager  :319 ] Failed to connect: Connection was refused by other side: 10061: Der kunne ikke oprettes forbindelse, fordi destinationscomputeren aktivt nægtede det..
00:59:07 [INFO    ][deluge.ui.gtk3.connectionmanager  :335 ] Retrying connection.. Retries left: 1
00:59:07 [DEBUG   ][deluge.ui.gtk3.connectionmanager  :288 ] Attempting to connect to daemon...
00:59:07 [DEBUG   ][deluge.ui.client                  :286 ] sslproxy.connect()
00:59:07 [DEBUG   ][deluge.ui.client                  :212 ] Connecting to daemon at "127.0.0.1:58846"...
00:59:08 [DEBUG   ][deluge.ui.client                  :219 ] Connection to daemon at "127.0.0.1:58846" failed: Connection was refused by other side: 10061: Der kunne ikke oprettes forbindelse, fordi destinationscomputeren aktivt nægtede det..
00:59:08 [DEBUG   ][deluge.ui.client                  :596 ] on_connect_fail: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionRefusedError'>: Connection was refused by other side: 10061: Der kunne ikke oprettes forbindelse, fordi destinationscomputeren aktivt nægtede det..
]
00:59:08 [DEBUG   ][deluge.ui.client                  :302 ] sslproxy.disconnect()
00:59:08 [DEBUG   ][deluge.ui.gtk3.connectionmanager  :319 ] Failed to connect: Connection was refused by other side: 10061: Der kunne ikke oprettes forbindelse, fordi destinationscomputeren aktivt nægtede det..


(The danish part means that there couldn't be made a connection because destination computer actively refused it - I also just in case tried disabling firewall, but didn't help either)

I have tried 5 different boost versions, where most give linking errors, which either is online reported to be unresolved or fixed by changing boost version. I know using boost over v1.66 needs a patch added to jamfile to support python3 or something along those lines, but I do add that also, which makes it run, but fails later with linking errors. I usually stick to v1.66 because was reported by a libtorrent dev to be recommended as didn't need patches, and using that, makes it be imported every time in a terminal, but just not in deluge2, except often right after the building. I always include runtime files needed, and also tried b2 option of static runtime linking, but again without any change.

I use python v3.68, and msvc-build-tools latest version 2019(14.23), but have tried also 2017 edition(v14.16), and change setup.py to reflect the proper msvc version, which is added to b2 command-line then, and address-model=64 I also use, and again, I build libtorrent v1.2.2 with openssl fine, and doesn't have this issue and always connects in deluge2, but it does however still show a connection error or two of the one posted above, but always connects fine anyway, as 5 or 6 of those is supported before failing I can see.

Thanks alot in advance, as this is driving me freakin' crazy soon, as have run 100 test of this now I'd guess, in the last weeks time or so.

Last edited 17 months ago by mhertz (previous) (diff)

### comment:45 Changed 17 months ago by mhertz

Just wanted to add if others should be wondering, or finding this from a google search, that I overcome the above issue by changing to msvc-14.00(vc build tools 2015), instead of 2017 or 2019.

### comment:46 Changed 17 months ago by Doadin

Has anyone had an success getting pyinstaller to work?

Also since people seem to have trouble I made a guide kinda of with information/scripts to completely compile deluge and its dependencies from source. That can be found here: https://github.com/doadin/DelugeBuildFromSource It is a little bit excessive since it compiles EVERYTHING but can adapt and modify as you see fit.

Last edited 17 months ago by Doadin (previous) (diff)

### comment:47 Changed 17 months ago by mhertz

Sorry no, but just wanted to say thanks alot for your scripts, great stuff indeed, which I'll be sure to link to on the forum, whenever people ask for deluge2 on windows. I was looking through Cas's github to see how he build gtk3 for deluge(gvsbuild) as was thinking about making a new and up to date with recent fixes gtk3, to include in my "installer", and also possibly with py3.8 as I wanted to upgrade to that anyways and then need pygobject wheel for py3.8 which isn't available online anywhere, and when trying building pygobject alone, with py3.8, then it errors out with a missing Lib linking error, on several different msvc build tools versions.

Sorry for blabbing on here, and just wanted to say that your efforts, past and present are greatly appreciated. (I was also looking into possibly using, if figuring out how such works, your updated bbfreeze, but am a total beginner in stuff like this unfortunately :) )

### comment:48 Changed 17 months ago by Doadin

when I tried pyinstaller I got a spec file and it got all the dependencies(or so it looks like) however it said it couldn't find distribution Deluge. So I must not be giving it the right entry point or something. However the hooks they have all ready established seem to pick up everything just fine. And I have been using deluge 2 on windows just fine so I think its really close to being able to get a windows release going just needs a little work.

### comment:49 Changed 17 months ago by Artemciy

With the move to a GTK3 UI we need a way to easily create the Windows package.

https://github.com/microsoft/vcpkg has packages for both the Python 3 and GTK 3. I wonder if this can be leveraged somehow. Just my two cents.

### comment:50 Changed 16 months ago by Doadin

I have now added a spec file to my gihthub repository linked above for building from source. With this spec file its possible to freeze deluge using pyinstaller. The resulting dist freezes shortly after the main window loads still trying to figure that out.

If you start in thin client mode the connection dialog is completely usable its only the main window that is frozen, seems like the issue is in the main window.

Last edited 15 months ago by Doadin (previous) (diff)

### comment:51 Changed 15 months ago by Paralel

Just wanted to mention, the gvsbuild tarball, mentioned in the first step of comment 9 of this ticket:

Has expired and can no longer be downloaded. As such, anyone trying to build using that set of instructions will be stymied starting at step 1.

### comment:52 Changed 15 months ago by mhertz

Thanks Paralel for the notice.

For all, until Cas has time to upload a new tarball, then you can either build it yourself, using doadin's repo he presented a couple posts above, with batchfiles for building from source: deluge, libtorrent, gvsbuild and openssl:

Or, alternatively i've up'ed the tarball in question, though link get's disabled after 30 days without downloads, so contact me if link dies later on, and i'll re'up it:

### comment:53 follow-up: ↓ 55 Changed 15 months ago by Doadin

I now have a build that doesn't freeze I just need to package the core(deluged)/web(deluge-web) scripts. It is having a issue with loading plugins and a few other things. Like:

deluge\ui\client.py", line 674, in start_daemon

TypeError: a bytes-like object is required, not 'str'


Other than that the base client seems to work fine from freeze/installer now.

Last edited 15 months ago by Doadin (previous) (diff)

### comment:54 Changed 15 months ago by Doadin

I guess I've just been late to the party this whole time https://github.com/deluge-torrent/deluge/commit/535b13b5f1b7b7d3d104da14c4cb2a4a9502bfe0 I still don't know how to fix plugins.

### comment:55 in reply to: ↑ 53 Changed 15 months ago by mhertz

I now have a build that doesn't freeze I just need to package the core(deluged)/web(deluge-web) scripts. It is having a issue with loading plugins and a few other things. Like:

deluge\ui\client.py", line 674, in start_daemon

TypeError: a bytes-like object is required, not 'str'


Other than that the base client seems to work fine from freeze/installer now.

About the client.py issue, then tobbez helped me with that + several other things, both in this thread and here: https://dev.deluge-torrent.org/ticket/3313#comment:2

### comment:56 follow-up: ↓ 59 Changed 12 months ago by ish4d0w

Hi,

I cannot believe that almost a year later, Deluge 2 for Windows is still not available. Is this project completely abandoned? Anyway, I'm trying to compile it myself but...

Compiling with the latest tools (Visual Studio Enterprise 2019, Python 3.8+ x64 latest) FAILS!

Is this a legacy application that requires Python 3.6?

Can somebody please reup all the dependencies to some credible file hosting site as ALL the links are down?

### comment:57 Changed 12 months ago by mhertz

Lack of volunteered manpower obviously means less releases/work in these types of projects, especially on windows, where there's even less manpower, and when issues additionally puts a hold on things. Releases don't simply come flying through the thin air magically. Very first post asked for help from community, which came, but not nearly enough. However, I'm also surpriced not more volunteered help for such a popular project has occurred, but that's just the sad reality.

If wanna see if abandoned project then check git commit log of development branch. It's not abandoned, just pretty slow at times, but just recently picked up again.

If you're talking about building libtorrent python bindings, then I can confirm it works with msvc-2019 toolset and python 3.8.2. I personally have best results with boost 1.70 for libtorrent 1.2.x, and 1.66 with 1.1.x.

Im not at my computer now, but tomorrow I'll upload pygobject and pycairo latest wheels for py38 and in some other py versions, which I believe I still have, and an updated gvsbuild gtk3 archive of latest gtk3.24.20. Pycairo is already at the gohlke wheels site, but not pygobject unfortunetly, which is harder to find online and need build your own, but as said I'll post them tomorrow.

### comment:58 follow-up: ↓ 72 Changed 12 months ago by mhertz

I didn't have py36 wheels anymore, sorry, but here's pycairo and pygobject for py37 and py38, though py37 is not newest version though: http://s000.tinyupload.com/index.php?file_id=73322123121773264450

You don't need the other wheels, as already on pypi, so only need these two.

Gtk3.24.20 zipped archive. Note I omitted the x64 folder, so omit the x64 part when following instructions from Cas to add gvsbuild to path: https://gofile.io/?c=LatBqY

If just wanting readymade deluge 2.0.3 from pypi, then just 'pip install' the two wheel's and 'deluge', though remember a libtorrent(I believe one is on pypi too, if not wanting build yourself) and runtimes installed.

Also, here's prebuilt libtorrent latest 1.2.x(1.2.6) and 1.1.x(1.1.14), which can be dropped into python's 'Lib\site-packages' folder: http://s000.tinyupload.com/index.php?file_id=00000203889311879236

Also, to avoid runtimes-install, then you can drop these two files into the bin folder of gvsbuild that you add to path: http://s000.tinyupload.com/index.php?file_id=03819964817140265822

Last, if deluge fails starting, then delete session.state file from deluge profile folder if having such, which is an old deluge bug.

### comment:59 in reply to: ↑ 56 Changed 12 months ago by Paralel

Ish4d0w, try checking the forum before complaining on the tickets here.

MHertz and the other Dev's have done plenty of work. MHertz has essentially taken the herculean task of creating a functional windows installer solely on his shoulders since Sept. 2019 and subsequently produced an incredible installer. Literally all the major issues have been solved, even most of the minor issues have been solved. As of the last few months all of the dependent packages are completely up to date. Honestly, MHertz installer should just be designated the official Windows installer. There is really no good reason not to at this point.

So, since we have what is essentially a complete, fully functional up-to-date installer, you shouldn't really be complaining.

### comment:60 Changed 12 months ago by mhertz

Paralel, I dropped my jaw reading your post there! :) Thanks alot for the kind words my friend, really appreciate that and you're way to kind there, but did make my day nonetheless! Thank you! :)

### comment:61 follow-up: ↓ 63 Changed 12 months ago by ish4d0w

Paralel: well... Yes, you are right - I should have checked it and I didn't. But since the official webpage denies the existence of a Windows installer and directs to this ticket where the last post was months old without an installer link - here I am.

I did not know that there is an installer. I didn't know it because the most likely place where I could find it simply says there isn't one and that I have to build it from packages myself so that's what I was attempting to do. It's not the fact whether this installer official or not (it should be designated official though), it's rather the fact that the website needs updating... the very least that the maintainer of the website should do is to erase the sentence seen below and/or state that there are 3rd-party installers available".

At the moment it goes like this in case you haven't seen this, Paralel: "Deluge 2.0 packages are not yet available, please see [docs] Unfortunately due to move to GTK3 and Python 3 there is no installer package currently available for Windows. Intrepid users can install Deluge from separate packages as detailed in issue #3201. [this ticket]"

I understand if the maintainer is busy. But in case he/she is that busy that they cannot update it in like 8 months then perhaps somebody else should be doing that.

I'm sorry for not discovering the installer, I fell by the false information found on the home page. I really appreciate the fact that MHertz and other Dev's took the time to finish the job - thank you to them and I'm definitely not complaining about/to them. I'm complaining about the maintainer of the webpage, that's it.

Thank you once again MHertz! Both for the installer and for the provided packages. Excellent job.

Last edited 12 months ago by ish4d0w (previous) (diff)

### comment:62 Changed 12 months ago by Doadin

I have while questionably very poorly tried to help with the windows side of things though I will also admit my python skills are very much lacking, hence unable to contribute to the limiting factor in getting a official installer. That being said and also said not trying to down play MHertz's efforts. Without knowing any details of why im sure theres probabbly a list of reasons why the, I guess one would call it a "portal python install", method MHertz has used, of distributing python apps is not the way to go and things like pyexe pyinstaller bbfreze etc etc have come to be. One reason I do know is the install being ~20% larger then needed.(As compaired myself with my build which is closer to official installer(only freezer changed rest updated) and the unofficial installer)

### comment:63 in reply to: ↑ 61 Changed 12 months ago by Paralel

Ish4d0w, in that case, I owe you an apology, I didn't realize the main page was quite that out of date. As such, I apologize. I shouldn't expect people to just find things here when they aren't directed to such.

### comment:64 Changed 12 months ago by mhertz

ish4d0w, thanks mate, appreciate that! :)

Doadin, "portal python install" is a very acurate description indeed :) Although a freezed install is the same I would say. I got bored a reducing the size after the first several 100mb's of trial and error(though mostly gtk3 stuff), so could be reduced further. After the change to py38, then the portable install should be isolated from outside pretty good too. However, I have stated several times that I don't think that the unofficial installer should be official in any way, as not done in ordinary professional fashion like Doadin stated, and has always been ment as simply something to try if wanted, in mean time, that's all, and never anything more. I hope it's clear that when I say thank you and that a post makes me happy, then it's because I am gratefull for the appreciation and nice words and not because I agree in making it official, quite the opposite actually, but I didn't see any reason to keep reiterating it, after the first several times, though honestly does makes me happy to hear, to be totally honest, but still not wise. If nothing else, then Cas and other devs shouldn't be getting bug-reports of possibly something i've myself done to screw something up, or whatever I have added or not added from other people, and as said, not a "real" installer, but a glorified manual portable source install, but just thought better than nothing, in the waiting time, which im sure we can all agree upon. Well, of-course manually installing from source yourself would be better, but I mean for people not able to do that, and e.g. there linux seedbox got updated to 2.0.x in meantime. Also, my efforts has for the vast majority been to include other peoples talented work into the unofficial installer, or googling stuff and taking bits and pieces, again from others, so please don't think that I have done something special here, and the ones who ows the real thanks is Cas, Doadin and co :)

### comment:65 Changed 12 months ago by jools772

About python >= 3.8 and deluge:

You need deluge 2.04 to fix an issue with an added argument to the logger module, and you also need to upgrade twisted to the latest version, above 20 I think, to have the same fix in twisted.

### comment:66 Changed 12 months ago by mhertz

Sorry, I'm an idiot seemingly, as forgot to say that, so thank you jools772 for elaborating. Twisted 19.7.0 and above. I use latest 20.3.0 succesfully. For deluge 2.0.3, backport from development branch into master/2.0.3: https://git.deluge-torrent.org/deluge/commit/?h=develop&id=351664ec071daa04161577c6a1c949ed0f2c3206

### comment:67 Changed 11 months ago by corhsin

The software was installed on a Windows system months ago. A question is: how can MAGNET links be successfully associated? Any advice is appreciated. TIA

### comment:68 Changed 11 months ago by jools772

Don't hijack the topic, open own issue.

### comment:69 Changed 11 months ago by corhsin

Allow me to rephrase. The 'Associate Magnet Links" button from the installation these instructions created does not function correctly. If someone had a registry file that will be implemented into the installer this thread is working on it would be appreciated.

### comment:70 Changed 11 months ago by mhertz

The magnet assoc button in deluge2 GTKUI code, looks like don't set anything if already having HKCR/magnet set, so if having that, e.g pointed to something uninstalled, then delete HKCR/magnet e.g with regedit/reg.exe, press button in GTKUI and possibly restart computer, or atleast restart browser.

If continue have issues,then different solutions in this thread here: https://forum.deluge-torrent.org/viewtopic.php?f=12&t=55037

I agree off-topic, but still much talk done on various faults found during manual source install, so hope I'm not disturbing too much here, with this posting :)

Version 0, edited 11 months ago by mhertz (next)

### comment:72 in reply to: ↑ 58 Changed 11 months ago by jezza

I didn't have py36 wheels anymore, sorry, but here's pycairo and pygobject for py37 and py38, though py37 is not newest version though: http://s000.tinyupload.com/index.php?file_id=73322123121773264450

You don't need the other wheels, as already on pypi, so only need these two.

Gtk3.24.20 zipped archive. Note I omitted the x64 folder, so omit the x64 part when following instructions from Cas to add gvsbuild to path: https://gofile.io/?c=LatBqY

If just wanting readymade deluge 2.0.3 from pypi, then just 'pip install' the two wheel's and 'deluge', though remember a libtorrent(I believe one is on pypi too, if not wanting build yourself) and runtimes installed.

Also, here's prebuilt libtorrent latest 1.2.x(1.2.6) and 1.1.x(1.1.14), which can be dropped into python's 'Lib\site-packages' folder: http://s000.tinyupload.com/index.php?file_id=00000203889311879236

Also, to avoid runtimes-install, then you can drop these two files into the bin folder of gvsbuild that you add to path: http://s000.tinyupload.com/index.php?file_id=03819964817140265822

Last, if deluge fails starting, then delete session.state file from deluge profile folder if having such, which is an old deluge bug.

pip.exe install C:\gvsbuild\release\python\pycairo-1.18.2-cp37-cp37m-win_amd64.whl
pip.exe install C:\gvsbuild\release\python\pycairo-1.19.1-cp38-cp38-win_amd64.whl
pip.exe install C:\gvsbuild\release\python\PyGObject-3.34.0-cp37-cp37m-win_amd64.whl
pip.exe install C:\gvsbuild\release\python\PyGObject-3.36.0-cp38-cp38-win_amd64.whl
pip.exe install C:\gvsbuild\release\python\Twisted-20.3.0-cp38-cp38-win_amd64.whl
pip.exe install C:\gvsbuild\release\python\setproctitle-1.1.10-cp38-cp38-win_amd64.whl


But I get this error on all of the installs.

ERROR: PyGObject-3.34.0-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.


I have installed Python 3.8 Any help would be great!

### comment:73 Changed 10 months ago by mhertz

You only need one each of pycairo and pygobject, and in your python version installed, so omit the two redundant ones(line 1 and 3 above), but however shouldn't matter in your example though, as the correct version would be installed and wrong ones erroring out, like in your report.

### comment:74 follow-ups: ↓ 75 ↓ 78 Changed 10 months ago by corhsin

Are non-programmers able to drop in newer libtorrents an option for existing installations - can someone take 1.2.6 from the zip and put it in the appropriate folder? Does anyone have a prebuilt Windows build with the latest libtorrent? Or, is someone willing to provide a condensed set of some updated compile instructions (that aren't across 70 comments)? TIA

Last edited 10 months ago by corhsin (previous) (diff)

### comment:75 in reply to: ↑ 74 Changed 10 months ago by Nekotan

Are non-programmers able to drop in newer libtorrents an option for existing installations - can someone take 1.2.6 from the zip and put it in the appropriate folder? Does anyone have a prebuilt Windows build with the latest libtorrent? Or, is someone willing to provide a condensed set of some updated compile instructions (that aren't across 70 comments)? TIA

It's mostly patience and understanding the use of a compiler, if you run into troubles, you'll probably find a patch somewhere to solve the issue.

you need the corresponding msvc compiler with python version and compile the latest openssl since libtorrent needs that.

Also the libtorrent version has to be supported by Deluge

For safety reasons I also compiled an openssl for Deluge, but that version needs to be supported by Deluge

I have a good guide on the forum you can adjust with this knowledge :)

### comment:76 in reply to: ↑ description ; follow-up: ↓ 79 Changed 10 months ago by Nekotan

With the move to a GTK3 UI we need a way to easily create the Windows package.

I am not sure what the best route is going to be but we need something that can always get the latest versions of GTK3 as we had to use outdated PyGTK versions as no other builds existed.

It would be good to drop the usage of MSVC and go with msys2 but there are hurdles to doing that with regards to Twisted and pywin32 (see #3181). These are the steps for another GTK3 project building with msys2:

The GVSbuild is better IMHO Cygwin and Mingw change too much so its best to use a stable compiler and a stable gtk version Which can be edited when problems arise

Alternatively we continue with MSVC and roll our own GTK3 builds:

We will also need to move from bbfreeze to most likely pyinstaller but that is further down the road: Freezing comparison

Help or suggestions with this would be appreciated as primary development is on Ubuntu.

### comment:77 Changed 10 months ago by corhsin

There is a large project Windows Subsystem for Linux WSL(2) for Win10. People are running Ubuntu 20 and other applications without difficulty. It might be less work than the lack of current options. Anyone familiar with it? (e. g. https://www.omgubuntu.co.uk/how-to-install-wsl2-on-windows-10 )

Last edited 10 months ago by corhsin (previous) (diff)

### comment:78 in reply to: ↑ 74 ; follow-ups: ↓ 81 ↓ 82 Changed 10 months ago by petersasi

Hi Corhsin,

Look at this topic: https://forum.deluge-torrent.org/viewtopic.php?f=12&t=55463 (Unofficial) Windows installers are availalable here: https://drive.google.com/drive/folders/1bCwij_GEy8nhqR6EynXYY_Yl7XuWYpVT

I have built them using MHerz's scripts (improved), with:

• latest deluge 2.0.4dev 38 (2.0.3 also available)
• latest libtorrent 1.2.7 (1.1.x and 1.2.3 also available, selectable during install)
• latest libboost 1.73.0
• latest openSSL 1.1.1g
• latest Python 3.8.3
• almost latest GTK 3.24.20
• several GTK themes (normal and dark) to choose from
• portable install selectable

So no need to manually drop libtorrent in place or read these 70 comments / 50+ pages of the above topic :)

Are non-programmers able to drop in newer libtorrents an option for existing installations - can someone take 1.2.6 from the zip and put it in the appropriate folder? Does anyone have a prebuilt Windows build with the latest libtorrent? Or, is someone willing to provide a condensed set of some updated compile instructions (that aren't across 70 comments)? TIA

### comment:79 in reply to: ↑ 76 ; follow-up: ↓ 83 Changed 10 months ago by petersasi

Yes, we (MHerz & I) are already building our own GTK, maybe I should put our set of scripts on github?

With the move to a GTK3 UI we need a way to easily create the Windows package.

I am not sure what the best route is going to be but we need something that can always get the latest versions of GTK3 as we had to use outdated PyGTK versions as no other builds existed.

It would be good to drop the usage of MSVC and go with msys2 but there are hurdles to doing that with regards to Twisted and pywin32 (see #3181). These are the steps for another GTK3 project building with msys2:

The GVSbuild is better IMHO Cygwin and Mingw change too much so its best to use a stable compiler and a stable gtk version Which can be edited when problems arise

Alternatively we continue with MSVC and roll our own GTK3 builds:

We will also need to move from bbfreeze to most likely pyinstaller but that is further down the road: Freezing comparison

Help or suggestions with this would be appreciated as primary development is on Ubuntu.

### comment:80 Changed 10 months ago by Nekotan

That's great progress :)

I didn't follow how far you guys have gotten :) I'm glad that there is some movement in this Now I hope the deluge devs chime in on approving this.

IMHO I think this can work as an official build in the future.

### comment:81 in reply to: ↑ 78 Changed 10 months ago by Paralel

Hi Corhsin,

Look at this topic: https://forum.deluge-torrent.org/viewtopic.php?f=12&t=55463 (Unofficial) Windows installers are availalable here: https://drive.google.com/drive/folders/1bCwij_GEy8nhqR6EynXYY_Yl7XuWYpVT

Excellent contribution! I look forward to how things progress from here.

### comment:82 in reply to: ↑ 78 Changed 10 months ago by corhsin

Awesome job!

Hi Corhsin,

Look at this topic: https://forum.deluge-torrent.org/viewtopic.php?f=12&t=55463 (Unofficial) Windows installers are availalable here: https://drive.google.com/drive/folders/1bCwij_GEy8nhqR6EynXYY_Yl7XuWYpVT

I have built them using MHerz's scripts (improved), with:

• latest deluge 2.0.4dev 38 (2.0.3 also available)
• latest libtorrent 1.2.7 (1.1.x and 1.2.3 also available, selectable during install)
• latest libboost 1.73.0
• latest openSSL 1.1.1g
• latest Python 3.8.3
• almost latest GTK 3.24.20
• several GTK themes (normal and dark) to choose from
• portable install selectable

So no need to manually drop libtorrent in place or read these 70 comments / 50+ pages of the above topic :)

Are non-programmers able to drop in newer libtorrents an option for existing installations - can someone take 1.2.6 from the zip and put it in the appropriate folder? Does anyone have a prebuilt Windows build with the latest libtorrent? Or, is someone willing to provide a condensed set of some updated compile instructions (that aren't across 70 comments)? TIA

### comment:83 in reply to: ↑ 79 Changed 9 months ago by tobbez

Yes, we (MHerz & I) are already building our own GTK, maybe I should put our set of scripts on github?

### comment:84 Changed 9 months ago by petersasi

Major update to the unofficial Windows installer here: https://drive.google.com/drive/folders/1bCwij_GEy8nhqR6EynXYY_Yl7XuWYpVT Forum: https://forum.deluge-torrent.org/viewtopic.php?f=12&t=55463

1. One third smaller installer and Installed Deluge folder through profiling of deluge, deluged, deluge-web and deluge-console using Process Monitor and removing the files not used according to the profiling.

EXCEPTIONS: .exe files; folders that have 'locale' or 'hazmat' in their name. PLEASE test and let me know if I have removed too much!!!

1. Better Windows integration through alternative loaders, courtesy of MHerz:
• Now can pin deluge on taskbar
• Shows only one deluge / deluged / deluge-web process, python[w].exe is embedded.
2. Updated LibTorrent? to 1.2.8 released 30-Jul-2020.
3. Updated to Python to version 3.8.5 released on 20-Jul-2020.
4. Portable install fix to put the deluge profile folder as well in the deluge folder in case of portable installations, courtesy of MHerz.
5. Updated te GeoIP database and added the automated GeoIP database update to the build system, courtesy of MHerz.
6. Fixed a torrentmanager.py patch in the stable deluge-build.
7. Install wheel using pip during deluge-build to avoid build warnings.
8. Removed LIBTORRENT_REVISION from the file names as it seems useless. Other installer name fixes.
9. Stopped copying the vcvarsall.bat around to make the LibTorrent? build happy using proper build commands.
10. Added up to date LibTorrent?-ChangeLog.txt, GTK-3.24-ChangeLog.txt and Python-ChangeLog.txt to the "Deluge2 Unofficial Installer for Windows" folder to make it easy for you to check what fixes are included in the new version.
11. Moved earlier releases to an Archive folder.

### comment:85 Changed 9 months ago by petersasi

• Cc peter.sasi@… removed

Major update to the unofficial Windows installer here: https://drive.google.com/drive/folders/1bCwij_GEy8nhqR6EynXYY_Yl7XuWYpVT Forum: https://forum.deluge-torrent.org/viewtopic.php?f=12&t=55463

1. One third smaller installer and Installed Deluge folder through profiling of deluge, deluged, deluge-web and deluge-console using Process Monitor and removing the files not used according to the profiling.

EXCEPTIONS: .exe files; folders that have 'locale' or 'hazmat' in their name. PLEASE test and let me know if I have removed too much!!!

1. Better Windows integration through alternative loaders, courtesy of MHerz:
• Now can pin deluge on taskbar
• Shows only one deluge / deluged / deluge-web process, python[w].exe is embedded.
2. Updated LibTorrent? to 1.2.8 released 30-Jul-2020.
3. Updated to Python to version 3.8.5 released on 20-Jul-2020.
4. Portable install fix to put the deluge profile folder as well in the deluge folder in case of portable installations, courtesy of MHerz.
5. Updated te GeoIP database and added the automated GeoIP database update to the build system, courtesy of MHerz.
6. Fixed DJLegolas's torrentmanager.py patch for the stable deluge-build.
7. Install wheel using pip during deluge-build to avoid build warnings.
8. Removed LIBTORRENT_REVISION from the file names as it seems useless. Other installer name fixes.
9. Stopped copying the vcvarsall.bat around to make the LibTorrent? build happy using proper build commands.
10. Added up to date LibTorrent?-ChangeLog.txt, GTK-3.24-ChangeLog.txt and Python-ChangeLog.txt to the "Deluge2 Unofficial Installer for Windows" folder to make it easy for you to check what fixes are included in the new version.
11. Moved earlier releases to an Archive folder.
Last edited 9 months ago by petersasi (previous) (diff)

### comment:86 Changed 9 months ago by petersasi

Today the unofficial Windows installer got updated again:

1. A Fix form MHerz for his Portability enhancement.
2. Built the latest (3.24.21) GTK with wingtk/gvsbuild.

### comment:87 Changed 9 months ago by petersasi

Today the unofficial Windows installer got updated again:

1. A Fix form MHerz for his Portability enhancement.
2. Built the latest (3.24.21) GTK with wingtk/gvsbuild.

### comment:88 Changed 9 months ago by petersasi

Hi, I have finally published the build scripts and artifacts with a brief guide: https://github.com/petersasi/deluge2-win-build

### comment:89 Changed 2 months ago by mhertz

Please forgive me for off-topic, but just wanted to add that I upped my deluge2 build-scripts on my github around 5 months ago, and just didn't announce it because wasen't ment to compete with petersasi's new maintainership, and just ment for posting my fixes if needed, but as he's busy at the moment, then I thought I might as well post a link, so if interrested people can build deluge2 with latest python 3.9.x, deps and installers, and works as of now atleast.

Again, note is not made in normal professional way, as still not possible because issues, but is just something to mess with if wanted, untill real official release emerges, using proper building techniques. -Don't blame Cas or other of the devs for my possible mistakes!

I now use the embedded python zip distribution, scripts can be run from any path/location, not needing admin rights, except initially install_components.cmd raise UAC dialog for installing msvc. All components extracted in build-dir instead of installed on system, except msvc which needs installing, but is installed into build-dir and when selecting uninstall_components.cmd, then it's uninstalled from there, so not wiping your own msvc install if having such. Because of msvc you need a few GB of space for this.

Note, I have extra deluge2 repo's for win7 and x86, which worked at one time, but I haven't bothered updating them to python 3.9.x etc, so shouldn't be tried, unless updating scripts yourself manually. Main repo is win10 x64 only.

I hope petersasi returns again to take over maintainership, or if other windows user would release installers on the forum, then would be appreciated, as don't know how long i'm gonna mess with this here more, as since said, not windows user myself.

Last, there's sometimes missing files reported or warnings, which can be disregarded, as i'm pretty lazy and sometimes don't bother make checks, or correct warnings if doesn't affect end-result anyways, so just cosmetics. If build finishes with a built product, then it did work.

Note: See TracTickets for help on using tickets.