Changeset 5d43c2


Ignore:
Timestamp:
11/22/2012 11:19:05 PM (12 years ago)
Author:
Calum Lind <calumlind+deluge@gmail.com>
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)
Message:

Update bbfreeze and nsis scripts for win32 packaging

bbfreeze script:

  • Creates a VERSION.tmp file for use by nsis script
  • Includes all theme, icon and locale files. Closes #2096 & #2145
  • Add email.mime.multipart and email.mime.text. Closes #2074
  • deluged.exe and deluge-web.exe will no longer show a cmd window and created deluged-debug.exe and deluge-web-debug.exe as replacements if still needed
  • Overridden bbfreeze gtk recipe thus no longer requiring file editing.
  • Remove unnecessary python module includes

nsis script:

  • Deluge version now based upon bbfreeze output
  • Installer will warn if deluge already running. Closes #1217
  • Removed deluged and deluge-web shortcuts from start menu
  • Increased compression level for lzma
Location:
win32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • win32/Win32 README.txt

    r845b95 r5d43c2  
    1010== Build Steps ==
    1111
    12  1.  Build Deluge on Windows.
     12 1.  Build and Install Deluge on Windows.
    1313
    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:
    3815
    3916        python deluge-bbfreeze.py
    4017
    41     The script places the bbfreeze'd version of Deluge in
     18    The result is a bbfreeze'd version of Deluge in `build-win32/deluge-bbfreeze-build_version`.
    4219
    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`)
    4921
    5022    The result is a standalone installer in the `build-win32` directory.
    51 
    52 The Uninstaller will remove everything from the installation directory. The file
    53 association for '.torrent' will also be removed but only if it's associated with Deluge
    54 
  • win32/deluge-bbfreeze.py

    r845b95 r5d43c2  
    1 build_version = "1.3.5"
    2 python_path = "C:\\Python26\\"
     1import os, glob, sys
     2import shutil
     3import deluge.common
    34
    4 import os, glob
    5 import shutil
     5# Get build_version from installed deluge
     6build_version = deluge.common.get_version()
     7print "Deluge Version: %s" % build_version
     8python_path = os.path.dirname(sys.executable) + "\\"
     9print "Python Path: %s" % python_path
     10gtk_root = python_path + "Lib\\site-packages\\gtk-2.0\\runtime\\"
     11
     12# Copy entry scripts with new name, which represents final .exe filename
    613shutil.copy(python_path + "Scripts\deluge-script.pyw", python_path + "Scripts\deluge.py")
    714shutil.copy(python_path + "Scripts\deluge-script.pyw", python_path + "Scripts\deluge-debug.py")
    815shutil.copy(python_path + "Scripts\deluged-script.py", python_path + "Scripts\deluged.py")
     16shutil.copy(python_path + "Scripts\deluged-script.py", python_path + "Scripts\deluged-debug.py")
    917shutil.copy(python_path + "Scripts\deluge-web-script.py", python_path + "Scripts\deluge-web.py")
     18shutil.copy(python_path + "Scripts\deluge-web-script.py", python_path + "Scripts\deluge-web-debug.py")
    1019shutil.copy(python_path + "Scripts\deluge-gtk-script.pyw", python_path + "Scripts\deluge-gtk.py")
    1120shutil.copy(python_path + "Scripts\deluge-console-script.py", python_path + "Scripts\deluge-console.py")
    1221
    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
     23includes=(
     24            "libtorrent", "cairo", "pangocairo", "atk", "pango", "twisted.internet.utils",
     25            "gio", "gzip", "email.mime.multipart", "email.mime.text"
     26         )
    1427excludes=("numpy", "OpenGL", "psyco", "win32ui")
    1528
    1629dst = "..\\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.
     33import bbfreeze.recipes
     34def recipe_gtk_override(mf):
     35    return True
     36bbfreeze.recipes.recipe_gtk_and_friends = recipe_gtk_override
    1737
    1838from bbfreeze import Freezer
     
    2141f.addScript(python_path + "Scripts\deluge.py", gui_only=True)
    2242f.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)
     43f.addScript(python_path + "Scripts\deluged.py", gui_only=True)
     44f.addScript(python_path + "Scripts\deluged-debug.py", gui_only=False)
     45f.addScript(python_path + "Scripts\deluge-web.py", gui_only=True)
     46f.addScript(python_path + "Scripts\deluge-web-debug.py", gui_only=False)
    2547f.addScript(python_path + "Scripts\deluge-gtk.py", gui_only=True)
    2648f.addScript(python_path + "Scripts\deluge-console.py", gui_only=False)
     
    2951# add icons to the exe files
    3052import icon
    31 
    3253icon_path = os.path.join(os.path.dirname(__file__), "deluge.ico")
    3354icon.CopyIcons(dst+"deluge.exe", icon_path)
    3455icon.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) 
     56icon.CopyIcons(dst+"deluged.exe", icon_path)
     57icon.CopyIcons(dst+"deluged-debug.exe", icon_path)
     58icon.CopyIcons(dst+"deluge-web.exe", icon_path)
     59icon.CopyIcons(dst+"deluge-web-debug.exe", icon_path)
     60icon.CopyIcons(dst+"deluge-gtk.exe", icon_path)
     61icon.CopyIcons(dst+"deluge-console.exe", icon_path)
    3962
    4063# exclude files which are already included in GTK or Windows
    41 excludeFiles = ("MSIMG32.dll", "MSVCR90.dll", "MSVCP90.dll", "POWRPROF.dll", "DNSAPI.dll", "USP10.dll")
    42 for file in excludeFiles:
     64excludeDlls = ("MSIMG32.dll", "MSVCR90.dll", "MSVCP90.dll", "POWRPROF.dll", "DNSAPI.dll", "USP10.dll")
     65for file in excludeDlls:
    4366    for filename in glob.glob(dst + file):
    4467        print "removing file:", filename
    4568        os.remove(filename)
     69
     70# copy gtk locale files
     71gtk_locale = os.path.join(gtk_root, 'share/locale')
     72locale_include_list = ['gtk20.mo', 'locale.alias']
     73def 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        ]
     79shutil.copytree(gtk_locale, os.path.join(dst, 'share/locale'), ignore=ignored_files)
     80
     81# copy gtk theme files
     82theme_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"]
     87for 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
     99file = open('VERSION.tmp', 'w')
     100file.write("build_version = \"%s\"" % build_version)
     101file.close()
  • win32/deluge-win32-installer.nsi

    r845b95 r5d43c2  
    11# Deluge Windows installer script
    2 # Version 0.4 28-Apr-2009
     2# Version 0.6 22-Nov-2012
    33
    44# Copyright (C) 2009 by
     
    2727
    2828# Set default compressor
    29 SetCompressor lzma
     29SetCompressor  /FINAL /SOLID lzma
     30SetCompressorDictSize 64
    3031
    3132###
     
    3435
    3536# Script version; displayed when running the installer
    36 !define DELUGE_INSTALLER_VERSION "0.5"
     37!define DELUGE_INSTALLER_VERSION "0.6"
    3738
    3839# Deluge program information
    3940!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
    4146!define PROGRAM_WEB_SITE "http://deluge-torrent.org"
    4247
    43 # Python files generated with bbfreeze (without DLLs from GTK+ runtime)
     48# Python files generated with bbfreeze
    4449!define DELUGE_PYTHON_BBFREEZE_OUTPUT_DIR "..\build-win32\deluge-bbfreeze-${PROGRAM_VERSION}"
    4550
     
    9499# --- Functions ---
    95100
     101Function .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:
     108FunctionEnd
     109
    96110Function un.onUninstSuccess
    97111  HideWindow
     
    127141Section "Deluge Bittorrent Client" Section1
    128142  SectionIn RO
    129  
     143
    130144  SetOutPath $INSTDIR
    131145  File /r "${DELUGE_PYTHON_BBFREEZE_OUTPUT_DIR}\*.*"
     
    141155  CreateDirectory "$SMPROGRAMS\Deluge"
    142156  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"
    145157  CreateShortCut "$SMPROGRAMS\Deluge\Project homepage.lnk" "$INSTDIR\Homepage.url"
    146158  CreateShortCut "$SMPROGRAMS\Deluge\Uninstall Deluge.lnk" "$INSTDIR\Deluge-uninst.exe"
     
    195207Section Uninstall
    196208  RmDir /r "$INSTDIR"
    197  
     209
    198210  SetShellVarContext all
    199211  Delete "$SMPROGRAMS\Deluge\Deluge.lnk"
    200   Delete "$SMPROGRAMS\Deluge\Deluge daemon.lnk"
    201   Delete "$SMPROGRAMS\Deluge\Deluge webUI.lnk"
    202212  Delete "$SMPROGRAMS\Deluge\Uninstall Deluge.lnk"
    203213  Delete "$SMPROGRAMS\Deluge\Project homepage.lnk"
Note: See TracChangeset for help on using the changeset viewer.