🐛[bugfix] installer : update処理のパスを修正

This commit is contained in:
misyaguziya
2023-11-01 06:00:51 +09:00
parent 9951398c36
commit 2f27ae3464
3 changed files with 15 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ from zipfile import ZipFile
from subprocess import Popen, PIPE
from os import makedirs as os_makedirs
from os import path as os_path
from os import remove as os_remove
from shutil import rmtree, move
from datetime import datetime
from logging import getLogger, FileHandler, Formatter, INFO
@@ -284,6 +285,7 @@ class Model:
file.write(chunk)
with ZipFile(os_path.join(current_directory, tmp_directory_name, filename)) as zf:
zf.extractall(os_path.join(current_directory, tmp_directory_name))
os_remove(os_path.join(current_directory, tmp_directory_name, filename))
move(os_path.join(current_directory, folder_name, "batch", batch_name), os_path.join(current_directory, batch_name))
command = [os_path.join(current_directory, batch_name), program_name, folder_name, tmp_directory_name, str(restart)]
Popen(command, cwd=current_directory)
@@ -297,8 +299,8 @@ class Model:
folder_name = '_internal'
batch_name = 'restart.bat'
current_directory = config.LOCAL_PATH
command = [os_path.join(current_directory, folder_name, "batch", batch_name), program_name]
move(os_path.join(current_directory, folder_name, "batch", batch_name), os_path.join(current_directory, batch_name))
command = [os_path.join(current_directory, batch_name), program_name]
Popen(command, cwd=current_directory)
@staticmethod