Pretty much same as stable deluge, just using other branch for building i.e. develop vs master(master branch points to latest stable version).
My batch file does following:
Downloads latest available python 3.7.x available at current time and installs it.
Installs all deps and deluge with pip and for deluge then pip is just pointed at develop git branch instead of master branch for stable deluge. This needs obviously git installed, and I had to run it in batchfile from cygwin instead of cmd, because gave error when run from cmd(patch from cygwin didn't have such behaviour, so use cmd to run that).
Just in case deletes any possible deluge left-over folder if available in my cygwin homedir, and then from cygwin clones deluge's git-develop branch, which is the default branch, so no need to specify branch there. Again I do it in batch file from cygwin as git fails when run from cmd. Just install git for windows and change batchfile to just run 'git clone xxxx' and find patch from gnuwin32 or something - possibly you can use 'git apply' from git for windows, instead of patch(I checked before in it's docs it supports local files also, and not just git-repo's, and same flags too, but I anyway had cygwin installed, so I could start VM headless from command-line in linux and ssh into and run commands - I know win10 also has ssh server now, but prefered cygwin for linux terminal and vi, grep, sed, patch, diff etc.).
CD into cloned folder and run some commands to get develop-version-number into variable so as to know what to name the finished folder as, after everything is finished and copied over to where built releases are stored, but you don't need that i'd say - I just use that also from script when building installers later on so they are also named and listing correct version number there.
Command run to build plugins only, as they are missing from previous deluge install because some bug. Then build plugins are copied over to built deluge and the clone just made/built for plugins are deleted again.
Patches applied and deluge exe's are moved out of Scripts folder and into deluge main folder. Scripts folder deleted as useless now and then all exe's patched twise to fix bug with calling python.exe instead of pythonw.exe and deleting path to that, so it's not referencing deluge2 folder under %programfiles% anymore, but just "pythonw.exe", so can be used in an installer now and distributed(though needs my pth file which in addition to add to PATH then also changes current dir to the deluge dir, as else you'd need to CD to deluge dir first to run deluge and a shortcut wouldn't work, but does with this in place).
Contents of overlay folder are copied into deluge folder, so gtk3, libtorrent, openssl, runtimes and PATH/cd pth hack etc are in place propperly.
Unused crap deleted.
Old built deluge folder is deleted from it's stored place and new built deluge is copied over instead and named after it's version-release.
Python and deluge is uninstalled again from it's original place under %programfiles% and it's left-over folder there also deleted afterwards, and initially downloaded python installer deleted.
That should be it
