diff --git a/disable_auto_update.py b/disable_auto_update.py index 2424dc8..ba96fce 100644 --- a/disable_auto_update.py +++ b/disable_auto_update.py @@ -91,7 +91,8 @@ class AutoUpdateDisabler: except Exception as e: print(f"{Fore.RED}{EMOJI['ERROR']} {self.translator.get('update.remove_directory_failed', error=str(e)) if self.translator else f'删除目录失败: {e}'}{Style.RESET_ALL}") - return False + # 即使删除失败,也返回 True,继续执行下一步 + return True def _clear_update_yml_file(self): """Clear update.yml file""" @@ -169,9 +170,8 @@ class AutoUpdateDisabler: if not self._kill_cursor_processes(): return False - # 2. Delete directory - if not self._remove_updater_directory(): - return False + # 2. Delete directory - 即使失败也继续执行 + self._remove_updater_directory() # 3. Clear update.yml file if not self._clear_update_yml_file(): diff --git a/locales/en.json b/locales/en.json index 2003730..05b7da6 100644 --- a/locales/en.json +++ b/locales/en.json @@ -292,7 +292,8 @@ "update_yml_cleared": "update.yml file cleared", "update_yml_not_found": "update.yml file not found", "clear_update_yml_failed": "Failed to clear update.yml file: {error}", - "unsupported_os": "Unsupported OS: {system}" + "unsupported_os": "Unsupported OS: {system}", + "remove_directory_failed": "Failed to remove directory: {error}" }, "updater": { "checking": "Checking for updates...", diff --git a/locales/zh_cn.json b/locales/zh_cn.json index cac61bd..ecade24 100644 --- a/locales/zh_cn.json +++ b/locales/zh_cn.json @@ -287,7 +287,8 @@ "update_yml_cleared": "update.yml 文件已清空", "update_yml_not_found": "update.yml 文件未找到", "clear_update_yml_failed": "清空 update.yml 文件失败: {error}", - "unsupported_os": "不支持的操作系统: {system}" + "unsupported_os": "不支持的操作系统: {system}", + "remove_directory_failed": "删除目录失败: {error}" }, "updater": { "checking": "检查更新...", diff --git a/locales/zh_tw.json b/locales/zh_tw.json index 2949002..8ddb6cd 100644 --- a/locales/zh_tw.json +++ b/locales/zh_tw.json @@ -266,7 +266,8 @@ "update_yml_cleared": "update.yml 文件已清空", "update_yml_not_found": "update.yml 文件未找到", "clear_update_yml_failed": "清空 update.yml 文件失败: {error}", - "unsupported_os": "不支持的操作系统: {system}" + "unsupported_os": "不支持的操作系统: {system}", + "remove_directory_failed": "刪除目錄失败: {error}" }, "updater": { "checking": "檢查更新...",