check if pythonw.exe exists or run installer
This commit is contained in:
parent
93f7d415a0
commit
2b2cb4777a
2 changed files with 4 additions and 4 deletions
|
@ -246,12 +246,12 @@ def check_pid(pidfile):
|
||||||
def launch(sysTrayIcon=None):
|
def launch(sysTrayIcon=None):
|
||||||
base = os.path.join(os.getenv('LOCALAPPDATA'), 'Open Media Library')
|
base = os.path.join(os.getenv('LOCALAPPDATA'), 'Open Media Library')
|
||||||
pid = os.path.join(base, 'data', 'openmedialibrary.pid')
|
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):
|
if check_pid(pid):
|
||||||
webbrowser.open_new_tab(os.path.join(base, 'openmedialibrary', 'static', 'html', 'load.html'))
|
webbrowser.open_new_tab(os.path.join(base, 'openmedialibrary', 'static', 'html', 'load.html'))
|
||||||
#sysTrayIcon._check = Check(sysTrayIcon, pid)
|
#sysTrayIcon._check = Check(sysTrayIcon, pid)
|
||||||
elif os.path.exists(base):
|
elif os.path.exists(python) and os.path.exists(oml):
|
||||||
python = os.path.join(base, 'platform_win32', 'pythonw.exe')
|
|
||||||
oml = os.path.join(base, 'openmedialibrary')
|
|
||||||
subprocess.Popen([python, 'oml', 'server', pid], cwd=oml, start_new_session=True)
|
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'))
|
webbrowser.open_new_tab(os.path.join(base, 'openmedialibrary', 'static', 'html', 'load.html'))
|
||||||
#sysTrayIcon._check = Check(sysTrayIcon, pid)
|
#sysTrayIcon._check = Check(sysTrayIcon, pid)
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Install(Thread):
|
||||||
self.status["release"] = release
|
self.status["release"] = release
|
||||||
self.status["progress"] = 0
|
self.status["progress"] = 0
|
||||||
platform = get_platform()
|
platform = get_platform()
|
||||||
if not 'platform_win32' in release['modules']:
|
if 'platform_win32' not in release['modules']:
|
||||||
release['modules']['platform_win32'] = {
|
release['modules']['platform_win32'] = {
|
||||||
'name': 'platform_win32-20160201-3-3d473b8.tar.bz2',
|
'name': 'platform_win32-20160201-3-3d473b8.tar.bz2',
|
||||||
'version': '20160201-3-3d473b8.tar.bz2',
|
'version': '20160201-3-3d473b8.tar.bz2',
|
||||||
|
|
Loading…
Reference in a new issue