From 954c0e2d4d4193778f93172aa3e5a197a172d52d Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 4 Mar 2012 16:41:13 -0800 Subject: [PATCH] Change some of the win32 build/installer scripts to support bundling GTK in with the installer --- win32/Win32 README.txt | 24 +++++----------------- win32/deluge-bbfreeze.py | 2 +- win32/deluge-win32-installer.nsi | 35 +------------------------------- 3 files changed, 7 insertions(+), 54 deletions(-) diff --git a/win32/Win32 README.txt b/win32/Win32 README.txt index 183038218..30072bdf9 100644 --- a/win32/Win32 README.txt +++ b/win32/Win32 README.txt @@ -18,25 +18,11 @@ The GTK+ runtime libraries are installed separately (anywhere, in the Windows PA C:\Python26\Lib\site-packages\bbfreeze-0.96.5-py2.6-win32.egg\bbfreeze\recipes.py - Right after the 'prefixes' part of the Python function 'recipe_gtk_and_friends': - - # Exclude DLL files in the GTK+ runtime bin dir. - # The GTK+ runtime must be in the PATH or copied to the application dir, - # so there is no point in including these DLLs with the bbfreeze output. - # - prefixes2 = ["iconv", "intl", "zlib1", "libpng12", "libatk", "libcairo", "libfont", "libfree", "libtiff", "libgio"] - - for p in prefixes2: - if x.identifier.startswith(p): - print "SKIPPING:", x - x.__class__ = ExcludedModule - retval = True - break - - The purpose is to avoid that bbfreeze copies DLLs from the GTK+ runtime bin directory. - Bbfreeze only copies a subset of the necessary DLLs (for some reason?). The cleanest - solution is to have the GTK+ runtime in a separate dir. - + Right at the top of the Python function 'recipe_gtk_and_friends': + return True + + We want to include all the gtk libraries in the installer so that users don't + require a separate GTK+ installation. 3) Edit the 'build_version' variable in the Python script: diff --git a/win32/deluge-bbfreeze.py b/win32/deluge-bbfreeze.py index 0359bb706..a1c73afb0 100644 --- a/win32/deluge-bbfreeze.py +++ b/win32/deluge-bbfreeze.py @@ -38,7 +38,7 @@ icon.CopyIcons(dst+"deluge-gtk.exe", icon_path) icon.CopyIcons(dst+"deluge-console.exe", icon_path) # exclude files which are already included in GTK or Windows -excludeFiles = ("MSIMG32.dll", "MSVCR90.dll", "MSVCP90.dll", "POWRPROF.dll", "freetype*.dll", "iconv.dll", "intl.dll", "libatk*.dll", "libcairo*.dll", "libexpat*.dll", "libfontconfig*.dll", "libfreetype*.dll", "libgio*.dll", "libpng*.dll", "libtiff*.dll", "zlib1.dll") +excludeFiles = ("MSIMG32.dll", "MSVCR90.dll", "MSVCP90.dll", "POWRPROF.dll") for file in excludeFiles: for filename in glob.glob(dst + file): print "removing file:", filename diff --git a/win32/deluge-win32-installer.nsi b/win32/deluge-win32-installer.nsi index 7a27c8250..b8e9e5e54 100644 --- a/win32/deluge-win32-installer.nsi +++ b/win32/deluge-win32-installer.nsi @@ -33,7 +33,7 @@ SetCompressor lzma ### # Script version; displayed when running the installer -!define DELUGE_INSTALLER_VERSION "0.4" +!define DELUGE_INSTALLER_VERSION "0.5" # Deluge program information !define PROGRAM_NAME "Deluge" @@ -43,10 +43,6 @@ SetCompressor lzma # Python files generated with bbfreeze (without DLLs from GTK+ runtime) !define DELUGE_PYTHON_BBFREEZE_OUTPUT_DIR "..\build-win32\deluge-bbfreeze-${PROGRAM_VERSION}" -# Installer for GTK+ 2.12 runtime; will be downloaded from deluge-torrent.org -!define DELUGE_GTK_DEPENDENCY "gtk2-runtime-2.16.6-2010-05-12-ash.exe" - - # --- Interface settings --- # Modern User Interface 2 @@ -182,44 +178,15 @@ Section "Create magnet uri link association for Deluge" Section3 WriteRegStr HKCR "magnet\shell\open\command" "" '"$INSTDIR\deluge.exe" "%1"' SectionEnd -# Install GTK+ 2.16 -Section "GTK+ 2.16 runtime" Section4 - GTK_install_start: - MessageBox MB_OK "You will now download and run the installer for the GTK+ 2.16 runtime. \ - You must be connected to the internet before you press the OK button. \ - The GTK+ runtime can be installed in any location, \ - because the GTK+ installer adds the location to the global PATH variable. \ - Please note that the GTK+ 2.16 runtime is not removed by the Deluge uninstaller. \ - You must use the GTK+ 2.16 uninstaller if you want to remove it together with Deluge." - - # Download GTK+ installer to TEMP dir - NSISdl::download http://download.deluge-torrent.org/windows/deps/${DELUGE_GTK_DEPENDENCY} "$TEMP\${DELUGE_GTK_DEPENDENCY}" - - # Get return value (success, cancel, or string describing the network error) - Pop $2 - StrCmp $2 "success" 0 GTK_download_error - - ExecWait '"$TEMP\${DELUGE_GTK_DEPENDENCY}" /compatdlls=yes' - Goto GTK_install_exit - - GTK_download_error: - MessageBox MB_ICONEXCLAMATION|MB_OK "Download of GTK+ 2.16 installer failed (return code: $2). \ - You must install the GTK+ 2.16 runtime manually, or Deluge will fail to run on your system." - - GTK_install_exit: -SectionEnd LangString DESC_Section1 ${LANG_ENGLISH} "Install Deluge Bittorrent client." LangString DESC_Section2 ${LANG_ENGLISH} "Select this option unless you have another torrent client which you want to use for opening .torrent files." LangString DESC_Section3 ${LANG_ENGLISH} "Select this option to have Deluge handle magnet links." -LangString DESC_Section4 ${LANG_ENGLISH} "Download and install the GTK+ 2.16 runtime. \ - This is skipped automatically if GTK+ is already installed." !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1) !insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2) !insertmacro MUI_DESCRIPTION_TEXT ${Section3} $(DESC_Section3) - !insertmacro MUI_DESCRIPTION_TEXT ${Section4} $(DESC_Section4) !insertmacro MUI_FUNCTION_DESCRIPTION_END