[Update] 自動更新は危険なのでアップデートの通知用フラグのみの実装に変更
This commit is contained in:
13
VRCT.py
13
VRCT.py
@@ -88,6 +88,7 @@ class App(CTk):
|
|||||||
self.ENABLE_AUTO_CLEAR_CHATBOX = False
|
self.ENABLE_AUTO_CLEAR_CHATBOX = False
|
||||||
self.ENABLE_OSC = False
|
self.ENABLE_OSC = False
|
||||||
self.ENABLE_NOTICE_XSOVERLAY =False
|
self.ENABLE_NOTICE_XSOVERLAY =False
|
||||||
|
self.UPDATE_FLAG = False
|
||||||
|
|
||||||
# load config
|
# load config
|
||||||
if os_path.isfile(self.PATH_CONFIG) is not False:
|
if os_path.isfile(self.PATH_CONFIG) is not False:
|
||||||
@@ -426,19 +427,11 @@ class App(CTk):
|
|||||||
# check osc started
|
# check osc started
|
||||||
send_test_action()
|
send_test_action()
|
||||||
|
|
||||||
# auto update
|
# check update
|
||||||
response = requests_get("https://api.github.com/repos/misyaguziya/VRCT/releases/latest")
|
response = requests_get("https://api.github.com/repos/misyaguziya/VRCT/releases/latest")
|
||||||
tag_name = response.json()["tag_name"]
|
tag_name = response.json()["tag_name"]
|
||||||
if tag_name != __version__:
|
if tag_name != __version__:
|
||||||
url = response.json()["assets"][0]["browser_download_url"]
|
self.UPDATE_FLAG = True
|
||||||
res = requests_get(url, stream=True)
|
|
||||||
os_makedirs("./tmp", exist_ok=True)
|
|
||||||
with open("./tmp/download.zip", 'wb') as file:
|
|
||||||
for chunk in res.iter_content(chunk_size=1024):
|
|
||||||
file.write(chunk)
|
|
||||||
unpack_archive('./tmp/download.zip', './tmp')
|
|
||||||
command = "update.cmd"
|
|
||||||
subprocess.Popen(command.split())
|
|
||||||
|
|
||||||
def button_config_callback(self):
|
def button_config_callback(self):
|
||||||
self.foreground_stop()
|
self.foreground_stop()
|
||||||
|
|||||||
15
update.cmd
15
update.cmd
@@ -1,15 +0,0 @@
|
|||||||
set "current_dir=%CD%"
|
|
||||||
taskkill /im VRCT.exe /F
|
|
||||||
timeout 2
|
|
||||||
for /d /r %%i in (*) do (
|
|
||||||
set "folder=%%i"
|
|
||||||
set "folder=!folder:%current_dir%\=!"
|
|
||||||
if "!folder!" neq "\tmp\" (
|
|
||||||
rd /s /q "%%i"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
timeout 2
|
|
||||||
xcopy /s /e /y ".\tmp\VRCT\*" ".\"
|
|
||||||
timeout 2
|
|
||||||
for /f "delims=" %%i in ('dir /b /s /ad "%current_dir%\tmp"') do rd /s /q "%%i"
|
|
||||||
VRCT.exe
|
|
||||||
Reference in New Issue
Block a user