🐛[bugfix] installer : update処理のパスを修正
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
@if not "%~0"=="%~dp0.\%~nx0" start /min cmd /c,"%~dp0.\%~nx0" %* & goto :eof
|
@if not "%~0"=="%~dp0.\%~nx0" start /min cmd /c,"%~dp0.\%~nx0" %* & goto :eof
|
||||||
|
|
||||||
set name=%1
|
set name=%1
|
||||||
set path=%~dp0
|
set local_path=%~dp0
|
||||||
|
|
||||||
taskkill /im %name% /F
|
taskkill /im %name% /F
|
||||||
|
ping -n 2 127.0.0.1 > nul
|
||||||
START "" %path%/%name%
|
START "" %local_path%%name%
|
||||||
|
del /f "%~dp0%~nx0"
|
||||||
@@ -4,17 +4,17 @@ set exe_name=%1
|
|||||||
set folder_name=%2
|
set folder_name=%2
|
||||||
set folder_tmp=%3
|
set folder_tmp=%3
|
||||||
set restart=%4
|
set restart=%4
|
||||||
set path=%~dp0
|
set local_path=%~dp0
|
||||||
|
|
||||||
taskkill /im %exe_name% /F
|
taskkill /im %exe_name% /F
|
||||||
ping -n 2 127.0.0.1 > nul
|
ping -n 2 127.0.0.1 > nul
|
||||||
del /f %exe_name%
|
del /f %local_path%%exe_name%
|
||||||
rmdir /s /q %folder_name%
|
rmdir /s /q %local_path%%folder_name%
|
||||||
move /Y %exe_tmp_name%\* .\
|
xcopy %local_path%%folder_tmp% %local_path% /E /I
|
||||||
rmdir /s /q %exe_tmp_name%
|
rmdir /s /q %local_path%%folder_tmp%
|
||||||
|
|
||||||
if %restart% == True (
|
if %restart% == True (
|
||||||
START "" %path%/%exe_name%
|
START "" %local_path%%exe_name%
|
||||||
)
|
)
|
||||||
|
pause
|
||||||
del /f "%~dp0%~nx0"
|
del /f "%~dp0%~nx0"
|
||||||
6
model.py
6
model.py
@@ -3,6 +3,7 @@ from zipfile import ZipFile
|
|||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
from os import makedirs as os_makedirs
|
from os import makedirs as os_makedirs
|
||||||
from os import path as os_path
|
from os import path as os_path
|
||||||
|
from os import remove as os_remove
|
||||||
from shutil import rmtree, move
|
from shutil import rmtree, move
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from logging import getLogger, FileHandler, Formatter, INFO
|
from logging import getLogger, FileHandler, Formatter, INFO
|
||||||
@@ -284,6 +285,7 @@ class Model:
|
|||||||
file.write(chunk)
|
file.write(chunk)
|
||||||
with ZipFile(os_path.join(current_directory, tmp_directory_name, filename)) as zf:
|
with ZipFile(os_path.join(current_directory, tmp_directory_name, filename)) as zf:
|
||||||
zf.extractall(os_path.join(current_directory, tmp_directory_name))
|
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))
|
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)]
|
command = [os_path.join(current_directory, batch_name), program_name, folder_name, tmp_directory_name, str(restart)]
|
||||||
Popen(command, cwd=current_directory)
|
Popen(command, cwd=current_directory)
|
||||||
@@ -297,8 +299,8 @@ class Model:
|
|||||||
folder_name = '_internal'
|
folder_name = '_internal'
|
||||||
batch_name = 'restart.bat'
|
batch_name = 'restart.bat'
|
||||||
current_directory = config.LOCAL_PATH
|
current_directory = config.LOCAL_PATH
|
||||||
|
move(os_path.join(current_directory, folder_name, "batch", batch_name), os_path.join(current_directory, batch_name))
|
||||||
command = [os_path.join(current_directory, folder_name, "batch", batch_name), program_name]
|
command = [os_path.join(current_directory, batch_name), program_name]
|
||||||
Popen(command, cwd=current_directory)
|
Popen(command, cwd=current_directory)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user