From 9951398c361518c4916590594fedd9bbb4a0a5bc Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Wed, 1 Nov 2023 04:09:41 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B[bugfix]=20installer=20:=20restart?= =?UTF-8?q?=E5=87=A6=E7=90=86=E6=99=82=E3=81=AB=E3=83=91=E3=82=B9=E3=81=8C?= =?UTF-8?q?=E3=81=8A=E3=81=8B=E3=81=97=E3=81=8F=E3=81=AA=E3=82=8B=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- batch/restart.bat | 3 ++- batch/update.bat | 3 ++- model.py | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/batch/restart.bat b/batch/restart.bat index c3b7418f..e02b64a0 100644 --- a/batch/restart.bat +++ b/batch/restart.bat @@ -1,7 +1,8 @@ @if not "%~0"=="%~dp0.\%~nx0" start /min cmd /c,"%~dp0.\%~nx0" %* & goto :eof set name=%1 +set path=%~dp0 taskkill /im %name% /F -START "" %name% \ No newline at end of file +START "" %path%/%name% \ No newline at end of file diff --git a/batch/update.bat b/batch/update.bat index 7353721c..4bc2e679 100644 --- a/batch/update.bat +++ b/batch/update.bat @@ -4,6 +4,7 @@ set exe_name=%1 set folder_name=%2 set folder_tmp=%3 set restart=%4 +set path=%~dp0 taskkill /im %exe_name% /F ping -n 2 127.0.0.1 > nul @@ -13,7 +14,7 @@ move /Y %exe_tmp_name%\* .\ rmdir /s /q %exe_tmp_name% if %restart% == True ( - START "" %exe_name% + START "" %path%/%exe_name% ) del /f "%~dp0%~nx0" \ No newline at end of file diff --git a/model.py b/model.py index 24d3b770..f79c4dfc 100644 --- a/model.py +++ b/model.py @@ -268,9 +268,7 @@ class Model: def updateSoftware(restart:bool=True): filename = 'VRCT.zip' program_name = 'VRCT.exe' - program_tmp_name = '_VRCT.exe' folder_name = '_internal' - folder_tmp_name = '__internal' tmp_directory_name = 'tmp' batch_name = 'update.bat' current_directory = config.LOCAL_PATH @@ -296,9 +294,11 @@ class Model: @staticmethod def reStartSoftware(): program_name = 'VRCT.exe' + folder_name = '_internal' batch_name = 'restart.bat' - program_directory = os_path.dirname(__file__) - command = [os_path.join(program_directory, "batch", batch_name), program_name] + current_directory = config.LOCAL_PATH + + command = [os_path.join(current_directory, folder_name, "batch", batch_name), program_name] Popen(command, cwd=current_directory) @staticmethod