mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Possible fix for restarting on windows home not working
This commit is contained in:
parent
8e510d3290
commit
a6379abb17
@ -402,6 +402,7 @@ def run_gui(opts, args, listener, app, gui_debug=None):
|
|||||||
prints('Restarting with:', app)
|
prints('Restarting with:', app)
|
||||||
subprocess.Popen('sleep 3s; open ' + shellquote(app), shell=True)
|
subprocess.Popen('sleep 3s; open ' + shellquote(app), shell=True)
|
||||||
else:
|
else:
|
||||||
|
os.environ[b'CALIBRE_RESTARTING_FROM_GUI'] = b'1'
|
||||||
if iswindows and hasattr(winutil, 'prepare_for_restart'):
|
if iswindows and hasattr(winutil, 'prepare_for_restart'):
|
||||||
winutil.prepare_for_restart()
|
winutil.prepare_for_restart()
|
||||||
args = ['-g'] if os.path.splitext(e)[0].endswith('-debug') else []
|
args = ['-g'] if os.path.splitext(e)[0].endswith('-debug') else []
|
||||||
@ -505,6 +506,8 @@ def create_listener():
|
|||||||
|
|
||||||
|
|
||||||
def main(args=sys.argv):
|
def main(args=sys.argv):
|
||||||
|
if os.environ.pop(b'CALIBRE_RESTARTING_FROM_GUI', None) == b'1':
|
||||||
|
time.sleep(2) # give the parent process time to cleanup and close
|
||||||
if iswindows and 'CALIBRE_REPAIR_CORRUPTED_DB' in os.environ:
|
if iswindows and 'CALIBRE_REPAIR_CORRUPTED_DB' in os.environ:
|
||||||
windows_repair()
|
windows_repair()
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user