From df9100d66f7b8b20eb97c541b07992f212566c5b Mon Sep 17 00:00:00 2001 From: suti7yk5032 Date: Tue, 1 Oct 2024 23:52:03 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=81=9C=E6=AD=A2=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92=E5=84=AA=E5=85=88=E3=81=97=E3=81=A6=E8=A1=8C?= =?UTF-8?q?=E3=81=86=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dislocker_client_shutdown.py | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/dislocker_client_shutdown.py b/dislocker_client_shutdown.py index b7e5419..91428ac 100644 --- a/dislocker_client_shutdown.py +++ b/dislocker_client_shutdown.py @@ -106,17 +106,6 @@ class App(tkinter.Tk): def handler_close(self): print("停止処理を実行。") - if client_config["eraser"] == True: - appdata_local = os.path.expandvars("%LOCALAPPDATA%") - appdata_roaming = os.path.expandvars("%APPDATA%") - epic_del = self.delete_appdata(process_name="EpicGamesLauncher.exe", dir_path=f"{appdata_local}\\EpicGamesLauncher\\Saved") - chrome_del = self.delete_appdata(process_name="chrome.exe", dir_path=f"{appdata_local}\\Google\\Chrome\\User Data") - discord_del = self.delete_appdata(process_name="discord.exe", dir_path=f"{appdata_roaming}\\discord") - steam_del = self.delete_appdata(process_name="steam.exe", dir_path=f"{appdata_local}\\Steam") - ea_del = self.delete_appdata(process_name="EADesktop.exe", dir_path=f"{appdata_local}\\Electronic Arts") - riot_del = self.delete_appdata(process_name="RiotClientServices.exe", dir_path=f"{appdata_local}\\Riot Games\\Riot Client") - else: - print("削除処理をスキップ。") stop_url = client_config["auth_host_url"] + "/stop" stop_json = { "pc_number": int(client_config["pc_number"]), @@ -133,8 +122,24 @@ class App(tkinter.Tk): print("内部エラーにより停止処理に失敗しました。") except: print("ネットワークエラーにより停止処理に失敗しました。") - finally: - self.destroy() + + print("データ削除を実行。") + try: + if client_config["eraser"] == True: + appdata_local = os.path.expandvars("%LOCALAPPDATA%") + appdata_roaming = os.path.expandvars("%APPDATA%") + epic_del = self.delete_appdata(process_name="EpicGamesLauncher.exe", dir_path=f"{appdata_local}\\EpicGamesLauncher\\Saved") + chrome_del = self.delete_appdata(process_name="chrome.exe", dir_path=f"{appdata_local}\\Google\\Chrome\\User Data") + discord_del = self.delete_appdata(process_name="discord.exe", dir_path=f"{appdata_roaming}\\discord") + steam_del = self.delete_appdata(process_name="steam.exe", dir_path=f"{appdata_local}\\Steam") + ea_del = self.delete_appdata(process_name="EADesktop.exe", dir_path=f"{appdata_local}\\Electronic Arts") + riot_del = self.delete_appdata(process_name="RiotClientServices.exe", dir_path=f"{appdata_local}\\Riot Games\\Riot Client") + else: + print("削除処理をスキップ。") + except: + print("データ削除に失敗しました。") + + self.destroy() def icon(self): self.iconify()