Changeset 5d43c2
- Timestamp:
- 11/22/2012 11:19:05 PM (12 years ago)
- Children:
- 582c67
- Parents:
- 845b95
- git-author:
- Calum Lind <calumlind+deluge@gmail.com> (11/22/2012 10:48:32 PM)
- git-committer:
- Calum Lind <calumlind+deluge@gmail.com> (11/22/2012 11:19:05 PM)
- Location:
- win32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
win32/Win32 README.txt
r845b95 r5d43c2 10 10 == Build Steps == 11 11 12 1. Build Deluge on Windows.12 1. Build and Install Deluge on Windows. 13 13 14 2. Verify/update the Deluge version in the win32 packaging scripts. 15 16 bbfreeze script - Edit 'build_version' variable in: 17 18 win32/deluge-bbfreeze.py 19 20 NSIS script - Edit 'PROGRAM_VERSION' variable in: 21 22 win32/deluge-win32-installer.nsi 23 24 3. Modify bbfreeze program. 25 26 We want to include all the gtk libraries in the installer so that users don't 27 require a separate GTK+ installation so we need to slightly modify bbfreeze. 28 29 The modification is to add a line to bbfreeze\recipes.py, usually located here: 30 31 C:\Python26\Lib\site-packages\bbfreeze-*-py2.6-win32.egg\bbfreeze\recipes.py 32 33 Find the line containing 'def recipe_gtk_and_friends' and after it add: 34 35 return True 36 37 4. Run the bbfreeze script from the win32 directory: 14 2. Run the bbfreeze script from the win32 directory: 38 15 39 16 python deluge-bbfreeze.py 40 17 41 The script places the bbfreeze'd version of Deluge in18 The result is a bbfreeze'd version of Deluge in `build-win32/deluge-bbfreeze-build_version`. 42 19 43 build-win32/deluge-bbfreeze-build_version 44 45 Note: The assumption for this script is that Python 2.6 is installed 46 in 'C:\Python26' otherwise the 'python_path' variable should be changed. 47 48 5. Run the NSIS script (right-click and choose `Compile with NSIS`) 20 3. Run the NSIS script (right-click and choose `Compile with NSIS`) 49 21 50 22 The result is a standalone installer in the `build-win32` directory. 51 52 The Uninstaller will remove everything from the installation directory. The file53 association for '.torrent' will also be removed but only if it's associated with Deluge54 -
win32/deluge-bbfreeze.py
r845b95 r5d43c2 1 build_version = "1.3.5" 2 python_path = "C:\\Python26\\" 1 import os, glob, sys 2 import shutil 3 import deluge.common 3 4 4 import os, glob 5 import shutil 5 # Get build_version from installed deluge 6 build_version = deluge.common.get_version() 7 print "Deluge Version: %s" % build_version 8 python_path = os.path.dirname(sys.executable) + "\\" 9 print "Python Path: %s" % python_path 10 gtk_root = python_path + "Lib\\site-packages\\gtk-2.0\\runtime\\" 11 12 # Copy entry scripts with new name, which represents final .exe filename 6 13 shutil.copy(python_path + "Scripts\deluge-script.pyw", python_path + "Scripts\deluge.py") 7 14 shutil.copy(python_path + "Scripts\deluge-script.pyw", python_path + "Scripts\deluge-debug.py") 8 15 shutil.copy(python_path + "Scripts\deluged-script.py", python_path + "Scripts\deluged.py") 16 shutil.copy(python_path + "Scripts\deluged-script.py", python_path + "Scripts\deluged-debug.py") 9 17 shutil.copy(python_path + "Scripts\deluge-web-script.py", python_path + "Scripts\deluge-web.py") 18 shutil.copy(python_path + "Scripts\deluge-web-script.py", python_path + "Scripts\deluge-web-debug.py") 10 19 shutil.copy(python_path + "Scripts\deluge-gtk-script.pyw", python_path + "Scripts\deluge-gtk.py") 11 20 shutil.copy(python_path + "Scripts\deluge-console-script.py", python_path + "Scripts\deluge-console.py") 12 21 13 includes=("libtorrent", "gzip", "zipfile", "re", "socket", "struct", "cairo", "pangocairo", "atk", "pango", "twisted.internet.utils", "gio", "gtk.glade", "email.mime") 22 # Include python modules not picked up automatically by bbfreeze 23 includes=( 24 "libtorrent", "cairo", "pangocairo", "atk", "pango", "twisted.internet.utils", 25 "gio", "gzip", "email.mime.multipart", "email.mime.text" 26 ) 14 27 excludes=("numpy", "OpenGL", "psyco", "win32ui") 15 28 16 29 dst = "..\\build-win32\\deluge-bbfreeze-" + build_version + "\\" 30 31 # Need to override bbfreeze function so that it includes all gtk libraries 32 # in the installer so users don't require a separate GTK+ installation. 33 import bbfreeze.recipes 34 def recipe_gtk_override(mf): 35 return True 36 bbfreeze.recipes.recipe_gtk_and_friends = recipe_gtk_override 17 37 18 38 from bbfreeze import Freezer … … 21 41 f.addScript(python_path + "Scripts\deluge.py", gui_only=True) 22 42 f.addScript(python_path + "Scripts\deluge-debug.py", gui_only=False) 23 f.addScript(python_path + "Scripts\deluged.py", gui_only=False) 24 f.addScript(python_path + "Scripts\deluge-web.py", gui_only=False) 43 f.addScript(python_path + "Scripts\deluged.py", gui_only=True) 44 f.addScript(python_path + "Scripts\deluged-debug.py", gui_only=False) 45 f.addScript(python_path + "Scripts\deluge-web.py", gui_only=True) 46 f.addScript(python_path + "Scripts\deluge-web-debug.py", gui_only=False) 25 47 f.addScript(python_path + "Scripts\deluge-gtk.py", gui_only=True) 26 48 f.addScript(python_path + "Scripts\deluge-console.py", gui_only=False) … … 29 51 # add icons to the exe files 30 52 import icon 31 32 53 icon_path = os.path.join(os.path.dirname(__file__), "deluge.ico") 33 54 icon.CopyIcons(dst+"deluge.exe", icon_path) 34 55 icon.CopyIcons(dst+"deluge-debug.exe", icon_path) 35 icon.CopyIcons(dst+"deluged.exe", icon_path) 36 icon.CopyIcons(dst+"deluge-web.exe", icon_path) 37 icon.CopyIcons(dst+"deluge-gtk.exe", icon_path) 38 icon.CopyIcons(dst+"deluge-console.exe", icon_path) 56 icon.CopyIcons(dst+"deluged.exe", icon_path) 57 icon.CopyIcons(dst+"deluged-debug.exe", icon_path) 58 icon.CopyIcons(dst+"deluge-web.exe", icon_path) 59 icon.CopyIcons(dst+"deluge-web-debug.exe", icon_path) 60 icon.CopyIcons(dst+"deluge-gtk.exe", icon_path) 61 icon.CopyIcons(dst+"deluge-console.exe", icon_path) 39 62 40 63 # exclude files which are already included in GTK or Windows 41 exclude Files = ("MSIMG32.dll", "MSVCR90.dll", "MSVCP90.dll", "POWRPROF.dll", "DNSAPI.dll", "USP10.dll")42 for file in exclude Files:64 excludeDlls = ("MSIMG32.dll", "MSVCR90.dll", "MSVCP90.dll", "POWRPROF.dll", "DNSAPI.dll", "USP10.dll") 65 for file in excludeDlls: 43 66 for filename in glob.glob(dst + file): 44 67 print "removing file:", filename 45 68 os.remove(filename) 69 70 # copy gtk locale files 71 gtk_locale = os.path.join(gtk_root, 'share/locale') 72 locale_include_list = ['gtk20.mo', 'locale.alias'] 73 def ignored_files(adir,filenames): 74 return [ 75 filename for filename in filenames 76 if not os.path.isdir(os.path.join(adir, filename)) 77 and filename not in locale_include_list 78 ] 79 shutil.copytree(gtk_locale, os.path.join(dst, 'share/locale'), ignore=ignored_files) 80 81 # copy gtk theme files 82 theme_include_list = [ 83 "share/icons/hicolor/index.theme", 84 "lib/gtk-2.0/2.10.0/engines", 85 "share/themes/MS-Windows", 86 "etc/gtk-2.0/gtkrc"] 87 for path in theme_include_list: 88 full_path = os.path.join(gtk_root, path) 89 if os.path.isdir(full_path): 90 shutil.copytree(full_path, os.path.join(dst, path)) 91 else: 92 dst_dir = os.path.join(dst, os.path.dirname(path)) 93 try: 94 os.makedirs(dst_dir) 95 except: 96 pass 97 shutil.copy(full_path, dst_dir) 98 99 file = open('VERSION.tmp', 'w') 100 file.write("build_version = \"%s\"" % build_version) 101 file.close() -
win32/deluge-win32-installer.nsi
r845b95 r5d43c2 1 1 # Deluge Windows installer script 2 # Version 0. 4 28-Apr-20092 # Version 0.6 22-Nov-2012 3 3 4 4 # Copyright (C) 2009 by … … 27 27 28 28 # Set default compressor 29 SetCompressor lzma 29 SetCompressor /FINAL /SOLID lzma 30 SetCompressorDictSize 64 30 31 31 32 ### … … 34 35 35 36 # Script version; displayed when running the installer 36 !define DELUGE_INSTALLER_VERSION "0. 5"37 !define DELUGE_INSTALLER_VERSION "0.6" 37 38 38 39 # Deluge program information 39 40 !define PROGRAM_NAME "Deluge" 40 !define PROGRAM_VERSION "1.3.5" 41 # Deluge program information 42 !searchparse /file VERSION.tmp `build_version = "` PROGRAM_VERSION `"` 43 !ifndef PROGRAM_VERSION 44 !error "Program Version Undefined" 45 !endif 41 46 !define PROGRAM_WEB_SITE "http://deluge-torrent.org" 42 47 43 # Python files generated with bbfreeze (without DLLs from GTK+ runtime)48 # Python files generated with bbfreeze 44 49 !define DELUGE_PYTHON_BBFREEZE_OUTPUT_DIR "..\build-win32\deluge-bbfreeze-${PROGRAM_VERSION}" 45 50 … … 94 99 # --- Functions --- 95 100 101 Function .onInit 102 System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "deluge") i .R0' 103 IntCmp $R0 0 notRunning 104 System::Call 'kernel32::CloseHandle(i $R0)' 105 MessageBox MB_OK|MB_ICONEXCLAMATION "Deluge is running. Please close it first" /SD IDOK 106 Abort 107 notRunning: 108 FunctionEnd 109 96 110 Function un.onUninstSuccess 97 111 HideWindow … … 127 141 Section "Deluge Bittorrent Client" Section1 128 142 SectionIn RO 129 143 130 144 SetOutPath $INSTDIR 131 145 File /r "${DELUGE_PYTHON_BBFREEZE_OUTPUT_DIR}\*.*" … … 141 155 CreateDirectory "$SMPROGRAMS\Deluge" 142 156 CreateShortCut "$SMPROGRAMS\Deluge\Deluge.lnk" "$INSTDIR\deluge.exe" 143 CreateShortCut "$SMPROGRAMS\Deluge\Deluge daemon.lnk" "$INSTDIR\deluged.exe"144 CreateShortCut "$SMPROGRAMS\Deluge\Deluge webUI.lnk" "$INSTDIR\deluge-web.exe"145 157 CreateShortCut "$SMPROGRAMS\Deluge\Project homepage.lnk" "$INSTDIR\Homepage.url" 146 158 CreateShortCut "$SMPROGRAMS\Deluge\Uninstall Deluge.lnk" "$INSTDIR\Deluge-uninst.exe" … … 195 207 Section Uninstall 196 208 RmDir /r "$INSTDIR" 197 209 198 210 SetShellVarContext all 199 211 Delete "$SMPROGRAMS\Deluge\Deluge.lnk" 200 Delete "$SMPROGRAMS\Deluge\Deluge daemon.lnk"201 Delete "$SMPROGRAMS\Deluge\Deluge webUI.lnk"202 212 Delete "$SMPROGRAMS\Deluge\Uninstall Deluge.lnk" 203 213 Delete "$SMPROGRAMS\Deluge\Project homepage.lnk"
Note:
See TracChangeset
for help on using the changeset viewer.