installer auto-restart on upgrade

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2026-04-09 09:34:25 +02:00
parent 98cfae8dee
commit a16c7ac16e
3 changed files with 15 additions and 4 deletions
+1
View File
@@ -13,6 +13,7 @@
now covers both ROCm on Windows and Linux
see *main interface -> scripts -> rocm advanced config*
- **Features**
- installer auto-restart on upgrade
- enhanced filename pattern processing
allows for any *processing* property name (as defined in `modules/processing_class.py` and saved to `ui-config.json`)
allows for any *settings* property name (as defined in `modules/ui_definitions.py` and saved to `config.json`)
+3 -2
View File
@@ -352,9 +352,10 @@ def branch(folder=None):
# restart process
def restart():
def restart(argv: list | None = None):
argv = argv if isinstance(argv, list) else sys.argv
log.critical('Restarting process...')
os.execv(sys.executable, ['python'] + sys.argv)
os.execv(sys.executable, ['python'] + argv)
# update git repository
+11 -2
View File
@@ -303,9 +303,18 @@ def main():
get_custom_args()
installer.update_wiki()
if args.upgrade:
if installer.restart_required:
log.warning('Installer: restarting now to apply upgrade...')
if '--upgrade' in sys.argv:
sys.argv.remove('--upgrade')
if '--update' in sys.argv:
sys.argv.remove('--update')
installer.restart(sys.argv)
else:
log.debug('Installer: no modifications')
uv, instance = start_server(immediate=True, server=None)
if installer.restart_required:
log.warning('Restart is recommended due to packages updates...')
t_server = time.time()
t_monitor = time.time()