使用停止処理を優先して行うように

This commit is contained in:
suti7yk5032 2024-10-01 23:52:03 +09:00
parent b6bbefbcbe
commit df9100d66f

View file

@ -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,7 +122,23 @@ class App(tkinter.Tk):
print("内部エラーにより停止処理に失敗しました。")
except:
print("ネットワークエラーにより停止処理に失敗しました。")
finally:
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):