diff --git a/assets/custom.json b/assets/custom.json index ccad764..84d91ed 100644 --- a/assets/custom.json +++ b/assets/custom.json @@ -26,8 +26,14 @@ "repair_pc_manager_to_perform": "Does it repair Microsoft PC Manager installation / launch issues? This action directly uninstalls all versions of Microsoft PC Manager, cleans up configuration files and residuals, and repairs Microsoft Edge (WebView2 Runtime) installer failed to start.", "repair_pc_manager_success": "Successfully repaired Microsoft PC Manager installation / launch issues.", "repair_pc_manager_error": "Error occurred while repairing Microsoft PC Manager installation / launch issues", + "retrieve_pc_manager_appdata_clr_4_0_logs_success": "Successfully retrieved user Microsoft PC Manager CLR_v4.0 logs.", + "retrieve_pc_manager_appdata_clr_4_0_logs_error": "Error occurred while retrieving user Microsoft PC Manager CLR_v4.0 logs", + "retrieve_pc_manager_systemroot_clr_4_0_logs_success": "Successfully retrieved system Microsoft PC Manager CLR_v4.0 logs.", + "retrieve_pc_manager_systemroot_clr_4_0_logs_error": "Error occurred while retrieving system Microsoft PC Manager CLR_v4.0 logs", "retrieve_pc_manager_common_logs_success": "Successfully retrieved Microsoft PC Manager application logs.", "retrieve_pc_manager_common_logs_error": "Error occurred while retrieving Microsoft PC Manager application logs", + "retrieve_pc_manager_crash_files_success": "Successfully retrieved Microsoft PC Manager crash files.", + "retrieve_pc_manager_crash_files_error": "Error occurred while retrieving Microsoft PC Manager crash files", "retrieve_pc_manager_setup_logs_success": "Successfully retrieved Microsoft PC Manager installation logs.", "retrieve_pc_manager_setup_logs_error": "Error occurred while retrieving Microsoft PC Manager installation logs", "retrieve_pc_manager_service_logs_success": "Successfully retrieved Microsoft PC Manager service logs.", @@ -103,7 +109,7 @@ "reinstall_pc_manager_success": "Reinstallation of Microsoft PC Manager was successful.", "reinstall_pc_manager_error": "Error occurred while reinstalling Microsoft PC Manager", "reintsall_pc_manager_error_code": "Error code", - "reintsall_pc_manager_error_code_1": "Access is denied. Please try rerunning as Administrator.", + "reintsall_pc_manager_error_code_1": "Access is denied. Please try rerunning as administrator.", "reintsall_pc_manager_error_code_2": "There is a problem with the application package manifest file (AppxManifest.xml), try uninstalling Microsoft PC Manager and reinstalling it.", "reintsall_pc_manager_error_code_0x80073D02": "The package could not be installed because resources it modifies are currently in use. Unable to install because the following apps need to be closed.", "update_from_application_package_no_file_selected": "No file selected.", @@ -112,7 +118,7 @@ "update_from_application_package_success": "Successfully updated Microsoft PC Manager from the application package.", "update_from_application_package_error": "Error occurred while updating Microsoft PC Manager from the application package", "install_from_appxmanifest_warn_title": "Warning", - "install_from_appxmanifest_warn": "If you have previously used this feature to install Microsoft PC Manager, please uninstall Microsoft PC Manager before using this feature. Do you want to continue?", + "install_from_appxmanifest_warn": "If you have previously used this feature to install Microsoft PC Manager, please uninstall Microsoft PC Manager before using this feature. Do you want to continue? This feature is still unstable, lacks debugging output, please ensure you have backed up your data and have some debugging capability.", "install_from_appxmanifest_no_file_selected": "No file selected.", "install_from_appxmanifest_no_match_architecture": "No version found that matches the current PC.", "install_from_appxmanifest_no_match_pc_manager_architecture": "No matching architecture was found in the application package. Please find out the architecture of the current application package, rename it to an application package containing the architecture name and retry. (e.g. x64 or arm64)", @@ -127,7 +133,7 @@ "wv2_runtime_install_success": "Successfully installed Microsoft Edge WebView2 Runtime.", "wv2_runtime_installer_download_link": "If you need to save a copy of the Microsoft Edge WebView2 Runtime installer for yourself, please visit https://developer.microsoft.com/microsoft-edge/webview2/?wt.mc_id=studentamb_265231 and select the 'Evergreen Standalone Installer' for x64 or ARM64 to download.", "wv2_installer_exit_code": "Microsoft Edge WebView2 Runtime installer exit code", - "wv2_runtime_already_installed": "Microsoft Edge WebView2 Runtime is already installed on your system. Please try rerunning as Administrator.", + "wv2_runtime_already_installed": "Microsoft Edge WebView2 Runtime is already installed on your system. Please try rerunning as administrator.", "wv2_installer_exit_code_0x8004070c": "Please try deleting the 'C:\\Program Files (x86)\\Microsoft\\EdgeWebView' folder and try again. If there is only a Temp folder under 'C:\\Program Files (x86)\\Microsoft', please delete the 'C:\\Program Files (x86)\\Microsoft' folder directly and try again.", "wv2_installer_exit_code_0x800700b7": "Please try deleting the 'C:\\Program Files (x86)\\Microsoft\\EdgeWebView' folder and try again. If there is only a Temp folder under 'C:\\Program Files (x86)\\Microsoft', please delete the 'C:\\Program Files (x86)\\Microsoft' folder directly and try again. If the problem persists, check if you have access rights to the 'C:\\Program Files (x86)\\Microsoft' folder.", "wv2_download_error": "Error downloading Microsoft Edge WebView2 Runtime.", @@ -159,8 +165,8 @@ "advanced_fail_to_config_and_files_info_for_all_users_in_dism": "Error information", "uninstall_and_cleanup_for_all_users_in_dism_success": "Uninstalls Microsoft PC Manager via DISM for all users and cleans up profiles and residual successes.", "uninstall_for_all_users_in_dism_error_code": "Error code", - "uninstall_for_all_users_in_dism_error_code_1": "Uninstallation failed, please try running as an Administrator. If the problem persists after running as an Administrator, please try using 'Uninstall Microsoft PC Manager via DISM for all users'.", - "uninstall_for_all_users_in_dism_error_code_740": "Uninstallation failed, please try running as an Administrator. Elevated permissions are required to run DISM. Use an elevated command prompt to complete these tasks.", + "uninstall_for_all_users_in_dism_error_code_1": "Uninstallation failed, please try running as an administrator again. If the problem persists after running as an administrator, please try again or contact your system administrator for assistance.", + "uninstall_for_all_users_in_dism_error_code_740": "Uninstallation failed, please try running as an administrator. Elevated permissions are required to run DISM. Use an elevated command prompt to complete these tasks.", "uninstall_for_all_users_success": "Successfully uninstalled Microsoft PC Manager for all users.", "uninstall_for_all_users_error": "Error occurred while uninstalling Microsoft PC Manager for all users", "cleanup_config_and_files_notice_for_all_users": "Clean up configuration files and residual files", @@ -183,7 +189,7 @@ "advanced_fail_to_config_and_files_info_for_all_users": "Error information", "uninstall_and_cleanup_for_all_users_success": "Uninstalls Microsoft PC Manager for all users and cleans up profiles and residual successes.", "uninstall_for_all_users_error_code": "Error code", - "uninstall_for_all_users_error_code_1": "Uninstallation failed, please try running as an Administrator. If the problem persists after running as an Administrator, please try using 'Uninstall Microsoft PC Manager via DISM for all users'.", + "uninstall_for_all_users_error_code_1": "Uninstallation failed, please try running as an administrator. If the problem persists after running as an administrator, please try using 'Uninstall Microsoft PC Manager via DISM for all users'.", "uninstall_for_current_user_success": "Successfully uninstalled Microsoft PC Manager for current user.", "uninstall_for_current_user_error": "Error occurred while uninstalling Microsoft PC Manager for current user", "cleanup_config_and_files_notice_for_current_user": "Clean up configuration files and residual files", @@ -198,7 +204,7 @@ "fail_to_clear_other_files_info_for_current_user": "Error information", "uninstall_and_cleanup_for_current_user_success": "Uninstalls Microsoft PC Manager for all users and cleans up profiles and residual successes.", "uninstall_for_current_user_error_code": "Error code", - "uninstall_for_current_user_error_code_1": "Uninstallation failed, please try running as an Administrator. If the problem persists after running as an Administrator, please try using 'Uninstall Microsoft PC Manager via DISM for all users'.", + "uninstall_for_current_user_error_code_1": "Uninstallation failed, please try running as an administrator. If the problem persists after running as an administrator, please try using 'Uninstall Microsoft PC Manager via DISM for all users'.", "pc_manager_beta_not_found": "Microsoft PC Manager Public Beta is not installed.", "cleanup_pc_manager_beta_config_and_files_notice": "Clean up configuration files and residual files", "cleanup_pc_manager_beta_config_and_files": "Would you like to clean up configuration files and residuals for Microsoft PC Manager Public Beta?", @@ -236,7 +242,7 @@ "start_pc_manager_service_error": "Error occurred while starting the Microsoft PC Manager service", "pc_manager_service_restarted_successfully": "Microsoft PC Manager service has been successfully restarted.", "pc_manager_service_error_code": "Error code", - "pc_manager_service_error_code_5": "Operation failed. Please try rerunning as Administrator.", + "pc_manager_service_error_code_5": "Operation failed. Please try rerunning as administrator.", "pc_manager_service_error_code_1056": "An instance of the service is already running. Please try rerunning the operation.", "pc_manager_service_error_code_1060": "Microsoft PC Manager service is not installed.", "ask_if_version_above_3_14_0_0": "Check Microsoft PC Manager version", @@ -286,12 +292,12 @@ "@mainWindow.py": "mainWindow.py", "refresh": "Refresh", - "notice_select_option": "Please select \n(Functions with * do not need to be run as Administrator)", + "notice_select_option": "Please select \n(Functions with * do not need to be run as administrator)", "select_option": "Please Select", "main_execute_button": "Execute", "main_cancel_button": "Cancel", - "run_as_administrator": "Run as Administrator", - "run_as_administrator_error": "Failed to run as Administrator.", + "run_as_administrator": "Run as administrator", + "run_as_administrator_error": "Failed to run as administrator.", "main_project": "Main Project", "install_project": "Install Project", "uninstall_project": "Uninstall Project", diff --git a/build.bat b/build.bat index 1c366f8..905acf4 100644 --- a/build.bat +++ b/build.bat @@ -10,7 +10,7 @@ if "%arch%"=="AMD64" ( pyinstaller.exe ^ --onefile ^ --windowed ^ - --name "MSPCManagerHelper_Beta_v0.2.0.7_x64" ^ + --name "MSPCManagerHelper_Beta_v0.2.0.8_x64" ^ --add-data "locales;locales" ^ --add-data "assets\\MSPCManagerHelper-256.ico;assets" ^ --add-binary "tools\\procdump\\procdump64.exe;tools/procdump" ^ @@ -23,7 +23,7 @@ if "%arch%"=="AMD64" ( pyinstaller.exe ^ --onefile ^ --windowed ^ - --name "MSPCManagerHelper_Beta_v0.2.0.7_ARM64" ^ + --name "MSPCManagerHelper_Beta_v0.2.0.8_ARM64" ^ --add-data "locales;locales" ^ --add-data "assets\\MSPCManagerHelper-256.ico;assets" ^ --add-binary "tools\\procdump\\procdump64a.exe;tools/procdump" ^ diff --git a/build_.venv.bat b/build_.venv.bat index f18d85c..08af447 100644 --- a/build_.venv.bat +++ b/build_.venv.bat @@ -11,7 +11,7 @@ if "%arch%"=="AMD64" ( "%~dp0\.venv\Scripts\pyinstaller.exe" ^ --onefile ^ --windowed ^ - --name "MSPCManagerHelper_Beta_v0.2.0.7_x64" ^ + --name "MSPCManagerHelper_Beta_v0.2.0.8_x64" ^ --add-data "locales;locales" ^ --add-data "assets\\MSPCManagerHelper-256.ico;assets" ^ --add-binary "tools\\procdump\\procdump64.exe;tools/procdump" ^ @@ -24,7 +24,7 @@ if "%arch%"=="AMD64" ( "%~dp0\.venv\Scripts\pyinstaller.exe" ^ --onefile ^ --windowed ^ - --name "MSPCManagerHelper_Beta_v0.2.0.7_ARM64" ^ + --name "MSPCManagerHelper_Beta_v0.2.0.8_ARM64" ^ --add-data "locales;locales" ^ --add-data "assets\\MSPCManagerHelper-256.ico;assets" ^ --add-binary "tools\\procdump\\procdump64a.exe;tools/procdump" ^ diff --git a/installationFeature.py b/installationFeature.py index ae55196..9ad1d21 100644 --- a/installationFeature.py +++ b/installationFeature.py @@ -406,7 +406,7 @@ def install_from_appxmanifest(self): indent = line[:len(line) - len(line.lstrip())] file.write(f"{indent}\n") file.write( - f"{indent}\n") + f"{indent}\n") else: file.write(line) diff --git a/locales/en-us.json b/locales/en-us.json index eceb4fb..9fc9ea4 100644 --- a/locales/en-us.json +++ b/locales/en-us.json @@ -25,8 +25,14 @@ "repair_pc_manager_to_perform": "Does it repair Microsoft PC Manager installation / launch issues? This action directly uninstalls all versions of Microsoft PC Manager, cleans up configuration files and residuals, and repairs Microsoft Edge (WebView2 Runtime) installer failed to start.", "repair_pc_manager_success": "Successfully repaired Microsoft PC Manager installation / launch issues.", "repair_pc_manager_error": "Error occurred while repairing Microsoft PC Manager installation / launch issues", + "retrieve_pc_manager_appdata_clr_4_0_logs_success": "Successfully retrieved user Microsoft PC Manager CLR_v4.0 logs.", + "retrieve_pc_manager_appdata_clr_4_0_logs_error": "Error occurred while retrieving user Microsoft PC Manager CLR_v4.0 logs", + "retrieve_pc_manager_systemroot_clr_4_0_logs_success": "Successfully retrieved system Microsoft PC Manager CLR_v4.0 logs.", + "retrieve_pc_manager_systemroot_clr_4_0_logs_error": "Error occurred while retrieving system Microsoft PC Manager CLR_v4.0 logs", "retrieve_pc_manager_common_logs_success": "Successfully retrieved Microsoft PC Manager application logs.", "retrieve_pc_manager_common_logs_error": "Error occurred while retrieving Microsoft PC Manager application logs", + "retrieve_pc_manager_crash_files_success": "Successfully retrieved Microsoft PC Manager crash files.", + "retrieve_pc_manager_crash_files_error": "Error occurred while retrieving Microsoft PC Manager crash files", "retrieve_pc_manager_setup_logs_success": "Successfully retrieved Microsoft PC Manager installation logs.", "retrieve_pc_manager_setup_logs_error": "Error occurred while retrieving Microsoft PC Manager installation logs", "retrieve_pc_manager_service_logs_success": "Successfully retrieved Microsoft PC Manager service logs.", @@ -102,7 +108,7 @@ "reinstall_pc_manager_success": "Reinstallation of Microsoft PC Manager was successful.", "reinstall_pc_manager_error": "Error occurred while reinstalling Microsoft PC Manager", "reintsall_pc_manager_error_code": "Error code", - "reintsall_pc_manager_error_code_1": "Access is denied. Please try rerunning as Administrator.", + "reintsall_pc_manager_error_code_1": "Access is denied. Please try rerunning as administrator.", "reintsall_pc_manager_error_code_2": "There is a problem with the application package manifest file (AppxManifest.xml), try uninstalling Microsoft PC Manager and reinstalling it.", "reintsall_pc_manager_error_code_0x80073D02": "The package could not be installed because resources it modifies are currently in use. Unable to install because the following apps need to be closed.", "update_from_application_package_no_file_selected": "No file selected.", @@ -111,7 +117,7 @@ "update_from_application_package_success": "Successfully updated Microsoft PC Manager from the application package.", "update_from_application_package_error": "Error occurred while updating Microsoft PC Manager from the application package", "install_from_appxmanifest_warn_title": "Warning", - "install_from_appxmanifest_warn": "If you have previously used this feature to install Microsoft PC Manager, please uninstall Microsoft PC Manager before using this feature. Do you want to continue?", + "install_from_appxmanifest_warn": "If you have previously used this feature to install Microsoft PC Manager, please uninstall Microsoft PC Manager before using this feature. Do you want to continue? This feature is still unstable, lacks debugging output, please ensure you have backed up your data and have some debugging capability.", "install_from_appxmanifest_no_file_selected": "No file selected.", "install_from_appxmanifest_no_match_architecture": "No version found that matches the current PC.", "install_from_appxmanifest_no_match_pc_manager_architecture": "No matching architecture was found in the application package. Please find out the architecture of the current application package, rename it to an application package containing the architecture name and retry. (e.g. x64 or arm64)", @@ -126,7 +132,7 @@ "wv2_runtime_install_success": "Successfully installed Microsoft Edge WebView2 Runtime.", "wv2_runtime_installer_download_link": "If you need to save a copy of the Microsoft Edge WebView2 Runtime installer for yourself, please visit https://developer.microsoft.com/microsoft-edge/webview2/?wt.mc_id=studentamb_265231 and select the 'Evergreen Standalone Installer' for x64 or ARM64 to download.", "wv2_installer_exit_code": "Microsoft Edge WebView2 Runtime installer exit code", - "wv2_runtime_already_installed": "Microsoft Edge WebView2 Runtime is already installed on your system. Please try rerunning as Administrator.", + "wv2_runtime_already_installed": "Microsoft Edge WebView2 Runtime is already installed on your system. Please try rerunning as administrator.", "wv2_installer_exit_code_0x8004070c": "Please try deleting the 'C:\\Program Files (x86)\\Microsoft\\EdgeWebView' folder and try again. If there is only a Temp folder under 'C:\\Program Files (x86)\\Microsoft', please delete the 'C:\\Program Files (x86)\\Microsoft' folder directly and try again.", "wv2_installer_exit_code_0x800700b7": "Please try deleting the 'C:\\Program Files (x86)\\Microsoft\\EdgeWebView' folder and try again. If there is only a Temp folder under 'C:\\Program Files (x86)\\Microsoft', please delete the 'C:\\Program Files (x86)\\Microsoft' folder directly and try again. If the problem persists, check if you have access rights to the 'C:\\Program Files (x86)\\Microsoft' folder.", "wv2_download_error": "Error downloading Microsoft Edge WebView2 Runtime.", @@ -158,8 +164,8 @@ "advanced_fail_to_config_and_files_info_for_all_users_in_dism": "Error information", "uninstall_and_cleanup_for_all_users_in_dism_success": "Uninstalls Microsoft PC Manager via DISM for all users and cleans up profiles and residual successes.", "uninstall_for_all_users_in_dism_error_code": "Error code", - "uninstall_for_all_users_in_dism_error_code_1": "Uninstallation failed, please try running as an Administrator. If the problem persists after running as an Administrator, please try using 'Uninstall Microsoft PC Manager via DISM for all users'.", - "uninstall_for_all_users_in_dism_error_code_740": "Uninstallation failed, please try running as an Administrator. Elevated permissions are required to run DISM. Use an elevated command prompt to complete these tasks.", + "uninstall_for_all_users_in_dism_error_code_1": "Uninstallation failed, please try running as an administrator again. If the problem persists after running as an administrator, please try again or contact your system administrator for assistance.", + "uninstall_for_all_users_in_dism_error_code_740": "Uninstallation failed, please try running as an administrator. Elevated permissions are required to run DISM. Use an elevated command prompt to complete these tasks.", "uninstall_for_all_users_success": "Successfully uninstalled Microsoft PC Manager for all users.", "uninstall_for_all_users_error": "Error occurred while uninstalling Microsoft PC Manager for all users", "cleanup_config_and_files_notice_for_all_users": "Clean up configuration files and residual files", @@ -182,7 +188,7 @@ "advanced_fail_to_config_and_files_info_for_all_users": "Error information", "uninstall_and_cleanup_for_all_users_success": "Uninstalls Microsoft PC Manager for all users and cleans up profiles and residual successes.", "uninstall_for_all_users_error_code": "Error code", - "uninstall_for_all_users_error_code_1": "Uninstallation failed, please try running as an Administrator. If the problem persists after running as an Administrator, please try using 'Uninstall Microsoft PC Manager via DISM for all users'.", + "uninstall_for_all_users_error_code_1": "Uninstallation failed, please try running as an administrator. If the problem persists after running as an administrator, please try using 'Uninstall Microsoft PC Manager via DISM for all users'.", "uninstall_for_current_user_success": "Successfully uninstalled Microsoft PC Manager for current user.", "uninstall_for_current_user_error": "Error occurred while uninstalling Microsoft PC Manager for current user", "cleanup_config_and_files_notice_for_current_user": "Clean up configuration files and residual files", @@ -197,7 +203,7 @@ "fail_to_clear_other_files_info_for_current_user": "Error information", "uninstall_and_cleanup_for_current_user_success": "Uninstalls Microsoft PC Manager for all users and cleans up profiles and residual successes.", "uninstall_for_current_user_error_code": "Error code", - "uninstall_for_current_user_error_code_1": "Uninstallation failed, please try running as an Administrator. If the problem persists after running as an Administrator, please try using 'Uninstall Microsoft PC Manager via DISM for all users'.", + "uninstall_for_current_user_error_code_1": "Uninstallation failed, please try running as an administrator. If the problem persists after running as an administrator, please try using 'Uninstall Microsoft PC Manager via DISM for all users'.", "pc_manager_beta_not_found": "Microsoft PC Manager Public Beta is not installed.", "cleanup_pc_manager_beta_config_and_files_notice": "Clean up configuration files and residual files", "cleanup_pc_manager_beta_config_and_files": "Would you like to clean up configuration files and residuals for Microsoft PC Manager Public Beta?", @@ -235,7 +241,7 @@ "start_pc_manager_service_error": "Error occurred while starting the Microsoft PC Manager service", "pc_manager_service_restarted_successfully": "Microsoft PC Manager service has been successfully restarted.", "pc_manager_service_error_code": "Error code", - "pc_manager_service_error_code_5": "Operation failed. Please try rerunning as Administrator.", + "pc_manager_service_error_code_5": "Operation failed. Please try rerunning as administrator.", "pc_manager_service_error_code_1056": "An instance of the service is already running. Please try rerunning the operation.", "pc_manager_service_error_code_1060": "Microsoft PC Manager service is not installed.", "ask_if_version_above_3_14_0_0": "Check Microsoft PC Manager version", @@ -285,12 +291,12 @@ "@mainWindow.py": "mainWindow.py", "refresh": "Refresh", - "notice_select_option": "Please select \n(Functions with * do not need to be run as Administrator)", + "notice_select_option": "Please select \n(Functions with * do not need to be run as administrator)", "select_option": "Please Select", "main_execute_button": "Execute", "main_cancel_button": "Cancel", - "run_as_administrator": "Run as Administrator", - "run_as_administrator_error": "Failed to run as Administrator.", + "run_as_administrator": "Run as administrator", + "run_as_administrator_error": "Failed to run as administrator.", "main_project": "Main Project", "install_project": "Install Project", "uninstall_project": "Uninstall Project", diff --git a/locales/zh-cn.json b/locales/zh-cn.json index 3f2bcbd..9132fe5 100644 --- a/locales/zh-cn.json +++ b/locales/zh-cn.json @@ -25,8 +25,14 @@ "repair_pc_manager_to_perform": "是否修复微软电脑管家无法安装 / 打开?此操作会直接卸载所有版本的微软电脑管家,清理配置文件和残留,并修复 Microsoft Edge (WebView2 Runtime) 无法安装的问题。", "repair_pc_manager_success": "修复微软电脑管家无法安装 / 打开成功。", "repair_pc_manager_error": "修复微软电脑管家无法安装 / 打开时出错", + "retrieve_pc_manager_appdata_clr_4_0_logs_success": "成功获取用户微软电脑管家 CLR_v4.0 使用日志。", + "retrieve_pc_manager_appdata_clr_4_0_logs_error": "获取用户微软电脑管家 CLR_v4.0 使用日志时出错", + "retrieve_pc_manager_systemroot_clr_4_0_logs_success": "成功获取系统微软电脑管家 CLR_v4.0 使用日志。", + "retrieve_pc_manager_systemroot_clr_4_0_logs_error": "获取系统微软电脑管家 CLR_v4.0 使用日志时出错", "retrieve_pc_manager_common_logs_success": "成功获取微软电脑管家使用日志。", "retrieve_pc_manager_common_logs_error": "获取微软电脑管家使用日志时出错", + "retrieve_pc_manager_crash_files_success": "成功获取微软电脑管家崩溃文件。", + "retrieve_pc_manager_crash_files_error": "获取微软电脑管家崩溃文件时出错", "retrieve_pc_manager_setup_logs_success": "成功获取微软电脑管家安装日志。", "retrieve_pc_manager_setup_logs_error": "获取微软电脑管家安装日志时出错", "retrieve_pc_manager_service_logs_success": "成功获取微软电脑管家服务日志。", @@ -111,7 +117,7 @@ "update_from_application_package_success": "从 应用程序包 更新微软电脑管家成功。", "update_from_application_package_error": "从 应用程序包 更新微软电脑管家时出错", "install_from_appxmanifest_warn_title": "警告", - "install_from_appxmanifest_warn": "如果您先前使用过此功能安装微软电脑管家,请卸载微软电脑管家后再使用此功能。您想要继续安装吗?", + "install_from_appxmanifest_warn": "如果您先前使用过此功能安装微软电脑管家,请卸载微软电脑管家后再使用此功能。您想要继续安装吗?此功能尚不稳定,缺少调试输出,请确保您已备份数据,并具有一定的调试能力。", "install_from_appxmanifest_no_file_selected": "未选择任何文件。", "install_from_appxmanifest_no_match_architecture": "未找到与当前电脑匹配的版本。", "install_from_appxmanifest_no_match_pc_manager_architecture": "未在应用程序包中找到符合的架构。请查明当前应用程序包的架构后,将其重命名为包含架构名称的应用程序包后重试。(如 x64 或 arm64)", @@ -158,7 +164,7 @@ "advanced_fail_to_config_and_files_info_for_all_users_in_dism": "错误信息", "uninstall_and_cleanup_for_all_users_in_dism_success": "通过 DISM 为 所有用户 卸载微软电脑管家并清理配置文件和残留成功。", "uninstall_for_all_users_in_dism_error_code": "错误代码", - "uninstall_for_all_users_in_dism_error_code_1": "卸载失败,请尝试重新以管理员身份运行。若以管理员身份运行后仍然有此问题,请尝试使用“通过 DISM 为 所有用户 卸载微软电脑管家”。", + "uninstall_for_all_users_in_dism_error_code_1": "卸载失败,请尝试重新以管理员身份运行。若以管理员身份运行后仍然有此问题,请重试,或联系系统管理员以寻求帮助。", "uninstall_for_all_users_in_dism_error_code_740": "卸载失败,请尝试重新以管理员身份运行。需要提升权限才能运行 DISM。使用提升的命令提示符完成这些任务。", "uninstall_for_all_users_success": "为 所有用户 卸载微软电脑管家成功。", "uninstall_for_all_users_error": "为 所有用户 卸载微软电脑管家时出错", diff --git a/locales/zh-tw.json b/locales/zh-tw.json index bcc72df..96fdc96 100644 --- a/locales/zh-tw.json +++ b/locales/zh-tw.json @@ -25,8 +25,14 @@ "repair_pc_manager_to_perform": "是否修正 Microsoft 電腦管家無法安裝 / 開啟?此操作會直接解除安裝所有版本的 Microsoft 電腦管家,清理設定和殘留檔案,並修正 Microsoft Edge (WebView2 執行階段) 無法安裝的問題。", "repair_pc_manager_success": "修正 Microsoft 電腦管家無法安裝 / 開啟成功。", "repair_pc_manager_error": "修正 Microsoft 電腦管家無法安裝 / 開啟時發生錯誤", + "retrieve_pc_manager_appdata_clr_4_0_logs_success": "成功擷取使用者 Microsoft 電腦管家 CLR_v4.0 程式記錄檔。", + "retrieve_pc_manager_appdata_clr_4_0_logs_error": "擷取使用者 Microsoft 電腦管家 CLR_v4.0 程式記錄檔時發生錯誤", + "retrieve_pc_manager_systemroot_clr_4_0_logs_success": "成功擷取系統 Microsoft 電腦管家 CLR_v4.0 程式記錄檔。", + "retrieve_pc_manager_systemroot_clr_4_0_logs_error": "擷取系統 Microsoft 電腦管家 CLR_v4.0 程式記錄檔時發生錯誤", "retrieve_pc_manager_common_logs_success": "成功擷取 Microsoft 電腦管家程式記錄檔。", "retrieve_pc_manager_common_logs_error": "擷取 Microsoft 電腦管家程式記錄檔時發生錯誤", + "retrieve_pc_manager_crash_files_success": "成功擷取 Microsoft 電腦管家崩潰檔案。", + "retrieve_pc_manager_crash_files_error": "擷取 Microsoft 電腦管家崩潰檔案時發生錯誤", "retrieve_pc_manager_setup_logs_success": "成功擷取 Microsoft 電腦管家安裝記錄檔。", "retrieve_pc_manager_setup_logs_error": "擷取 Microsoft 電腦管家安裝記錄檔時發生錯誤", "retrieve_pc_manager_service_logs_success": "成功擷取 Microsoft 電腦管家服務記錄檔。", @@ -111,7 +117,7 @@ "update_from_application_package_success": "從 應用程式套件 更新 Microsoft 電腦管家成功。", "update_from_application_package_error": "從 應用程式套件 更新 Microsoft 電腦管家時發生錯誤", "install_from_appxmanifest_warn_title": "警告", - "install_from_appxmanifest_warn": "如果您先前透過此功能安裝 Microsoft 電腦管家,請先解除安裝 Microsoft 電腦管家後在使用此功能。您想要繼續安裝嗎?", + "install_from_appxmanifest_warn": "如果您先前透過此功能安裝 Microsoft 電腦管家,請先解除安裝 Microsoft 電腦管家後在使用此功能。您想要繼續安裝嗎?此功能尚不穩定,缺少偵錯輸出,請確保您已備份資料,並具有一定的偵錯能力。", "install_from_appxmanifest_no_file_selected": "未選取任何檔案。", "install_from_appxmanifest_no_match_architecture": "未找到與目前電腦匹配的版本。", "install_from_appxmanifest_no_match_pc_manager_architecture": "未在應用程式套件中找到符合的架構。請查明目前應用程式套件的架構後,將其重新命名為包含架構名稱的應用程式套件後重試。(如 x64 或 arm64)", @@ -158,7 +164,7 @@ "advanced_fail_to_config_and_files_info_for_all_users_in_dism": "錯誤資訊", "uninstall_and_cleanup_for_all_users_in_dism_success": "透過 DISM 為 所有使用者 解除安裝 Microsoft 電腦管家並清理設定檔和殘留成功。", "uninstall_for_all_users_in_dism_error_code": "錯誤代碼", - "uninstall_for_all_users_in_dism_error_code_1": "解除安裝失敗,請嘗試重新以系統管理員身分執行。若以系統管理員身分執行後仍然有此問題,請嘗試使用「透過 DISM 為 所有使用者 解除安裝 Microsoft 電腦管家」。", + "uninstall_for_all_users_in_dism_error_code_1": "解除安裝失敗,請嘗試重新以系統管理員身分執行。若以系統管理員身分執行後仍然有此問題,請重試,或聯絡系統管理員以取得支援。", "uninstall_for_all_users_in_dism_error_code_740": "解除安裝失敗,請嘗試重新以系統管理員身分執行。需要提升權限才能運行 DISM。使用提升的命令提示符完成這些任務。", "uninstall_for_all_users_success": "為 所有使用者 解除安裝 Microsoft 電腦管家成功。", "uninstall_for_all_users_error": "為 所有使用者 解除安裝 Microsoft 電腦管家時發生錯誤", diff --git a/mainFeature.py b/mainFeature.py index 7c4d894..74c078c 100644 --- a/mainFeature.py +++ b/mainFeature.py @@ -75,8 +75,11 @@ def get_pc_manager_logs(self): date_str = datetime.now().strftime(datetime.now().isoformat().replace(":", ".")) # 日期字符串 logs_destination = os.path.join(os.getenv("UserProfile"), "Desktop", "Microsoft PC Manager Logs", date_str) # 日志目标路径 program_logs_source_path = os.path.join(os.getenv("ProgramData"), "Windows Master Store") # 程序日志源路径 + appdata_clr_4_0_logs_source = os.path.join(os.getenv("LocalAppData"), "Microsoft", "CLR_v4.0", "UsageLogs") # LocalAppData 下 CLR_v4.0 日志源路径 + systemroot_clr_4_0_logs_source = os.path.join(os.getenv("SystemRoot"), "System32", "config", "systemprofile", "AppData", "Local", "Microsoft", "CLR_v4.0", "UsageLogs") # SystemRoot 下 CLR_v4.0 日志源路径 common_logs_source = os.path.join(program_logs_source_path, "Common") # Common 日志源路径 - setup_logs_source = os.path.join(program_logs_source_path, "Setup") # Setup 日志源路径 + crash_files_source = os.path.join(common_logs_source, "Crash") # Crash 源路径 + setup_logs_source = os.path.join(program_logs_source_path, "Setup") # Setup 日志源路径 service_logs_source = os.path.join(program_logs_source_path, "ServiceData") # ServiceData 日志源路径 exe_setup_logs_source = os.path.join(os.getenv("ProgramData"), "Windows Master Setup") # EXE 安装器日志源路径 logs_zip_archive = os.path.join(os.getenv("UserProfile"), "Desktop") # 日志压缩包路径 @@ -85,6 +88,42 @@ def get_pc_manager_logs(self): os.makedirs(logs_destination, exist_ok=True) # 创建日志目标目录 os.makedirs(os.path.join(logs_destination, "Common"), exist_ok=True) # 创建 Common 目标目录 + # 复制 AppData 下的 CLR_v4.0 日志 + if os.path.exists(appdata_clr_4_0_logs_source): + try: # 使用 cmd.exe 拉起的进程需要 "-ShowWindowMode:Hide" 参数,不依赖 cmd.exe 时不需要 "cmd.exe", "/C" 参数 + appdata_clr_4_0_result = subprocess.run([nsudolc_path, "-U:T", "-P:E", "-ShowWindowMode:Hide", "Robocopy.exe", + appdata_clr_4_0_logs_source, os.path.join(logs_destination, "AppData_CLR_v4.0"), + "*Microsoft.WIC.PCWndManager.Plugin*.log", + "*MSPCManager*.log", "*MSPCWndManager*.log", + "*PCMAutoRun*.log", "*PCMCheckSum*.log"], + capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) + if appdata_clr_4_0_result.returncode == 0: + self.textbox(self.translator.translate("retrieve_pc_manager_appdata_clr_4_0_logs_success")) + else: + self.textbox(self.translator.translate("retrieve_pc_manager_appdata_clr_4_0_logs_error") + f":\n{appdata_clr_4_0_result.stdout}") + except Exception as e: + self.textbox(self.translator.translate("retrieve_pc_manager_appdata_clr_4_0_logs_error") + f":\n{str(e)}") + else: + pass + + # 复制 SystemRoot 下的 CLR_v4.0 日志 + if os.path.exists(systemroot_clr_4_0_logs_source): + try: # 使用 cmd.exe 拉起的进程需要 "-ShowWindowMode:Hide" 参数,不依赖 cmd.exe 时不需要 "cmd.exe", "/C" 参数 + systemroot_clr_4_0_result = subprocess.run([nsudolc_path, "-U:T", "-P:E", "-ShowWindowMode:Hide", "Robocopy.exe", + systemroot_clr_4_0_logs_source, os.path.join(logs_destination, "SystemRoot_CLR_v4.0"), + "*Microsoft.WIC.PCWndManager.Plugin*.log", + "*MSPCManager*.log", "*MSPCWndManager*.log", + "*PCMAutoRun*.log", "*PCMCheckSum*.log"], + capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) + if systemroot_clr_4_0_result.returncode == 0: + self.textbox(self.translator.translate("retrieve_pc_manager_systemroot_clr_4_0_logs_success")) + else: + self.textbox(self.translator.translate("retrieve_pc_manager_systemroot_clr_4_0_logs_error") + f":\n{systemroot_clr_4_0_result.stdout}") + except Exception as e: + self.textbox(self.translator.translate("retrieve_pc_manager_systemroot_clr_4_0_logs_error") + f":\n{str(e)}") + else: + pass + # 复制 Common 下的 .log 文件(使用日志) if os.path.exists(common_logs_source): try: # 使用 cmd.exe 拉起的进程需要 "-ShowWindowMode:Hide" 参数,不依赖 cmd.exe 时不需要 "cmd.exe", "/C" 参数 @@ -101,6 +140,22 @@ def get_pc_manager_logs(self): else: pass + # 复制 Crash 文件夹(崩溃文件) + if os.path.exists(crash_files_source): + try: # 使用 cmd.exe 拉起的进程需要 "-ShowWindowMode:Hide" 参数,不依赖 cmd.exe 时不需要 "cmd.exe", "/C" 参数 + common_result = subprocess.run([nsudolc_path, "-U:T", "-P:E", "-ShowWindowMode:Hide", "xcopy.exe", + os.path.join(crash_files_source, "*.*"), os.path.join(logs_destination, "Common", "Crash"), + "/H", "/I", "/S", "/Y"], # 包含隐藏和系统文件;如果目标不存在,并且使用时未指定文件,则假定目标为目录;包括子目录(不复制空目录);覆盖 + capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) + if common_result.returncode == 0: + self.textbox(self.translator.translate("retrieve_pc_manager_crash_files_success")) + else: + self.textbox(self.translator.translate("retrieve_pc_manager_crash_files_error") + f":\n{common_result.stdout}") + except Exception as e: + self.textbox(self.translator.translate("retrieve_pc_manager_crash_files_error") + f":\n{str(e)}") + else: + pass + # 复制 Setup 文件夹(安装日志) if os.path.exists(setup_logs_source): try: # 使用 cmd.exe 拉起的进程需要 "-ShowWindowMode:Hide" 参数,不依赖 cmd.exe 时不需要 "cmd.exe", "/C" 参数 diff --git a/mainWindow.py b/mainWindow.py index a23a4a2..df14845 100644 --- a/mainWindow.py +++ b/mainWindow.py @@ -22,7 +22,7 @@ def __init__(self): super().__init__() main_icon_path = os.path.join(os.path.dirname(__file__), 'assets', 'MSPCManagerHelper-256.ico') self.iconbitmap(main_icon_path) - self.MSPCManagerHelper_Version = "Beta v0.2.0.7" + self.MSPCManagerHelper_Version = "Beta v0.2.0.8" title = f"MSPCManagerHelper {self.MSPCManagerHelper_Version}" if AdvancedStartup.is_admin(): title += " (Administrator)" @@ -36,7 +36,7 @@ def __init__(self): center_x, center_y = self.winfo_screenwidth() // 2 - window_width // 2, self.winfo_screenheight() // 2 - window_height // 2 # 计算窗口位置 self.geometry(f"{window_width}x{window_height}+{center_x}+{center_y}") # 设置窗口位置 self.resizable(False, False) # 禁止调整窗口大小 - self.configure(bg="white") + self.configure(bg="WhiteSmoke") # 初始化功能 self.translator = Translator(locale='en-us') @@ -93,11 +93,11 @@ def create_widgets(self): self.language_combobox.place(x=35, y=80, width=180, height=25) # 检测版本的 TextBlock 和刷新按钮 - version_frame = tk.Frame(self, bg="white") + version_frame = tk.Frame(self, bg="WhiteSmoke") version_frame.place(x=35, y=110) # 检查 Windows 版本号 - self.version_label = tk.Label(version_frame, text=self.translator.translate("current_pc_manager_version"), bg="white") + self.version_label = tk.Label(version_frame, text=self.translator.translate("current_pc_manager_version"), bg="WhiteSmoke") self.version_label.pack(side="left", padx=(0, 10)) # 刷新按钮 @@ -105,11 +105,11 @@ def create_widgets(self): self.refresh_button.pack(side="left") # 系统要求检测 - self.system_requirement_label = tk.Label(self, text=self.translator.translate("system_requirements_checking"), bg="white", wraplength=400, padx=0, pady=10) + self.system_requirement_label = tk.Label(self, text=self.translator.translate("system_requirements_checking"), bg="WhiteSmoke", wraplength=400, padx=0, pady=10) self.system_requirement_label.place(x=35, y=145) # 提示信息 - self.hint_label = tk.Label(self, text=self.translator.translate("notice_select_option"), bg="white") + self.hint_label = tk.Label(self, text=self.translator.translate("notice_select_option"), bg="WhiteSmoke") self.hint_label.place(x=35, y=210) # 第一个组合框 @@ -142,7 +142,7 @@ def create_widgets(self): self.run_as_administrator_button.config(state="disabled") # 结果输出框 result_textbox - self.result_textbox = tk.Text(self, wrap="word", state="disabled", bg="lightgray") + self.result_textbox = tk.Text(self, wrap="word", state="disabled", bg="LightGray") self.result_textbox.place(x=435, y=80, width=400, height=310) # 创建滚动条 scrollbar = ttk.Scrollbar(self, orient="vertical", command=self.result_textbox.yview) @@ -163,7 +163,8 @@ def create_widgets(self): self.other_feature.refresh_result_textbox() # 输出提示 self.textbox(self.translator.translate('see_term_of_use_and_privacy')) - self.textbox(self.translator.translate('tips_run_as_dev_mode')) + if not (AdvancedStartup.is_devmode() or AdvancedStartup.is_debugdevmode()): + self.textbox(self.translator.translate('tips_run_as_dev_mode')) # 初始检测版本号和系统要求 self.refresh_version() @@ -257,7 +258,8 @@ def change_language(self, event): self.config(menu=self.top_menu.top_menu) # 显示顶部菜单 # 重新输出指定协议与隐私 self.textbox(self.translator.translate('see_term_of_use_and_privacy')) - self.textbox(self.translator.translate('tips_run_as_dev_mode')) + if not (AdvancedStartup.is_devmode() or AdvancedStartup.is_debugdevmode()): + self.textbox(self.translator.translate('tips_run_as_dev_mode')) # 更新文本 def update_texts(self): @@ -514,7 +516,8 @@ def refresh_version(self): # 清除并重新输入 pc_manager_beta_installed 的内容 self.clear_result_textbox() self.textbox(self.translator.translate('see_term_of_use_and_privacy')) - self.textbox(self.translator.translate('tips_run_as_dev_mode')) + if not (AdvancedStartup.is_devmode() or AdvancedStartup.is_debugdevmode()): + self.textbox(self.translator.translate('tips_run_as_dev_mode')) self.textbox(f"{self.translator.translate('pc_manager_beta_installed')}: {beta_version}\n") elif beta_version: self.version_label.config(text=f"{self.translator.translate('current_pc_manager_beta_version')}: {beta_version}") diff --git a/topMenu.py b/topMenu.py index 0dd297a..6853615 100644 --- a/topMenu.py +++ b/topMenu.py @@ -87,7 +87,7 @@ def open_onedrive_application_package(): @staticmethod def open_windowsappruntime_download(): - webbrowser.open("https://learn.microsoft.com/windows/apps/windows-app-sdk/downloads-archive?wt.mc_id=studentamb_265231#windows-app-sdk-15") + webbrowser.open("https://learn.microsoft.com/windows/apps/windows-app-sdk/downloads-archive?wt.mc_id=studentamb_265231") # 条款政策菜单 class TopMenuTermOfUse: diff --git a/uninstallationFeature.py b/uninstallationFeature.py index 5bf1fe1..a82b433 100644 --- a/uninstallationFeature.py +++ b/uninstallationFeature.py @@ -171,7 +171,11 @@ def uninstall_for_all_users_in_dism(self): self.textbox(self.translator.translate('fail_to_clear_registries_info_for_all_users_in_dism') + ': ' + str(e) + '\n') # 显示错误内容 # 删除文件 - file_paths = [os.path.join(os.environ['SystemRoot'], 'Prefetch')] + file_paths = [ + os.path.join(os.environ['LocalAppData'], 'Microsoft', 'CLR_v4.0', 'UsageLogs'), + os.path.join(os.environ['SystemRoot'], 'Prefetch'), + os.path.join(os.environ['SystemRoot'], 'System32', 'config', 'systemprofile', 'AppData', 'Local', 'Microsoft', 'CLR_v4.0', 'UsageLogs') + ] prefetch_files = itertools.chain.from_iterable( glob.iglob(os.path.join(paths, pattern)) for paths in file_paths for pattern in [ @@ -184,8 +188,20 @@ def uninstall_for_all_users_in_dism(self): '*PCMCHECKSUM*.pf' ] ) + + clr_logs_files = itertools.chain.from_iterable( + glob.iglob(os.path.join(paths, pattern)) for paths in file_paths for pattern in [ + '*BGADefMgr*.log', + '*Microsoft.WIC.PCWndManager.Plugin*.log', + '*MSPCManager*.log', + '*MSPCWndManager*.log', + '*PCMAutoRun*.log', + '*PCMCheckSum*.log' + ] + ) + is_first = True - for files in prefetch_files: + for files in itertools.chain(prefetch_files, clr_logs_files): try: subprocess.run( [nsudolc_path, "-U:T", "-P:E", "-ShowWindowMode:Hide", "cmd.exe", "/C", "del", "/F", "/Q", files], @@ -288,9 +304,30 @@ def uninstall_for_all_users_in_dism(self): # 需要以管理员身份运行或包异常 elif any(result.returncode == 1 for result in [result1, result2, result3, result4]): - return f"{self.translator.translate('uninstall_for_all_users_in_dism_error_code_1')}\n{result1.stderr.strip()} | {result2.stderr.strip()} | {result3.stderr.strip()} | {result4.stderr.strip()}\n{self.translator.translate('uninstall_for_all_users_in_dism_error_code')}: {result1.returncode}\n\n{result2.returncode}\n\n{result3.returncode}\n\n{result4.returncode}" + return ( + f"{self.translator.translate('uninstall_for_all_users_in_dism_error_code_1')}\n\n" + f"{self.translator.translate('uninstall_for_all_users_in_dism_error_code')}: {result1.returncode}\n" + f"{result1.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_in_dism_error_code')}: {result2.returncode}\n" + f"{result2.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_in_dism_error_code')}: {result3.returncode}\n" + f"{result3.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_in_dism_error_code')}: {result4.returncode}\n" + f"{result4.stderr.strip()}" + ) else: - return f"{self.translator.translate('uninstall_for_all_users_in_dism_error')}: {result1.stderr.strip()} | {result2.stderr.strip()} | {result3.stderr.strip()} | {result4.stderr.strip()}\n{self.translator.translate('uninstall_for_all_users_in_dism_error_code')}: {result1.returncode}\n\n{result2.returncode}\n\n{result3.returncode}\n\n{result4.returncode}" + return ( + f"{self.translator.translate('uninstall_for_all_users_in_dism_error')}\n\n" + f"{self.translator.translate('uninstall_for_all_users_in_dism_error_code')}: {result1.returncode}\n" + f"{result1.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_in_dism_error_code')}: {result2.returncode}\n" + f"{result2.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_in_dism_error_code')}: {result3.returncode}\n" + f"{result3.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_in_dism_error_code')}: {result4.returncode}\n" + f"{result4.stderr.strip()}" + ) + except Exception as e: return f"{self.translator.translate('uninstall_for_all_users_in_dism_error')}: {str(e)}" @@ -381,7 +418,11 @@ def uninstall_for_all_users(self): self.textbox(self.translator.translate('fail_to_clear_registries_info_for_all_users') + ': ' + str(e) + '\n') # 显示错误内容 # 删除文件 - file_paths = [os.path.join(os.environ['SystemRoot'], 'Prefetch')] + file_paths = [ + os.path.join(os.environ['LocalAppData'], 'Microsoft', 'CLR_v4.0', 'UsageLogs'), + os.path.join(os.environ['SystemRoot'], 'Prefetch'), + os.path.join(os.environ['SystemRoot'], 'System32', 'config', 'systemprofile', 'AppData', 'Local', 'Microsoft', 'CLR_v4.0', 'UsageLogs') + ] prefetch_files = itertools.chain.from_iterable( glob.iglob(os.path.join(paths, pattern)) for paths in file_paths for pattern in [ @@ -394,8 +435,20 @@ def uninstall_for_all_users(self): '*PCMCHECKSUM*.pf' ] ) + + clr_logs_files = itertools.chain.from_iterable( + glob.iglob(os.path.join(paths, pattern)) for paths in file_paths for pattern in [ + '*BGADefMgr*.log', + '*Microsoft.WIC.PCWndManager.Plugin*.log', + '*MSPCManager*.log', + '*MSPCWndManager*.log', + '*PCMAutoRun*.log', + '*PCMCheckSum*.log' + ] + ) + is_first = True - for files in prefetch_files: + for files in itertools.chain(prefetch_files, clr_logs_files): try: subprocess.run( [nsudolc_path, "-U:T", "-P:E", "-ShowWindowMode:Hide", "cmd.exe", "/C", "del", "/F", "/Q", files], @@ -498,9 +551,30 @@ def uninstall_for_all_users(self): # 需要以管理员身份运行或包异常 elif any(result.returncode == 1 for result in [result1, result2, result3, result4]): - return f"{self.translator.translate('uninstall_for_all_users_error_code_1')}\n{result1.stderr.strip()} | {result2.stderr.strip()} | {result3.stderr.strip()} | {result4.stderr.strip()}\n{self.translator.translate('uninstall_for_all_users_error_code')}: {result1.returncode}\n\n{result2.returncode}\n\n{result3.returncode}\n\n{result4.returncode}" + return ( + f"{self.translator.translate('uninstall_for_all_users_error_code_1')}\n\n" + f"{self.translator.translate('uninstall_for_all_users_error_code')}: {result1.returncode}\n" + f"{result1.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_error_code')}: {result2.returncode}\n" + f"{result2.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_error_code')}: {result3.returncode}\n" + f"{result3.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_error_code')}: {result4.returncode}\n" + f"{result4.stderr.strip()}" + ) else: - return f"{self.translator.translate('uninstall_for_all_users_error')}: {result1.stderr.strip()} | {result2.stderr.strip()} | {result3.stderr.strip()} | {result4.stderr.strip()}\n{self.translator.translate('uninstall_for_all_users_error_code')}: {result1.returncode}\n\n{result2.returncode}\n\n{result3.returncode}\n\n{result4.returncode}" + return ( + f"{self.translator.translate('uninstall_for_all_users_error')}\n\n" + f"{self.translator.translate('uninstall_for_all_users_error_code')}: {result1.returncode}\n" + f"{result1.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_error_code')}: {result2.returncode}\n" + f"{result2.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_error_code')}: {result3.returncode}\n" + f"{result3.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_error_code')}: {result4.returncode}\n" + f"{result4.stderr.strip()}" + ) + except Exception as e: return f"{self.translator.translate('uninstall_for_all_users_error')}: {str(e)}" @@ -575,7 +649,11 @@ def uninstall_for_current_user(self): self.textbox(self.translator.translate('fail_to_clear_registries_info_for_current_user') + ': ' + str(e) + '\n') # 显示错误内容 # 删除文件 - file_paths = [os.path.join(os.environ['SystemRoot'], 'Prefetch')] + file_paths = [ + os.path.join(os.environ['LocalAppData'], 'Microsoft', 'CLR_v4.0', 'UsageLogs'), + os.path.join(os.environ['SystemRoot'], 'Prefetch'), + os.path.join(os.environ['SystemRoot'], 'System32', 'config', 'systemprofile', 'AppData', 'Local', 'Microsoft', 'CLR_v4.0', 'UsageLogs') + ] prefetch_files = itertools.chain.from_iterable( glob.iglob(os.path.join(paths, pattern)) for paths in file_paths for pattern in [ @@ -588,8 +666,20 @@ def uninstall_for_current_user(self): '*PCMCHECKSUM*.pf' ] ) + + clr_logs_files = itertools.chain.from_iterable( + glob.iglob(os.path.join(paths, pattern)) for paths in file_paths for pattern in [ + '*BGADefMgr*.log', + '*Microsoft.WIC.PCWndManager.Plugin*.log', + '*MSPCManager*.log', + '*MSPCWndManager*.log', + '*PCMAutoRun*.log', + '*PCMCheckSum*.log' + ] + ) + is_first = True - for files in prefetch_files: + for files in itertools.chain(prefetch_files, clr_logs_files): try: subprocess.run( [nsudolc_path, "-U:T", "-P:E", "-ShowWindowMode:Hide", "cmd.exe", "/C", "del", "/F", "/Q", files], @@ -607,9 +697,22 @@ def uninstall_for_current_user(self): # 需要以管理员身份运行或包异常 elif any(result.returncode == 1 for result in [result1, result2]): - return f"{self.translator.translate('uninstall_for_current_user_error_code_1')}\n{result1.stderr.strip()} | {result2.stderr.strip()}\n{self.translator.translate('uninstall_for_all_users_error_code')}: {result1.returncode}\n\n{result2.returncode}" + return ( + f"{self.translator.translate('uninstall_for_current_user_error_code_1')}\n\n" + f"{self.translator.translate('uninstall_for_all_users_error_code')}: {result1.returncode}\n" + f"{result1.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_all_users_error_code')}: {result2.returncode}\n" + f"{result2.stderr.strip()}" + ) else: - return f"{self.translator.translate('uninstall_for_current_user_error')}: {result1.stderr.strip()} | {result2.stderr.strip()}\n{self.translator.translate('uninstall_for_current_user_error_code')}: {result1.returncode}\n\n{result2.returncode}" + return ( + f"{self.translator.translate('uninstall_for_current_user_error')}\n\n" + f"{self.translator.translate('uninstall_for_current_user_error_code')}: {result1.returncode}\n" + f"{result1.stderr.strip()}\n\n\n" + f"{self.translator.translate('uninstall_for_current_user_error_code')}: {result2.returncode}\n" + f"{result2.stderr.strip()}" + ) + except Exception as e: return f"{self.translator.translate('uninstall_for_current_user_error')}: {str(e)}" @@ -692,9 +795,14 @@ def uninstall_pc_manager_beta(self): # 删除文件 file_paths = [ - os.path.join(os.environ['SystemRoot'], 'Prefetch'), + os.path.join(os.environ['AppData'], 'Microsoft', 'Internet Explorer', 'Quick Launch', 'User Pinned', 'TaskBar'), + os.path.join(os.environ['AppData'], 'Microsoft', 'Windows', 'Start Menu'), + os.path.join(os.environ['LocalAppData'], 'Microsoft', 'CLR_v4.0', 'UsageLogs'), + os.path.join(os.environ['ProgramData'], 'Microsoft', 'Windows', 'Start Menu', 'Programs'), os.path.join(os.environ['Public'], 'Desktop'), - os.path.join(os.environ['ProgramData'], 'Microsoft', 'Windows', 'Start Menu', 'Programs') + os.path.join(os.environ['SystemRoot'], 'Prefetch'), + os.path.join(os.environ['SystemRoot'], 'System32', 'config', 'systemprofile', 'AppData', 'Local', 'Microsoft', 'CLR_v4.0', 'UsageLogs'), + os.path.join(os.environ['UserProfile'], 'Desktop'), ] prefetch_files = itertools.chain.from_iterable( @@ -711,15 +819,28 @@ def uninstall_pc_manager_beta(self): shortcuts = itertools.chain.from_iterable( glob.iglob(os.path.join(paths, pattern)) for paths in file_paths for pattern in [ + '*PC Manager*.lnk', '*MSPCManager*.lnk', '*Microsoft PC Manager*.lnk', - '*微软电脑管家*.lnk', '*Microsoft 電腦管家*.lnk', - '*Windows Master*.lnk' + '*Windows Master*.lnk', + '*微软电脑管家*.lnk' + ] + ) + + clr_logs_files = itertools.chain.from_iterable( + glob.iglob(os.path.join(paths, pattern)) for paths in file_paths for pattern in [ + '*BGADefMgr*.log', + '*Microsoft.WIC.PCWndManager.Plugin*.log', + '*MSPCManager*.log', + '*MSPCWndManager*.log', + '*PCMAutoRun*.log', + '*PCMCheckSum*.log' ] ) + is_first = True - for files in itertools.chain(prefetch_files, shortcuts): + for files in itertools.chain(clr_logs_files, prefetch_files, shortcuts): try: os.remove(files) if is_first: diff --git a/version_ARM64.txt b/version_ARM64.txt index f3db1bb..88ad4d1 100644 --- a/version_ARM64.txt +++ b/version_ARM64.txt @@ -6,8 +6,8 @@ VSVersionInfo( ffi=FixedFileInfo( - filevers=(0, 2, 0, 7), - prodvers=(0, 2, 0, 7), + filevers=(0, 2, 0, 8), + prodvers=(0, 2, 0, 8), mask=0x3f, flags=0x0, OS=0x4, @@ -23,12 +23,12 @@ VSVersionInfo( [ StringStruct(u'CompanyName', u'GuCATs'), StringStruct('FileDescription', 'MSPCManagerHelper'), - StringStruct('FileVersion', 'Beta v0.2.0.7 ARM64'), - StringStruct('InternalName', 'MSPCManagerHelper_Beta_v0.2.0.7_ARM64'), + StringStruct('FileVersion', 'Beta v0.2.0.8 ARM64'), + StringStruct('InternalName', 'MSPCManagerHelper_Beta_v0.2.0.8_ARM64'), StringStruct(u'LegalCopyright', u'© 2024 GuCATs All rights reserved.'), - StringStruct('OriginalFilename', 'MSPCManagerHelper_Beta_v0.2.0.7_ARM64.exe'), + StringStruct('OriginalFilename', 'MSPCManagerHelper_Beta_v0.2.0.8_ARM64.exe'), StringStruct('ProductName', 'MSPCManagerHelper'), - StringStruct('ProductVersion', 'Beta v0.2.0.7 ARM64') + StringStruct('ProductVersion', 'Beta v0.2.0.8 ARM64') ] ) ] diff --git a/version_x64.txt b/version_x64.txt index 19e69f5..e276030 100644 --- a/version_x64.txt +++ b/version_x64.txt @@ -6,8 +6,8 @@ VSVersionInfo( ffi=FixedFileInfo( - filevers=(0, 2, 0, 7), - prodvers=(0, 2, 0, 7), + filevers=(0, 2, 0, 8), + prodvers=(0, 2, 0, 8), mask=0x3f, flags=0x0, OS=0x4, @@ -23,12 +23,12 @@ VSVersionInfo( [ StringStruct(u'CompanyName', u'GuCATs'), StringStruct('FileDescription', 'MSPCManagerHelper'), - StringStruct('FileVersion', 'Beta v0.2.0.7 x64'), - StringStruct('InternalName', 'MSPCManagerHelper_Beta_v0.2.0.7_x64'), + StringStruct('FileVersion', 'Beta v0.2.0.8 x64'), + StringStruct('InternalName', 'MSPCManagerHelper_Beta_v0.2.0.8_x64'), StringStruct(u'LegalCopyright', u'© 2024 GuCATs All rights reserved.'), - StringStruct('OriginalFilename', 'MSPCManagerHelper_Beta_v0.2.0.7_x64.exe'), + StringStruct('OriginalFilename', 'MSPCManagerHelper_Beta_v0.2.0.8_x64.exe'), StringStruct('ProductName', 'MSPCManagerHelper'), - StringStruct('ProductVersion', 'Beta v0.2.0.7 x64') + StringStruct('ProductVersion', 'Beta v0.2.0.8 x64') ] ) ]