*OLD-THREAD - SEE NEW* [Unofficial] Deluge 2.0.x installer

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

Re: [Unofficial] Deluge 2.0.x installer

Postby mhertz » Tue Aug 11, 2020 4:48 pm

Yes, it's because my patch to 'INSTALL-DIR\Lib\site-packages\deluge\log.py' wasen't applied I see.

The hacked version of autoremoveplus from tote94 I posted earlier, works btw, but it is in zip format, so needs extracting first. All files I upload from now on are zipped, because e.g. cmd files etc gives stupid warnings about comming from the net upon each run if not disabling that warning, so hence I zip to avoid that(and which now always is done as I got tired of all the "manual labor" lol of uploading, so instead now made a "send-to" batchfile which zip's up whatever file(s)/folder(s) I select/righclick, uploads to gofile.io, deletes zip again and copies download-link to clipboard, so I can just ctrl+v it into post here ;) )

Edit: @petersasi, you just forgot to change my line to your setup I see(with all your work done), where we have path differences, specifically the letter '2'.

Bobby
Member
Member
Posts: 16
Joined: Wed Aug 05, 2020 7:37 pm

Re: [Unofficial] Deluge 2.0.x installer

Postby Bobby » Tue Aug 11, 2020 5:34 pm

petersasi I'm sorry my posts throw so much confusion.

Ok I found out what was wrong, it was because I ran the program standalone and not "thin client" mode after I changed it to "thin client" then it worked again. I also tend to run it that way but after I downloaded the new version I deleted my entire "appdata" folder.

Now its time to give back the thread to Mr Petersasi wich btw is doing a stunning job in keep making new updates.

petersasi
Leecher
Leecher
Posts: 80
Joined: Sun Nov 17, 2019 8:09 am

Re: [Unofficial] Deluge 2.0.x installer

Postby petersasi » Wed Aug 12, 2020 6:48 am

Will add these back to the installer too, and release again later tonight.
mhertz wrote:

Code: Select all

INSTALL-DIR\Lib\xml\etree\ElementPath.py
INSTALL-DIR\Lib\xml\etree\ElementTree.py

https://gofile.io/d/Jk5SKD

mhertz
Compulsive Poster
Compulsive Poster
Posts: 828
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Unofficial] Deluge 2.0.x installer

Postby mhertz » Wed Aug 12, 2020 8:39 am

Cool, remmber the previously mentioned logging.patch fix also, while add it.

petersasi
Leecher
Leecher
Posts: 80
Joined: Sun Nov 17, 2019 8:09 am

Re: [Unofficial] Deluge 2.0.x installer

Postby petersasi » Wed Aug 12, 2020 11:23 am

That is already applied in the last release AFAIR.

mhertz wrote:Cool, remmber the previously mentioned logging.patch fix also, while add it.

mhertz
Compulsive Poster
Compulsive Poster
Posts: 828
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Unofficial] Deluge 2.0.x installer

Postby mhertz » Wed Aug 12, 2020 11:30 am

No, and that was why Bobby couldn't enable the autoremoveplus vanilla plugin, so if you read first and last line of my top-post on this page, then that is what i'm reffering to ;) (I know he said otherwise later, but that was the issue nonetheless regarding the vanilla plugin - the other issue with the modded plugin, must be because of forgetting extract it first before use(which was exactly what I did myself in the first try when testing it out initially after seeing that report lol), or otherwise doing something incorrectly, as thinclient vs classic mode usage in itself makes no difference on that, but the other previously mentioned things do however, as I confirmed through testing).

Sorry if beeing somewhat confusing at times :) (Also, unrelated but just in case, yarss2 have no logging issues, never did, and just had missing files isues, curtesy of nice reportings by Bobby)

petersasi
Leecher
Leecher
Posts: 80
Joined: Sun Nov 17, 2019 8:09 am

Re: [Unofficial] Deluge 2.0.x installer

Postby petersasi » Thu Aug 13, 2020 2:53 am

