From b8994ffd87eabb75a0e350611471b2518edc2bc8 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Sun, 8 Oct 2023 23:45:44 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8D[Update]=20Model=20:=20updateSoftwa?= =?UTF-8?q?re=E3=81=AB=E5=86=8D=E8=B5=B7=E5=8B=95=E3=81=AE=E5=BC=95?= =?UTF-8?q?=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model.py | 4 ++-- update.bat | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/model.py b/model.py index 9916228e..4b371f0b 100644 --- a/model.py +++ b/model.py @@ -233,7 +233,7 @@ class Model: return update_flag @staticmethod - def updateSoftware(): + def updateSoftware(restart:bool=True): filename = 'download.zip' program_name = 'VRCT.exe' temporary_name = '_VRCT.exe' @@ -253,7 +253,7 @@ class Model: zf.extract(program_name, os_path.join(current_directory, tmp_directory_name)) os_rename(os_path.join(current_directory, tmp_directory_name, program_name), os_path.join(current_directory, temporary_name)) rmtree(os_path.join(current_directory, tmp_directory_name)) - command = [os_path.join(program_directory, batch_name), program_name, temporary_name] + command = [os_path.join(program_directory, batch_name), program_name, temporary_name, str(restart)] Popen(command) @staticmethod diff --git a/update.bat b/update.bat index cbdef3c4..22dc9255 100644 --- a/update.bat +++ b/update.bat @@ -3,4 +3,8 @@ timeout 2 del /f %1 timeout 2 rename %2 %1 -START "" %1 \ No newline at end of file +echo %3 +timeout 2 +if %3 == True ( + START "" %1 +) \ No newline at end of file