From 6e8f667daa15052633faa12a3f853633b0563e7a Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Tue, 1 Oct 2019 18:24:33 +0100 Subject: [PATCH] Fixes for Sparkle & WinSparkle updating --- EDMarketConnector.manifest | 17 +++++++++-------- EDMarketConnector.wxs | 4 ++-- README.md | 2 +- setup.py | 10 +++++++++- update.py | 8 ++++---- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/EDMarketConnector.manifest b/EDMarketConnector.manifest index b6bc6966..2985bbfa 100644 --- a/EDMarketConnector.manifest +++ b/EDMarketConnector.manifest @@ -7,20 +7,21 @@ + + + + + + + + + true - - - diff --git a/EDMarketConnector.wxs b/EDMarketConnector.wxs index 50890764..5814b914 100644 --- a/EDMarketConnector.wxs +++ b/EDMarketConnector.wxs @@ -167,8 +167,8 @@ - - + + diff --git a/README.md b/README.md index d2377343..86224c75 100644 --- a/README.md +++ b/README.md @@ -326,7 +326,7 @@ Mac: Windows: -* requires py2exe 0.9.3.2 +* requires py2exe 0.9.3.2 (currently unreleased - build from [source](https://github.com/albertosottile/py2exe)) * winsparkle.dll & .pdb from [WinSparkle](https://github.com/vslavik/winsparkle) copied to the current directory * [WiX Toolset](http://wixtoolset.org/) * Run `setup.py py2exe` diff --git a/setup.py b/setup.py index 6df7975d..c26dbb8b 100755 --- a/setup.py +++ b/setup.py @@ -66,7 +66,15 @@ if sys.platform=='darwin': OPTIONS = { 'py2app': {'dist_dir': dist_dir, 'optimize': 2, - 'packages': [ 'requests', 'keyring.backends' ], + 'packages': [ + 'requests', + 'keyring.backends', + 'sqlite3', # Included for plugins + ], + 'includes': [ + 'shutil', # Included for plugins + 'zipfile', # Included for plugins + ], 'frameworks': [ 'Sparkle.framework' ], 'excludes': [ 'distutils', '_markerlib', 'PIL', 'pkg_resources', 'simplejson', 'unittest' ], 'iconfile': '%s.icns' % APPNAME, diff --git a/update.py b/update.py index 968de1fc..2844fc70 100644 --- a/update.py +++ b/update.py @@ -3,6 +3,7 @@ from os.path import dirname, join import sys from time import time import threading +from traceback import print_exc # ensure registry is set up on Windows before we start from config import appname, appversion, update_feed, update_interval, config @@ -50,10 +51,11 @@ elif sys.platform=='darwin': def __init__(self, master): try: - objc.loadBundle('Sparkle', globals(), join(dirname(sys.executable.decode(sys.getfilesystemencoding())), os.pardir, 'Frameworks', 'Sparkle.framework')) + objc.loadBundle('Sparkle', globals(), join(dirname(sys.executable), os.pardir, 'Frameworks', 'Sparkle.framework')) self.updater = SUUpdater.sharedUpdater() except: # can't load framework - not frozen or not included in app bundle? + print_exc() self.updater = None def checkForUpdates(self): @@ -82,7 +84,7 @@ elif sys.platform=='win32': try: sys.frozen # don't want to try updating python.exe self.updater = ctypes.cdll.WinSparkle - self.updater.win_sparkle_set_appcast_url(update_feed) # py2exe won't let us embed this in resources + self.updater.win_sparkle_set_appcast_url(update_feed.encode()) # py2exe won't let us embed this in resources # set up shutdown callback global root @@ -90,11 +92,9 @@ elif sys.platform=='win32': self.callback_t = ctypes.CFUNCTYPE(None) # keep reference self.callback_fn = self.callback_t(shutdown_request) self.updater.win_sparkle_set_shutdown_request_callback(self.callback_fn) - self.updater.win_sparkle_init() except: - from traceback import print_exc print_exc() self.updater = None