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