In the meantime, I figured what was wrong in the patch, you wrote:
If wanting to add this, then copy/paste in following new line e.g. just before the pycairo dll patch line, in both deluge build scripts(stable+dev):
Code: Select all
patch "%programfiles%/Deluge2/Lib/site-packages/deluge/log.py" < logging.patch

And I did just that. Must have been tired, note 2 still there in the deluge folder name :facepalm: ...

So I have fixed that and also added

Code: Select all

|| @call lib\printc error "Patching failed" && exit /B 1
to all my patching lines in both of the scrips (soon to be merged too). This way it will bail out of the build with an error if any of them goes wrong.

Building a new release soon.

mhertz wrote:Cool, remmber the previously mentioned logging.patch fix also, while add it.

mhertz
Compulsive Poster
Compulsive Poster
Posts: 828
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Unofficial] Deluge 2.0.x installer

Postby mhertz » Fri Aug 14, 2020 6:20 pm

Sorry, very last thing, promise... :)

I thought that deluge2 from this installer would be perfectly isolated from outside, just like as if from a freezed official installer, and that is for the most part correct, but however just stumbled upon something online which nagged me alittle, and so I fired up my win10 VM and tested some scenarious out, and yeah, there where an issue concerning this installer also, and so after some trial and error with various solutions, then came up with a fix, so to fix that last part and make deluge fully isolated like a "real" installer, then if petersasi sees fit, then please add following when making next installer and of-course first adjust to your own setup with regards to changed stuff like var names etc. Ohh, should go before the makensis line(s) in the files:

installer-stable.cmd:

Code: Select all

C:\msys64\usr\bin\echo -e "Lib\nDLLs\nimport site" > %var1%\python38._pth

installer-dev.cmd:

Code: Select all

C:\msys64\usr\bin\echo -e "Lib\nDLLs\nimport site" > %var2%\python38._pth

installer-both.cmd:

Code: Select all

C:\msys64\usr\bin\echo -e "Lib\nDLLs\nimport site" | C:\msys64\usr\bin\tee %var1%\python38._pth %var2%\python38._pth


The issue can be tested with opening a cmd window in deluge folder and running:

Code: Select all

set PYTHONHOME='
deluge.exe

That won't work as deluge doesn't start, but with the fix applied, it does.

That's because some apps(IDEs) like pycharm etc, sets variables like PYTHONHOME, and those is read even by deluge in this installer, which I thought it didn't, and hence can lead to problematic issues. The above test sets PYTHONHOME to invalid non-existing path, which makes deluge fail to start, proving that deluge does read and respect that value in this installer, unfortunetly, but with the fix in-place it ignores that and all other values and runs fully isolated/self-contained.

Just wanted to add that, as kinda important. Sorry for not noticing before btw. Normally it's stated that these PYTHONHOME/PYTHONDATA etc vars doesn't need to be set(as e.g. if non-existing then just uses standard directory structure from current folder/python.exe placement), and only a few apps sets them, so not that prevailant issue, but nonetheless, better fully safe than sorry, or how the saying goes :)

Edit: Probably fits better directly in deluge build-scripts upon second thought.

Edit2: Most logical thing would be to instead simply add a new static python38._pth file under 'C:\deluge2\overlay', which gets copied in place when needed by already existing code, but your call of-course(but would need deluge-rebuild too then, and not only installer-rebuild, for getting included, though you need do that anyway for logging fix and missing files fix etc, so no problem here).

petersasi
Leecher
Leecher
Posts: 80
Joined: Sun Nov 17, 2019 8:09 am

Re: [Unofficial] Deluge 2.0.x installer

Postby petersasi » Sat Aug 15, 2020 12:49 pm

Thanks for this MHerz, I will incorporate it into the next build. One question: why is creating this tar.gz of the GTK build necessary in gvsbuild.cmd?

Code: Select all

tar -zcf gvsbuild-vs%VS_VER%-%PLATFORM%-%PYTHONVER%.tar.gz -C c:/gtk-build/gtk/x64 release

