From 2b2cb4777a6ca7842bc11495e7bcda6aa6613177 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 3 Jul 2016 18:44:50 +0530 Subject: [PATCH] check if pythonw.exe exists or run installer --- trayicon/Open Media Library.py | 6 +++--- trayicon/install.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/trayicon/Open Media Library.py b/trayicon/Open Media Library.py index 90890da..ffdc368 100644 --- a/trayicon/Open Media Library.py +++ b/trayicon/Open Media Library.py @@ -246,12 +246,12 @@ def check_pid(pidfile): def launch(sysTrayIcon=None): base = os.path.join(os.getenv('LOCALAPPDATA'), 'Open Media Library') pid = os.path.join(base, 'data', 'openmedialibrary.pid') + python = os.path.join(base, 'platform_win32', 'pythonw.exe') + oml = os.path.join(base, 'openmedialibrary') if check_pid(pid): webbrowser.open_new_tab(os.path.join(base, 'openmedialibrary', 'static', 'html', 'load.html')) #sysTrayIcon._check = Check(sysTrayIcon, pid) - elif os.path.exists(base): - python = os.path.join(base, 'platform_win32', 'pythonw.exe') - oml = os.path.join(base, 'openmedialibrary') + elif os.path.exists(python) and os.path.exists(oml): subprocess.Popen([python, 'oml', 'server', pid], cwd=oml, start_new_session=True) webbrowser.open_new_tab(os.path.join(base, 'openmedialibrary', 'static', 'html', 'load.html')) #sysTrayIcon._check = Check(sysTrayIcon, pid) diff --git a/trayicon/install.py b/trayicon/install.py index 88add76..cdda762 100644 --- a/trayicon/install.py +++ b/trayicon/install.py @@ -100,7 +100,7 @@ class Install(Thread): self.status["release"] = release self.status["progress"] = 0 platform = get_platform() - if not 'platform_win32' in release['modules']: + if 'platform_win32' not in release['modules']: release['modules']['platform_win32'] = { 'name': 'platform_win32-20160201-3-3d473b8.tar.bz2', 'version': '20160201-3-3d473b8.tar.bz2',