To me it seems it just gets deleted afterwards with the folder...

mhertz
Compulsive Poster
Compulsive Poster
Posts: 828
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Unofficial] Deluge 2.0.x installer

Postby mhertz » Sat Aug 15, 2020 2:26 pm

Lol, honestly i'm not very good with gvsbuild, and most of it came from borrowing lines from Cas's gvsbuild fork and doadin's gvsbuild batchfile, so i'm inclined to agree with your confusion :) Deletion indeed seems appropriate, as since you say it's deleted anyways in current setup - I added the deletion step specifically to start fresh, but then missed the redundant line you catched here.

Btw, I had another thought, totally unrelated, but just thought I might as well throw out there while posting anyways. I will not make a patch for this to send you, as not working on this project here actively anymore, but I was thinking that instead of downloading latest python and installing and uninstalling upon each job of all the install scripts, then if this was still my project then I would change it over to instead download/use the much smaller embedded distribution, which is an isolated minimal python environment to include with your windows app(curl/bsdtar pipe https://www.python.org/ftp/python/3.8.5 ... -amd64.zip to C:\python - 7z(a).exe doesn't support extracting zip from pipe btw, as needed header at end, but bsdtar does, already in default msys64 setup), which is blazing fast to download and unpack(under 8 MiB archive, where most of it's content also is zipped inside, i.e its standard lib), so instant extraction i.e. under 5 secs for both download and extraction in my quick tests), and then use that for each project and simply delete when finished. This also would help people which have python already installed locally, to not interfere with that e.g avoid current situation of there local python getting wiped after a build-script finishes. Lastly, avoids the need of running with admin rights for all build-scripts additionally, as last benefit. Note, embedded archive misses pip, so would need install pip first with "curl https://bootstrap.pypa.io/get-pip.py | python", and before that line would need uncommenting first "import site" in 'python38._pth', through 'sed' or whatever scriptable tool. Then also the patching lines would need a quick change in the deluge-build scripts and that's pretty much it, mostly. (The embedded python zip is a little bit of a mess with all those PYDs in main folder, but can be made like original python to e.g. have a DLLs folder with them instead, so as to not polutte main dir with all those - that just needs a single extra line added named 'DLLs' under ''python38._pth', though an official windows deluge installer would also have all the needed PYDs in main folder however, so personal choise)

Anyway just a quick thought to might as well throw out there additionally, while anyway replying to direct question asked, for a possible feature idea/suggestion to you, before going back under my rock again :)

Edit: Not that I'm gonna use it for anything lol, but I've almost finished transferring all my own build-scripts over, as had some free time and just "felt like it" lol :) Some things are missing I found in embedded python distribution, compared to full install, like certain headers needed during libtorrent buildings and whatnot, plus for correct gtk building etc, so I changed over to a "nuget" package version of python for that, which I stumbled over, which can be downloaded, unzipped and used portable, just like the embedded distro, so still much quicker and more isolated plus no admin rights needed and then I just use embedded distro for the actual deluge builds but not the components. It was a bigger job than I first thought lol, took much of the afternoon today in total, with so many lines to change, and debugging some pitfalls throughout, and anyway, there's no idea imho in posting patch for this, if interested, because our scripts vary already to much with your changes made, so wouldn't apply properly anyhow, but if interested at any time then give me a shout and I'll send you my scripts for Inspiration to you, to work after - also, I cannot even make patch as thought I had scripts backed up, before I started changing them directly, but didnt(well, I do, but only much older versions), so only have the changed almost finished new scripts now(though could get them back with some quick copy/pasting jobs, and quick edits done, to be able to make patches, but don't really wanna bother since as said will properly not apply on your end anyway and maybe you don't even deem it something you wanna mess with in first place either.
Last edited by mhertz on Sun Aug 16, 2020 11:22 pm, edited 9 times in total.


Return to “Windows OS”

Who is online

Users browsing this forum: No registered users and 2 guests