diff --git a/.github/workflows/puch_ci.yml b/.github/workflows/puch_ci.yml index c027387..6f41e24 100644 --- a/.github/workflows/puch_ci.yml +++ b/.github/workflows/puch_ci.yml @@ -5,9 +5,9 @@ name: Python application on: push: - branches: [ "main", "Snapshots_GC" ] + branches: [ "main", "Preview" ] pull_request: - branches: [ "main", "Snapshots_GC" ] + branches: [ "main", "Preview" ] permissions: contents: read @@ -36,5 +36,5 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: ${{ github.ref == 'refs/heads/main' && 'MSPCManagerHelper_Beta' || 'MSPCManagerHelper_SNAPSHOTS_Beta' }}_${{ matrix.os }}_${{ matrix.architecture }} + name: ${{ github.ref == 'refs/heads/main' && 'MSPCManagerHelper_Beta' || 'MSPCManagerHelper_Preview_Beta' }}_${{ matrix.os }}_${{ matrix.architecture }} path: ./dist/ diff --git a/LICENSE.txt b/LICENSE.txt index a04ed51..54d701c 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -19,19 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---- - -Third-Party Software - -This software includes the following third-party software: - -NSudo -Copyright (c) M2-Team -Licensed under the MIT License. For more details, please visit the NSudo GitHub Repository at https://github.com/M2Team/NSudo. - -ProcDump -Copyright (c) Microsoft Corporation -ProcDump is distributed under the Sysinternals Software License. For more details, please visit the Sysinternals website at https://learn.microsoft.com/sysinternals/?wt.mc_id=studentamb_265231. - -The licenses for these third-party tools apply to their respective binary files included with this software. diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt new file mode 100644 index 0000000..03cad8a --- /dev/null +++ b/ThirdPartyNotices.txt @@ -0,0 +1,63 @@ +Third-Party Notices +==================== + +This project includes third-party components listed below. Their respective licenses and copyright statements are included. + +--- + +1. ProcDump +------------ + +ProcDump is a Sysinternals tool provided by Microsoft. + +Copyright (c) Microsoft Corporation. + +License: Sysinternals Software License Terms +Link: https://learn.microsoft.com/sysinternals/?wt.mc_id=studentamb_265231 + +Sysinternals Software License Terms: + +Redistribution and use of the software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions must retain the above copyright notice, this list of conditions, and the following disclaimer. +2. The software is provided "as is," without warranty of any kind, express or implied. +3. This software may not be used for commercial purposes without explicit permission from Microsoft. + +For more details, refer to the official license link above. + +--- + +2. NSudo +--------- + +NSudo is an open-source system management tool developed by M2-Team. + +Copyright (c) M2-Team and Contributors. All rights reserved. + +License: MIT License +Link: https://github.com/M2TeamArchived/NSudo/blob/master/License.md + +MIT License: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +End of Third-Party Notices + diff --git a/assets/custom.json b/assets/custom.json index 84d91ed..ca1a6a8 100644 --- a/assets/custom.json +++ b/assets/custom.json @@ -7,20 +7,28 @@ "lang_zh-tw": "中文 (繁體)", "lang_custom": "Load Languages...", + + "@Contributors": "Contributors", "localization_translators_name": "MSPCManagerHelper", "project_contributors_name": "GuCATs, ArcticFoxPro, LuYang114 and other Community Moderators", + + "@checkSystemRequirements.py": "checkSystemRequirements.py", "failure_to_meet_system_requirements": "The current Windows version does not meet the minimum requirements for Microsoft PC Manager:\nWindows 10 Version 19042 or Windows Server 2022", "meet_system_requirements": "The current system meets the minimum requirements for\nMicrosoft PC Manager", + + "@getVersionNumber": "getVersionNumber.py", "cannot_read_pc_manager_version": "Fail to load Microsoft PC Manager version", "current_pc_manager_version": "Microsoft PC Manager version", "current_pc_manager_beta_version": "Microsoft PC Manager Public Beta version", "pc_manager_beta_installed": "Microsoft PC Manager Public Beta is installed, version", + + "@mainFeature.py": "mainFeature.py", "repair_pc_manager_notice": "Notice - Repair Microsoft PC Manager installation / launch issues", "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.", @@ -67,6 +75,8 @@ "clearing_pc_manager_logs_success": "Successfully cleared Microsoft PC Manager logs source folder.", "clearing_pc_manager_logs_error": "Error occurred while clearing Microsoft PC Manager logs source folder", + + "@installationFeature.py": "installationFeature.py", "winget_not_installed": "WinGet is not installed yet, please use another solution.\nYou can download and install Windows Package Manager via Microsoft Learn (https://learn.microsoft.com/windows/msix/app-installer/install-update-app-installer/?wt.mc_id=studentamb_ 265231) or GitHub (https://github.com/microsoft/winget-cli/releases) and retry after downloading and installing Windows Package Manager.", "winget_source_not_found": "The msstore source was not found.", @@ -88,10 +98,12 @@ "winget_not_error_code": "WinGet did not provide error codes.", "winget_output": "WinGet output information", "winget_not_output": "WinGet did not provide output information.", + "download_from_msstore_site_opened": "The Microsoft PC Manager Microsoft Store page has been opened.\nMicrosoft Store is not yet installed, you can download and reset the Microsoft Store online by `wsreset.exe -i`. Or get the Microsoft PC Manager installer at https://get.microsoft.com/installer/download/9PM860492SZD.", "download_from_msstore_site_error": "Error occurred while opening the Microsoft PC Manager Microsoft Store page", "download_from_msstore_app_opened": "Microsoft PC Manager details page has been opened in Microsoft Store.", "download_from_msstore_app_error": "Error occurred while opening the Microsoft PC Manager details page in Microsoft Store", + "install_for_all_users_no_file_selected": "No file selected.", "install_for_all_users_license_select_notice": "Select License File", "install_for_all_users_license_select": "Would you like to select a license file for Microsoft PC Manager? This is useful if there is no Internet connection.", @@ -99,11 +111,13 @@ "install_for_all_users_dependency_package_select": "Would you like to select a dependency package file for Microsoft PC Manager? This is necessary if you are installing version 3.14.0.0 and higher.", "install_for_all_users_success": "Successfully installed Microsoft PC Manager for all users.", "install_for_all_users_error": "Error occurred while installing Microsoft PC Manager for all users", + "install_for_current_user_no_file_selected": "No file selected.", "install_for_current_user_dependency_package_select_notice": "Select Dependency Package", "install_for_current_user_dependency_package_select": "Would you like to select a dependency package file for Microsoft PC Manager? This is necessary if you are installing version 3.14.0.0 and higher.", "install_for_current_user_success": "Successfully installed Microsoft PC Manager for current user.", "install_for_current_user_error": "Error occurred while installing Microsoft PC Manager for current user", + "ask_whether_to_reinstall_for_all_users": "Reinstall Microsoft PC Manager for all users or not", "whether_to_reinstall_for_all_users": "Press Yes if you need to reinstall for all users or No if you need to reinstall for the current user.", "reinstall_pc_manager_success": "Reinstallation of Microsoft PC Manager was successful.", @@ -112,24 +126,34 @@ "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.", "update_from_application_package_dependency_package_select_notice": "Select Dependency Package", "update_from_application_package_dependency_package_select": "Would you like to select a dependency package file for Microsoft PC Manager? This is necessary if you are installing version 3.14.0.0 and higher.", "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? 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_copying_files": "Copying application package files...", + "install_from_appxmanifest_unzipping_files": "Unzipping application package files...", "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)", + "install_from_appxmanifest_modifying_appxmanifest": "Modifying AppxManifest.xml...", "install_from_appxmanifest_dependency_package_select_notice": "Select Dependency Package", "install_from_appxmanifest_dependency_package_select": "Would you like to select a dependency package file for Microsoft PC Manager? This is necessary if you are installing version 3.14.0.0 and higher.", + "install_from_appxmanifest_installing_dependency_package": "Installing dependency package...", + "install_from_appxmanifest_registering_app": "Registering Microsoft PC Manager application...", "install_from_appxmanifest_register_svc_notice": "Registering for Microsoft PC Manager Service", "install_from_appxmanifest_register_svc": "Are you registered for the Microsoft PC Manager service? If the service is already registered there is no need to register again.", + "install_from_appxmanifest_registering_svc": "Registering Microsoft PC Manager service...", "install_from_appxmanifest_svc_exists_warning": "Service Warnings", "install_from_appxmanifest_svc_exists": "Microsoft PC Manager service already exists.", + "install_from_appxmanifest_cleaning_up": "Cleaning up...", "install_from_appxmanifest_success": "Successfully installed Microsoft PC Manager from AppxManifest.", "install_from_appxmanifest_error": "Error occurred while installing Microsoft PC Manager from AppxManifest", + "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", @@ -141,6 +165,8 @@ "wv2_installer_error": "Error occurred while installing Microsoft Edge WebView2 Runtime.", "wv2_installation_cancelled": "User canceled the Microsoft Edge WebView2 Runtime installation.", + + "@uninstallationFeaure.py": "uninstallationFeaure.py", "error_getting_nsudo_path": "Error occurred while getting NSudo path", "uninstall_for_all_users_in_dism_success": "Successfully uninstalled Microsoft PC Manager via DISM for all users.", @@ -158,7 +184,7 @@ "advanced_cleanup_config_and_files_notice_for_all_users_in_dism": "Advanced Cleanup", "advanced_cleanup_config_and_files_for_all_users_in_dism": "Does advanced cleanup of Microsoft Computer Manager profiles and residuals? This may cause instability issues.", "advanced_cleanup_taskkill_process_for_all_users_in_dism": "Processes are being terminated", - "advanced_cleanup_no_processes_killed_for_all_users_in_dism": "No processes were terminated.", + "advanced_cleanup_no_processes_killed_for_all_users_in_dism": "No processes were terminated", "advanced_clearing_folders_for_all_users_in_dism": "Advanced cleaning (Folders)", "advanced_clearing_config_and_files_for_all_users_in_dism": "Advanced cleaning (Files)", "advanced_fail_to_config_and_files_for_all_users_in_dism": "Error cleaning advanced items", @@ -167,6 +193,7 @@ "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 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", @@ -190,6 +217,7 @@ "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_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", @@ -202,9 +230,10 @@ "clearing_other_files_for_current_user": "Cleaning up other residuals", "fail_to_clear_other_files_for_current_user": "Error occurred while cleaning up other residuals", "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_and_cleanup_for_current_user_success": "Uninstalls Microsoft PC Manager for current user 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'.", + "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?", @@ -220,6 +249,8 @@ "uninstall_pc_manager_beta_error_info": "Error information encountered while uninstalling Microsoft PC Manager", "uninstalled_cleanup_pc_manager_beta_config_and_files": "Microsoft PC Manager Public Beta has been uninstalled, and configuration files and residuals have been cleaned up.", + + "@otherFeature.py": "otherFeature.py", "display_name": "Product name", "path_to_signed_product_exe": "Product registration path", @@ -228,14 +259,19 @@ "no_results": "No results were found.", "powershell_not_found": "Unable to start the PowerShell process.", "powershell_error": "Error occurred while executing the PowerShell script", + "developer_options_opened": "Developer options have been opened.", "developer_options_error": "Error occurred while opening Developer options", + "repair_edge_wv2_setup_error": "Error occurred while repairing Microsoft Edge (WebView2 Runtime) installer failed to start", "repair_edge_wv2_setup_completed": "Repair of Microsoft Edge (WebView2 Runtime) installer failed to start is completed.", + "pc_manager_docs_opened": "Microsoft PC Manager FAQ has been opened.", "pc_manager_docs_error": "Error occurred while opening Microsoft PC Manager FAQ", + "join_preview_program_opened": "Microsoft PC Manager Preview Program form has been opened.", "join_preview_program_error": "Error occurred while opening the Microsoft PC Manager Preview Program Form", + "stopping_pc_manager_service": "Stopping Microsoft PC Manager service.", "stop_pc_manager_service_error": "Error occurred while stopping the Microsoft PC Manager service", "starting_pc_manager_service": "Starting Microsoft PC Manager service.", @@ -245,6 +281,7 @@ "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", "select_pc_manager_version": "Is the current version of Microsoft PC Manager 3.14.0.0 and higher?\nIf yes, please click `Yes`. If no, please click `No`.", "how_to_switch_pc_manager_region": "Please switch to the region you want to set in `Country or region` in Settings and restart Microsoft PC Manager.\nif the region is changed again after switching, it may cause Microsoft PC Manager region to be switched again.", @@ -258,38 +295,66 @@ "get_current_pc_manager_region_error": "Error occurred while retrieving the current Microsoft PC Manager region", "restart_pc_manager_to_apply_changes": "Please restart Microsoft PC Manager to apply the changes.", "switch_region_error": "Error occurred while switching Microsoft PC Manager region", + "no_compute_files_selected": "No files selected.", "path_to_compute_files": "Path to compute files", "compute_files_hash_success": "Successfully computed file hash.", "compute_files_hash_error": "Error occurred while computing file hash", + "system_msedge_webview2_version": "System Microsoft Edge WebView2 Runtime version", "user_msedge_webview2_version": "User Microsoft Edge WebView2 Runtime version", "get_msedge_webview2_version_powershell_error": "Error occurred while getting Microsoft Edge WebView2 Runtime version", "msedge_webview2_version_registry_key_not_found": "User Microsoft Edge WebView2 Runtime version registry key not found", "get_msedge_webview2_version_registry_error": "Error occurred while getting User Microsoft Edge WebView2 Runtime version from the registry", + + "@topMenu.py": "topMenu.py", - "top_menu_files_access_key": "Files(F)", + "top_menu_files": "Files", "top_menu_files_exit": "Exit", - "top_menu_update_access_key": "Downloads & Updates(U)", + + "top_menu_update": "Downloads & Updates", "top_menu_update_GitHub": "Get the latest MSPCManagerHelper from GitHub", "top_menu_update_OneDrive": "Get the latest MSPCManagerHelper from OneDrive", "top_menu_update_LiCaoZ_Azure_Blob_PC_Manager": "Get the latest Microsoft PC Manager Fast Preview application package from Azure Blob", "top_menu_update_OneDrive_PC_Manager": "Get the latest Microsoft PC Manager application package & license file from OneDrive", "top_menu_update_WindowsAppRuntime": "Get Windows App Runtime from Microsoft Learn", - "top_menu_term_of_use_and_privacy_access_key": "Terms of Use & Privacy(T)", + + "top_menu_term_of_use_and_privacy": "Terms of Use & Privacy", "top_menu_term_of_use": "Term of Use", "top_menu_privacy": "Privacy", "TermOfUse_context": "MSPCManagerHelper Terms of Use\n\nWelcome to MSPCManagerHelper (hereinafter referred to as \"the Software\"). Please carefully read the following terms of use (hereinafter referred to as \"the Terms\") before using the Software. By downloading, installing, or using the Software, you agree to comply with these Terms. If you do not agree with these Terms, please do not use the Software. Terms are subject to change without notice.\n\nTerms Modification Date: December 22, 2024\n\n1. License to Use\nThe Software is licensed to you by individual developer GuCATs (hereinafter referred to as \"the Developer\") for personal, non-commercial use only. You may not copy, modify, distribute, sell, or lease any part of the Software without the Developer's written permission.\n\n2. Intellectual Property\nThe Software and all its content (including but not limited to text, images, icons, interfaces, code, and trademarks) are protected by copyright laws and other intellectual property laws. The Developer reserves all rights not expressly granted.\n\n3. User Responsibility\nYou agree to comply with all applicable laws and regulations while using the Software. You may not use the Software for any illegal activities or infringe upon the rights of others.\n\n4. Privacy Policy\nThe Developer respects your privacy and is committed to protecting your personal information. For detailed information on how we collect, use, and protect your information, please refer to our [Privacy Policy].\n\n5. Disclaimer\nThe Software is provided \"as is\" without any express or implied warranties, including but not limited to warranties of merchantability, fitness for a particular purpose, and non-infringement. The Developer does not guarantee that the functions of the Software will meet your requirements or that the operation of the Software will be uninterrupted or error-free. The Developer is not responsible for any issues arising from the use of the Software.\n\n6. Limitation of Liability\nTo the maximum extent permitted by applicable law, the Developer shall not be liable for any direct, indirect, incidental, special, or consequential damages resulting from the use or inability to use the Software, even if the Developer has been advised of the possibility of such damages.\n\n7. Modification of Terms\nThe Developer reserves the right to modify these Terms at any time. The modified Terms will take effect immediately upon being posted in the Software or on the Developer's website. Your continued use of the Software signifies your acceptance of the modified Terms.\n\n8. Termination\nIf you violate these Terms, the Developer reserves the right to immediately terminate your license to use the Software without prior notice.\n\n9. Governing Law\nThese Terms are governed by the laws of [Country/Region], without regard to its conflict of law principles.\n\n10. Open Source License\nThe Software uses the MIT open-source license. You can view the details at [MIT License](https://github.com/Goo-aw233/MSPCManagerHelper/blob/main/LICENSE.txt).\n\n11. Third-Party Software\n[NSudo](https://github.com/M2TeamArchived/NSudo).\n[Sysinternals](https://learn.microsoft.com/sysinternals/license-terms/?wt.mc_id=studentamb_265231).", "Privacy_context": "MSPCManagerHelper Privacy Policy\n\nMSPCManagerHelper (hereinafter referred to as \"the Software\") does not collect and upload any data in any form, including, but not limited to, computer identifiers, geographic information, and the like.\n\nWhen you visit some of the links (e.g. learn.microsoft.com/?wt.mc_id=studentamb_265231), Microsoft Student Ambassadors trackers are used to help the developer count the number of visitors.", - "top_menu_help_access_key": "Help(H)", + + "top_menu_help": "Help", "top_menu_help_about": "About", "top_menu_help_gethelp": "Get Help", "top_menu_help_official_site": "Official Site", "top_menu_help_more_contact": "More Contact", + "translation_author": "Translation Author", "project_contributors": "Project Contributors", + + + "@access_key": "access_key", + "top_menu_files_access_key": "(F)", + "top_menu_files_exit_access_key": "(E)", + + "top_menu_update_access_key": "(U)", + + "top_menu_term_of_use_and_privacy_access_key": "(T)", + "top_menu_term_of_use_access_key": "(T)", + "top_menu_privacy_access_key": "(P)", + + "top_menu_help_access_key": "(H)", + "top_menu_help_about_access_key": "(A)", + "top_menu_help_gethelp_access_key": "(G)", + "top_menu_help_official_site_access_key": "(O)", + "top_menu_help_more_contact_access_key": "(M)", + + + "@mainWindow.py": "mainWindow.py", "refresh": "Refresh", "notice_select_option": "Please select \n(Functions with * do not need to be run as administrator)", @@ -298,13 +363,16 @@ "main_cancel_button": "Cancel", "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", "other_project": "Other Project", + "repair_pc_manager": "Repair Microsoft PC Manager installation / launch issues", "get_pc_manager_logs": "Retrieve Microsoft PC Manager logs", "debug_dev_mode": "Developer Debug Mode", + "download_from_winget": "Download Microsoft PC Manager from WinGet (msstore source)", "download_from_msstore": "* Download Microsoft PC Manager from Microsoft Store", "install_for_all_users": "Install Microsoft PC Manager for all users", @@ -313,10 +381,12 @@ "update_from_application_package": "Update Microsoft PC Manager from application package", "install_from_appxmanifest": "Install Microsoft PC Manager from AppxManifest", "install_wv2_runtime": "Install Microsoft Edge WebView2 Runtime", + "uninstall_for_all_users_in_dism": "Uninstall Microsoft PC Manager via DISM for all users", "uninstall_for_all_users": "Uninstall Microsoft PC Manager for all users", "uninstall_for_current_user": "Uninstall Microsoft PC Manager for current user", "uninstall_pc_manager_beta": "Uninstall Microsoft PC Manager Public Beta", + "view_installed_antivirus": "* View installed antivirus software on this PC", "developer_options": "* Developer options", "repair_edge_wv2_setup": "Repair Microsoft Edge (WebView2 Runtime) installer failed to start", @@ -326,8 +396,9 @@ "switch_pc_manager_region": "Switch Microsoft PC Manager region", "compute_files_hash": "* Compute file hash", "get_msedge_webview2_version": "* Get Microsoft Edge WebView2 Runtime version", + "warning": "Warning", - "select_function": "Please Select the Function to Execute", + "select_function": "Please select the function to execute", "main_executing_operation": "The {main_feature_name} operation is executing.", "user_canceled": "User canceled the task.", "main_copy": "Copy", @@ -335,6 +406,8 @@ "feature_unavailable": "Feature unavailable.", "system_requirements_checking": "Checking system requirements...", "failed_to_set_dpi_awareness": "Failed to set DPI awareness.", + "illegal_language_files_title": "Illegal Language File", + "illegal_language_files": "This language file is not legal, please try another language file.", "see_term_of_use_and_privacy": "By using MSPCManagerHelper, you signify that you have read and agree to the `Terms of Use` and `Privacy Policy`, otherwise, please exit and delete the software.", "tips_run_as_dev_mode": "Run with `/DevMode` or `-DevMode` parameter to enable developer mode.", "excessive_waiting_time": "If the wait time is too long, please be patient or cancel the task and try again." diff --git a/build.bat b/build.bat index 905acf4..b799223 100644 --- a/build.bat +++ b/build.bat @@ -10,7 +10,7 @@ if "%arch%"=="AMD64" ( pyinstaller.exe ^ --onefile ^ --windowed ^ - --name "MSPCManagerHelper_Beta_v0.2.0.8_x64" ^ + --name "MSPCManagerHelper_Beta_v0.2.0.9_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.8_ARM64" ^ + --name "MSPCManagerHelper_Beta_v0.2.0.9_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 08af447..3aba636 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.8_x64" ^ + --name "MSPCManagerHelper_Beta_v0.2.0.9_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.8_ARM64" ^ + --name "MSPCManagerHelper_Beta_v0.2.0.9_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 9ad1d21..fe8596a 100644 --- a/installationFeature.py +++ b/installationFeature.py @@ -121,7 +121,7 @@ def install_for_all_users(self): filetypes=[("License.xml", "*.xml"), ("*", "*")]) if not all_users_license_path: return self.translator.translate("install_for_all_users_no_file_selected") - elif response_for_all_users_license == None: + elif response_for_all_users_license is None: return self.translator.translate("user_canceled") else: all_users_license_path = None @@ -138,26 +138,25 @@ def install_for_all_users(self): ("*", "*")]) if not all_users_dependency_package_paths: return self.translator.translate("install_for_all_users_no_file_selected") - elif response_for_all_users_dependency == None: + elif response_for_all_users_dependency is None: return self.translator.translate("user_canceled") try: # 构建 Dism.exe 命令 - all_users_DISM_command = ['Dism.exe', '/Online', '/Add-ProvisionedAppxPackage', + all_users_dism_command = ['Dism.exe', '/Online', '/Add-ProvisionedAppxPackage', f'/PackagePath:{all_users_application_package_file_path}'] if all_users_license_path: # 使用许可证文件 - all_users_DISM_command.append(f'/LicensePath:{all_users_license_path}') + all_users_dism_command.append(f'/LicensePath:{all_users_license_path}') else: # 不使用许可证文件 - all_users_DISM_command.append('/SkipLicense') + all_users_dism_command.append('/SkipLicense') if all_users_dependency_package_paths: # 使用依赖包,若不使用则跳过 for dependency_path in all_users_dependency_package_paths: - all_users_DISM_command.append(f'/DependencyPackagePath:{dependency_path}') + all_users_dism_command.append(f'/DependencyPackagePath:{dependency_path}') # 使用 Dism.exe 安装应用 - result = subprocess.run(all_users_DISM_command, capture_output=True, text=True, - creationflags=subprocess.CREATE_NO_WINDOW) + result = subprocess.run(all_users_dism_command, capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) if result.returncode == 0: return self.translator.translate("install_for_all_users_success") @@ -188,7 +187,7 @@ def install_for_current_user(self): ("*", "*")]) if not current_user_dependency_package_paths: return self.translator.translate("install_for_current_user_no_file_selected") - elif response_for_current_user_dependency == None: + elif response_for_current_user_dependency is None: return self.translator.translate("user_canceled") try: @@ -269,7 +268,7 @@ def update_from_application_package(self): ("*", "*")]) if not update_dependency_package_paths: return self.translator.translate("update_from_application_package_no_file_selected") - elif response_for_update_dependency == None: + elif response_for_update_dependency is None: return self.translator.translate("user_canceled") try: @@ -302,113 +301,104 @@ def install_from_appxmanifest(self): return self.translator.translate("user_canceled") # 打开文件选择对话框选择文件 - appxmanifest_file_path = filedialog.askopenfilename( + pc_manager_package_file_path = filedialog.askopenfilename( filetypes=[("Msix / MsixBundle", "*.msix;*.msixbundle"), ("*", "*")] ) - if not appxmanifest_file_path: + if not pc_manager_package_file_path: return self.translator.translate("user_canceled") try: # 创建临时目录 - temp_appxmanifest_file_path = os.path.join(tempfile.gettempdir(), "MSPCManagerHelper") - if not os.path.exists(temp_appxmanifest_file_path): - os.makedirs(temp_appxmanifest_file_path) + mspcmanagerhelper_temp_dir = os.path.join(tempfile.gettempdir(), "MSPCManagerHelper") # MSPCManagerHelper 临时目录 + if not os.path.exists(mspcmanagerhelper_temp_dir): + os.makedirs(mspcmanagerhelper_temp_dir) - # 复制文件到临时目录并重命名为 .zip - pc_manager_package_file_name = os.path.basename(appxmanifest_file_path) - pc_manager_zip_package_file_path = os.path.join(temp_appxmanifest_file_path, pc_manager_package_file_name + ".zip") - shutil.copyfile(appxmanifest_file_path, pc_manager_zip_package_file_path) + # 复制文件到 MSPCManagerHelper 临时目录并重命名为 .zip + pc_manager_package_file_name = os.path.basename(pc_manager_package_file_path) # Microsoft PC Manager 包文件名 + pc_manager_zip_package_file_path = os.path.join(mspcmanagerhelper_temp_dir, pc_manager_package_file_name + ".zip") # 将包文件名去掉后缀添加 .zip + self.textbox(self.translator.translate("install_from_appxmanifest_copying_files")) + shutil.copyfile(pc_manager_package_file_path, pc_manager_zip_package_file_path) # 将源文件复制到 MSPCManagerHelper 临时目录 # 解压文件 - pc_manager_unpacked_path = os.path.join(temp_appxmanifest_file_path, os.path.splitext(pc_manager_package_file_name)[0]) - shutil.unpack_archive(pc_manager_zip_package_file_path, pc_manager_unpacked_path) + pc_manager_package_unpacked_file_path = os.path.join(mspcmanagerhelper_temp_dir, os.path.splitext(pc_manager_package_file_name)[0]) # 解压后的文件路径 + self.textbox(self.translator.translate("install_from_appxmanifest_unzipping_files")) + shutil.unpack_archive(pc_manager_zip_package_file_path, pc_manager_package_unpacked_file_path) # 解压文件 # 检测解压后的文件夹内是否还有 .msix 文件 - pc_manager_msix_files = [f for f in os.listdir(pc_manager_unpacked_path) if f.endswith('.msix')] + pc_manager_msix_files = [f for f in os.listdir(pc_manager_package_unpacked_file_path) if f.endswith('.msix')] if not pc_manager_msix_files: - # 写入 exclude.txt - exclude_file_path = os.path.join(temp_appxmanifest_file_path, "exclude.txt") - with open(exclude_file_path, 'w') as exclude_file: - exclude_file.write("AppxMetadata\n") - exclude_file.write("[Content_Types].xml\n") - exclude_file.write("AppxBlockMap.xml\n") - exclude_file.write("AppxSignature.p7x\n") + pass else: # 检查文件名中是否带有 x64 或 arm64 x64_file = next((f for f in pc_manager_msix_files if 'x64' in f), None) arm64_file = next((f for f in pc_manager_msix_files if 'arm64' in f), None) if not x64_file and not arm64_file: + # 清理 MSPCManagerHelper 临时目录下的文件 + for temporary_files in os.listdir(mspcmanagerhelper_temp_dir): # 遍历 MSPCManagerHelper 临时目录下的文件 + temporary_files_path = os.path.join(mspcmanagerhelper_temp_dir, temporary_files) # 临时文件路径 + self.textbox(self.translator.translate("install_from_appxmanifest_cleaning_up")) + if os.path.isfile(temporary_files_path): # 如果是文件就删除 + os.remove(temporary_files_path) + elif os.path.isdir(temporary_files_path): # 如果是目录就删除 + shutil.rmtree(temporary_files_path) return self.translator.translate("install_from_appxmanifest_no_match_pc_manager_architecture") - # 读取 PROCESSOR_ARCHITECTURE 的值 - processor_architecture = winreg.QueryValueEx( - winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, - r"SYSTEM\CurrentControlSet\Control\Session Manager\Environment"), - "PROCESSOR_ARCHITECTURE" + # 读取 PROCESSOR_ARCHITECTURE 的值以确定包 + processor_architecture = winreg.QueryValueEx(winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, + r"SYSTEM\CurrentControlSet\Control\Session Manager\Environment"), "PROCESSOR_ARCHITECTURE" )[0] if processor_architecture == "AMD64" and x64_file: - pc_manager_zip_package_file_path = os.path.join(temp_appxmanifest_file_path, x64_file + ".zip") - shutil.copyfile(os.path.join(pc_manager_unpacked_path, x64_file), pc_manager_zip_package_file_path) - shutil.unpack_archive(pc_manager_zip_package_file_path, - os.path.join(temp_appxmanifest_file_path, os.path.splitext(x64_file)[0])) - pc_manager_unpacked_path = os.path.join(temp_appxmanifest_file_path, os.path.splitext(x64_file)[0]) + pc_manager_zip_package_file_path = os.path.join(mspcmanagerhelper_temp_dir, x64_file + ".zip") # 将包文件名去掉后缀添加 .zip + shutil.copyfile(os.path.join(pc_manager_package_unpacked_file_path, x64_file), pc_manager_zip_package_file_path) # 复制文件到 MSPCManagerHelper 临时目录 + self.textbox(self.translator.translate("install_from_appxmanifest_copying_files")) + shutil.unpack_archive(pc_manager_zip_package_file_path, os.path.join(mspcmanagerhelper_temp_dir, os.path.splitext(x64_file)[0])) # 解压文件 + self.textbox(self.translator.translate("install_from_appxmanifest_unzipping_files") + '\n') + pc_manager_package_unpacked_file_path = os.path.join(mspcmanagerhelper_temp_dir, os.path.splitext(x64_file)[0]) # 解压后的文件路径 elif processor_architecture == "ARM64" and arm64_file: - pc_manager_zip_package_file_path = os.path.join(temp_appxmanifest_file_path, arm64_file + ".zip") - shutil.copyfile(os.path.join(pc_manager_unpacked_path, arm64_file), pc_manager_zip_package_file_path) - shutil.unpack_archive(pc_manager_zip_package_file_path, - os.path.join(temp_appxmanifest_file_path, os.path.splitext(arm64_file)[0])) - pc_manager_unpacked_path = os.path.join(temp_appxmanifest_file_path, - os.path.splitext(arm64_file)[0]) + pc_manager_zip_package_file_path = os.path.join(mspcmanagerhelper_temp_dir, arm64_file + ".zip") # 将包文件名去掉后缀添加 .zip + shutil.copyfile(os.path.join(pc_manager_package_unpacked_file_path, arm64_file), pc_manager_zip_package_file_path) # 复制文件到 MSPCManagerHelper 临时目录 + self.textbox(self.translator.translate("install_from_appxmanifest_copying_files")) + shutil.unpack_archive(pc_manager_zip_package_file_path, os.path.join(mspcmanagerhelper_temp_dir, os.path.splitext(arm64_file)[0])) # 解压文件 + self.textbox(self.translator.translate("install_from_appxmanifest_unzipping_files") + '\n') + pc_manager_package_unpacked_file_path = os.path.join(mspcmanagerhelper_temp_dir, os.path.splitext(arm64_file)[0]) # 解压后的文件路径 else: - shutil.rmtree(temp_appxmanifest_file_path) + # 清理 MSPCManagerHelper 临时目录下的文件 + for temporary_files in os.listdir(mspcmanagerhelper_temp_dir): # 遍历 MSPCManagerHelper 临时目录下的文件 + temporary_files_path = os.path.join(mspcmanagerhelper_temp_dir, temporary_files) # 临时文件路径 + self.textbox(self.translator.translate("install_from_appxmanifest_cleaning_up")) + if os.path.isfile(temporary_files_path): # 如果是文件就删除 + os.remove(temporary_files_path) + elif os.path.isdir(temporary_files_path): # 如果是目录就删除 + shutil.rmtree(temporary_files_path) return self.translator.translate("install_from_appxmanifest_no_match_architecture") - # 写入 exclude.txt - exclude_file_path = os.path.join(temp_appxmanifest_file_path, "exclude.txt") - with open(exclude_file_path, 'w') as exclude_file: - exclude_file.write("AppxMetadata\n") - exclude_file.write("[Content_Types].xml\n") - exclude_file.write("AppxBlockMap.xml\n") - exclude_file.write("AppxSignature.p7x\n") - - # 将最后解压的文件夹复制到 %ProgramFiles% 下,除了 exclude.txt 列出的文件与文件夹 - pc_manager_program_files_path = os.path.join(os.environ['ProgramFiles'], os.path.basename(pc_manager_unpacked_path)) + # 将最后解压的文件夹复制到 %ProgramFiles% 下 + pc_manager_program_files_path = os.path.join(os.environ['ProgramFiles'], os.path.basename(pc_manager_package_unpacked_file_path)) # Microsoft PC Manager 安装路径 if not os.path.exists(pc_manager_program_files_path): os.makedirs(pc_manager_program_files_path) - - with open(exclude_file_path, 'r') as exclude_file: - exclude_list = exclude_file.read().splitlines() - - for root, dirs, files in os.walk(pc_manager_unpacked_path): - relative_path = os.path.relpath(root, pc_manager_unpacked_path) - if relative_path in exclude_list: - continue - - dest_dir = os.path.join(pc_manager_program_files_path, relative_path) - if not os.path.exists(dest_dir): - os.makedirs(dest_dir) - - for file in files: - if file in exclude_list: - continue - shutil.copyfile(os.path.join(root, file), os.path.join(dest_dir, file)) + self.textbox(self.translator.translate("install_from_appxmanifest_copying_files") + '\n') + subprocess.run(["Robocopy.exe", pc_manager_package_unpacked_file_path, pc_manager_program_files_path, # 复制文件夹 + "/E", # 复制所有子目录,包括空目录 + "/XD", "AppxMetadata", # 排除目录 + "/XF", "[Content_Types].xml", "AppxBlockMap.xml", "AppxSignature.p7x" # 排除文件 + ], capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) # 修改 AppxManifest.xml 文件 - appxmanifest_path = os.path.join(pc_manager_program_files_path, "AppxManifest.xml") - with open(appxmanifest_path, 'r', encoding='utf-8') as file: - lines = file.readlines() - - with open(appxmanifest_path, 'w', encoding='utf-8') as file: - for line in lines: - if '\n") - file.write( - f"{indent}\n") + appxmanifest_path = os.path.join(pc_manager_program_files_path, "AppxManifest.xml") # AppxManifest.xml 文件路径 + self.textbox(self.translator.translate("install_from_appxmanifest_modifying_appxmanifest") + '\n') + with open(appxmanifest_path, 'r', encoding='utf-8') as file: # 读取 AppxManifest.xml 文件 + lines = file.readlines() # 读取文件内容 + + with open(appxmanifest_path, 'w', encoding='utf-8') as file: # 写入 AppxManifest.xml 文件 + for line in lines: # 遍历文件内容 + if ' 标签 + indent = line[:len(line) - len(line.lstrip())] # 缩进 + file.write(f"{indent}\n") # 注释原始行 + file.write(f"{indent}\n") # 添加新行 else: - file.write(line) + file.write(line) # 写入原始行 # 弹出提示框询问用户是否选择依赖包 response_for_dependency = messagebox.askyesnocancel( @@ -417,20 +407,27 @@ def install_from_appxmanifest(self): ) if response_for_dependency: # 选择依赖包 - dependency_package_paths = filedialog.askopenfilenames( - filetypes=[("Msix", "*.msix"), ("*", "*")]) - if not dependency_package_paths: + dependency_package_paths = filedialog.askopenfilenames(filetypes=[("Msix", "*.msix"), ("*", "*")]) + if not dependency_package_paths: # 如果没有选择文件 + # 清理 MSPCManagerHelper 临时目录下的文件 + for temporary_files in os.listdir(mspcmanagerhelper_temp_dir): # 遍历 MSPCManagerHelper 临时目录下的文件 + temporary_files_path = os.path.join(mspcmanagerhelper_temp_dir, temporary_files) # 临时文件路径 + self.textbox(self.translator.translate("install_from_appxmanifest_cleaning_up")) + if os.path.isfile(temporary_files_path): # 如果是文件就删除 + os.remove(temporary_files_path) + elif os.path.isdir(temporary_files_path): # 如果是目录就删除 + shutil.rmtree(temporary_files_path) return self.translator.translate("install_from_appxmanifest_no_file_selected") for dependency_path in dependency_package_paths: - subprocess.run( - ['powershell.exe', '-Command', f'Add-AppxPackage -Path "{dependency_path}"'], - capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW + self.textbox(self.translator.translate("install_from_appxmanifest_installing_dependency_package") + '\n') + subprocess.run(['powershell.exe', '-Command', f'Add-AppxPackage -Path "{dependency_path}"'], + capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW ) # 注册 AppxManifest.xml - subprocess.run( - ['powershell.exe', '-Command', f'Add-AppxPackage -Register "{pc_manager_program_files_path}\\AppxManifest.xml"'], + self.textbox(self.translator.translate("install_from_appxmanifest_registering_app") + '\n') + subprocess.run(['powershell.exe', '-Command', f'Add-AppxPackage -Register "{pc_manager_program_files_path}\\AppxManifest.xml"'], capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW ) @@ -442,79 +439,71 @@ def install_from_appxmanifest(self): if response_for_service: # 检查服务 "PCManager Service Store" 是否存在 - service_check_store = subprocess.run( - ['powershell.exe', '-Command', 'Get-Service -Name "PCManager Service Store"'], + service_store_check = subprocess.run(['powershell.exe', '-Command', 'Get-Service -Name "PCManager Service Store"'], capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW ) # 检查服务 "PC Manager Service" 是否存在 - service_check_store_old = subprocess.run( - ['powershell.exe', '-Command', 'Get-Service -Name "PC Manager Service"'], + service_store_old_check = subprocess.run(['powershell.exe', '-Command', 'Get-Service -Name "PC Manager Service"'], capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW ) - if any(check.returncode == 0 for check in [service_check_store, service_check_store_old]): + if any(check.returncode == 0 for check in [service_store_check, service_store_old_check]): messagebox.showwarning( self.translator.translate("install_from_appxmanifest_svc_exists_warning"), self.translator.translate("install_from_appxmanifest_svc_exists") ) else: # 创建服务 - service_create = subprocess.run( - ['sc.exe', 'create', 'PCManager Service Store', 'binPath=', - f'"{pc_manager_program_files_path}\\PCManager\\MSPCManagerService.exe"', - 'DisplayName=', '"MSPCManager Service (Store)"', 'start=', 'auto'], + self.textbox(self.translator.translate("install_from_appxmanifest_registering_svc") + '\n') + service_create = subprocess.run(['sc.exe', 'create', 'PCManager Service Store', 'binPath=', + f'"{pc_manager_program_files_path}\\PCManager\\MSPCManagerService.exe"', 'DisplayName=', '"MSPCManager Service (Store)"', 'start=', 'auto'], capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW ) if service_create.returncode == 0: # 设置服务描述 - subprocess.run( - ['sc.exe', 'description', 'PCManager Service Store', - '"Microsoft PCManager Service For Store"'], + subprocess.run(['sc.exe', 'description', 'PCManager Service Store', '"Microsoft PCManager Service For Store"'], capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW ) # 启动服务 - subprocess.run( - ['sc.exe', 'start', 'PCManager Service Store'], + subprocess.run(['sc.exe', 'start', 'PCManager Service Store'], capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW ) - # 清理临时文件 - for temporary_files in os.listdir(temp_appxmanifest_file_path): - temporary_files_path = os.path.join(temp_appxmanifest_file_path, temporary_files) - if os.path.isfile(temporary_files_path): + # 清理 MSPCManagerHelper 临时目录下的文件 + for temporary_files in os.listdir(mspcmanagerhelper_temp_dir): # 遍历 MSPCManagerHelper 临时目录下的文件 + temporary_files_path = os.path.join(mspcmanagerhelper_temp_dir, temporary_files) # 临时文件路径 + self.textbox(self.translator.translate("install_from_appxmanifest_cleaning_up")) + if os.path.isfile(temporary_files_path): # 如果是文件就删除 os.remove(temporary_files_path) - elif os.path.isdir(temporary_files_path): + elif os.path.isdir(temporary_files_path): # 如果是目录就删除 shutil.rmtree(temporary_files_path) return self.translator.translate("install_from_appxmanifest_success") except Exception as e: - return f"{self.translator.translate('install_from_appxmanifest_error')}: {str(e)}" + return self.translator.translate("install_from_appxmanifest_error") + f": {str(e)}" def install_wv2_runtime(self, app): - wv2_installer_temp_dir = os.path.join(tempfile.gettempdir(), "MSPCManagerHelper") - installer_path = os.path.join(wv2_installer_temp_dir, "MicrosoftEdgeWebView2Setup.exe") - download_url = "https://go.microsoft.com/fwlink/p/?LinkId=2124703" + mspcmanagerhelper_temp_dir = os.path.join(tempfile.gettempdir(), "MSPCManagerHelper") # MSPCManagerHelper 临时目录 + wv2_installer_temp_path = os.path.join(mspcmanagerhelper_temp_dir, "MicrosoftEdgeWebView2Setup.exe") # EdgeWebView2 安装程序临时下载路径 + wv2_installer_download_url = "https://go.microsoft.com/fwlink/p/?LinkId=2124703" # EdgeWebView2 安装程序下载链接 try: - # 检查临时目录是否存在 - if os.path.exists(wv2_installer_temp_dir): - shutil.rmtree(wv2_installer_temp_dir) # 删除临时目录 - - # 创建临时目录 - os.makedirs(wv2_installer_temp_dir, exist_ok=True) + # 检查临时目录是否存在,不存在则创建 + if not os.path.exists(mspcmanagerhelper_temp_dir): + os.makedirs(mspcmanagerhelper_temp_dir, exist_ok=True) # 下载文件 - response = requests.get(download_url) + response = requests.get(wv2_installer_download_url) if response.status_code == 200: - with open(installer_path, 'wb') as file: + with open(wv2_installer_temp_path, 'wb') as file: file.write(response.content) else: return self.translator.translate("wv2_download_error") # 运行安装程序 - app.current_process = subprocess.Popen([installer_path, "/install"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + app.current_process = subprocess.Popen([wv2_installer_temp_path, "/install"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = app.current_process.communicate() if app.cancelled: @@ -537,6 +526,6 @@ def install_wv2_runtime(self, app): return f"{self.translator.translate('wv2_download_error_info')}: {str(e)}" finally: # 删除临时目录 - if os.path.exists(wv2_installer_temp_dir): - shutil.rmtree(wv2_installer_temp_dir) + if os.path.exists(mspcmanagerhelper_temp_dir): + shutil.rmtree(mspcmanagerhelper_temp_dir) app.current_process = None diff --git a/locales/en-us.json b/locales/en-us.json index 9fc9ea4..726ed37 100644 --- a/locales/en-us.json +++ b/locales/en-us.json @@ -6,20 +6,28 @@ "lang_zh-tw": "中文 (繁體)", "lang_custom": "Load Languages...", + + "@Contributors": "Contributors", "localization_translators_name": "MSPCManagerHelper", "project_contributors_name": "GuCATs, ArcticFoxPro, LuYang114 and other Community Moderators", + + "@checkSystemRequirements.py": "checkSystemRequirements.py", "failure_to_meet_system_requirements": "The current Windows version does not meet the minimum requirements for Microsoft PC Manager:\nWindows 10 Version 19042 or Windows Server 2022", "meet_system_requirements": "The current system meets the minimum requirements for\nMicrosoft PC Manager", + + "@getVersionNumber": "getVersionNumber.py", "cannot_read_pc_manager_version": "Fail to load Microsoft PC Manager version", "current_pc_manager_version": "Microsoft PC Manager version", "current_pc_manager_beta_version": "Microsoft PC Manager Public Beta version", "pc_manager_beta_installed": "Microsoft PC Manager Public Beta is installed, version", + + "@mainFeature.py": "mainFeature.py", "repair_pc_manager_notice": "Notice - Repair Microsoft PC Manager installation / launch issues", "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.", @@ -66,6 +74,8 @@ "clearing_pc_manager_logs_success": "Successfully cleared Microsoft PC Manager logs source folder.", "clearing_pc_manager_logs_error": "Error occurred while clearing Microsoft PC Manager logs source folder", + + "@installationFeature.py": "installationFeature.py", "winget_not_installed": "WinGet is not installed yet, please use another solution.\nYou can download and install Windows Package Manager via Microsoft Learn (https://learn.microsoft.com/windows/msix/app-installer/install-update-app-installer/?wt.mc_id=studentamb_ 265231) or GitHub (https://github.com/microsoft/winget-cli/releases) and retry after downloading and installing Windows Package Manager.", "winget_source_not_found": "The msstore source was not found.", @@ -87,10 +97,12 @@ "winget_not_error_code": "WinGet did not provide error codes.", "winget_output": "WinGet output information", "winget_not_output": "WinGet did not provide output information.", + "download_from_msstore_site_opened": "The Microsoft PC Manager Microsoft Store page has been opened.\nMicrosoft Store is not yet installed, you can download and reset the Microsoft Store online by `wsreset.exe -i`. Or get the Microsoft PC Manager installer at https://get.microsoft.com/installer/download/9PM860492SZD.", "download_from_msstore_site_error": "Error occurred while opening the Microsoft PC Manager Microsoft Store page", "download_from_msstore_app_opened": "Microsoft PC Manager details page has been opened in Microsoft Store.", "download_from_msstore_app_error": "Error occurred while opening the Microsoft PC Manager details page in Microsoft Store", + "install_for_all_users_no_file_selected": "No file selected.", "install_for_all_users_license_select_notice": "Select License File", "install_for_all_users_license_select": "Would you like to select a license file for Microsoft PC Manager? This is useful if there is no Internet connection.", @@ -98,11 +110,13 @@ "install_for_all_users_dependency_package_select": "Would you like to select a dependency package file for Microsoft PC Manager? This is necessary if you are installing version 3.14.0.0 and higher.", "install_for_all_users_success": "Successfully installed Microsoft PC Manager for all users.", "install_for_all_users_error": "Error occurred while installing Microsoft PC Manager for all users", + "install_for_current_user_no_file_selected": "No file selected.", "install_for_current_user_dependency_package_select_notice": "Select Dependency Package", "install_for_current_user_dependency_package_select": "Would you like to select a dependency package file for Microsoft PC Manager? This is necessary if you are installing version 3.14.0.0 and higher.", "install_for_current_user_success": "Successfully installed Microsoft PC Manager for current user.", "install_for_current_user_error": "Error occurred while installing Microsoft PC Manager for current user", + "ask_whether_to_reinstall_for_all_users": "Reinstall Microsoft PC Manager for all users or not", "whether_to_reinstall_for_all_users": "Press Yes if you need to reinstall for all users or No if you need to reinstall for the current user.", "reinstall_pc_manager_success": "Reinstallation of Microsoft PC Manager was successful.", @@ -111,24 +125,34 @@ "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.", "update_from_application_package_dependency_package_select_notice": "Select Dependency Package", "update_from_application_package_dependency_package_select": "Would you like to select a dependency package file for Microsoft PC Manager? This is necessary if you are installing version 3.14.0.0 and higher.", "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? 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_copying_files": "Copying application package files...", + "install_from_appxmanifest_unzipping_files": "Unzipping application package files...", "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)", + "install_from_appxmanifest_modifying_appxmanifest": "Modifying AppxManifest.xml...", "install_from_appxmanifest_dependency_package_select_notice": "Select Dependency Package", "install_from_appxmanifest_dependency_package_select": "Would you like to select a dependency package file for Microsoft PC Manager? This is necessary if you are installing version 3.14.0.0 and higher.", + "install_from_appxmanifest_installing_dependency_package": "Installing dependency package...", + "install_from_appxmanifest_registering_app": "Registering Microsoft PC Manager application...", "install_from_appxmanifest_register_svc_notice": "Registering for Microsoft PC Manager Service", "install_from_appxmanifest_register_svc": "Are you registered for the Microsoft PC Manager service? If the service is already registered there is no need to register again.", + "install_from_appxmanifest_registering_svc": "Registering Microsoft PC Manager service...", "install_from_appxmanifest_svc_exists_warning": "Service Warnings", "install_from_appxmanifest_svc_exists": "Microsoft PC Manager service already exists.", + "install_from_appxmanifest_cleaning_up": "Cleaning up...", "install_from_appxmanifest_success": "Successfully installed Microsoft PC Manager from AppxManifest.", "install_from_appxmanifest_error": "Error occurred while installing Microsoft PC Manager from AppxManifest", + "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", @@ -140,6 +164,8 @@ "wv2_installer_error": "Error occurred while installing Microsoft Edge WebView2 Runtime.", "wv2_installation_cancelled": "User canceled the Microsoft Edge WebView2 Runtime installation.", + + "@uninstallationFeaure.py": "uninstallationFeaure.py", "error_getting_nsudo_path": "Error occurred while getting NSudo path", "uninstall_for_all_users_in_dism_success": "Successfully uninstalled Microsoft PC Manager via DISM for all users.", @@ -166,6 +192,7 @@ "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 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", @@ -189,6 +216,7 @@ "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_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", @@ -201,9 +229,10 @@ "clearing_other_files_for_current_user": "Cleaning up other residuals", "fail_to_clear_other_files_for_current_user": "Error occurred while cleaning up other residuals", "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_and_cleanup_for_current_user_success": "Uninstalls Microsoft PC Manager for current user 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'.", + "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?", @@ -219,6 +248,8 @@ "uninstall_pc_manager_beta_error_info": "Error information encountered while uninstalling Microsoft PC Manager", "uninstalled_cleanup_pc_manager_beta_config_and_files": "Microsoft PC Manager Public Beta has been uninstalled, and configuration files and residuals have been cleaned up.", + + "@otherFeature.py": "otherFeature.py", "display_name": "Product name", "path_to_signed_product_exe": "Product registration path", @@ -227,14 +258,19 @@ "no_results": "No results were found.", "powershell_not_found": "Unable to start the PowerShell process.", "powershell_error": "Error occurred while executing the PowerShell script", + "developer_options_opened": "Developer options have been opened.", "developer_options_error": "Error occurred while opening Developer options", + "repair_edge_wv2_setup_error": "Error occurred while repairing Microsoft Edge (WebView2 Runtime) installer failed to start", "repair_edge_wv2_setup_completed": "Repair of Microsoft Edge (WebView2 Runtime) installer failed to start is completed.", + "pc_manager_docs_opened": "Microsoft PC Manager FAQ has been opened.", "pc_manager_docs_error": "Error occurred while opening Microsoft PC Manager FAQ", + "join_preview_program_opened": "Microsoft PC Manager Preview Program form has been opened.", "join_preview_program_error": "Error occurred while opening the Microsoft PC Manager Preview Program Form", + "stopping_pc_manager_service": "Stopping Microsoft PC Manager service.", "stop_pc_manager_service_error": "Error occurred while stopping the Microsoft PC Manager service", "starting_pc_manager_service": "Starting Microsoft PC Manager service.", @@ -244,6 +280,7 @@ "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", "select_pc_manager_version": "Is the current version of Microsoft PC Manager 3.14.0.0 and higher?\nIf yes, please click `Yes`. If no, please click `No`.", "how_to_switch_pc_manager_region": "Please switch to the region you want to set in `Country or region` in Settings and restart Microsoft PC Manager.\nif the region is changed again after switching, it may cause Microsoft PC Manager region to be switched again.", @@ -257,38 +294,66 @@ "get_current_pc_manager_region_error": "Error occurred while retrieving the current Microsoft PC Manager region", "restart_pc_manager_to_apply_changes": "Please restart Microsoft PC Manager to apply the changes.", "switch_region_error": "Error occurred while switching Microsoft PC Manager region", + "no_compute_files_selected": "No files selected.", "path_to_compute_files": "Path to compute files", "compute_files_hash_success": "Successfully computed file hash.", "compute_files_hash_error": "Error occurred while computing file hash", + "system_msedge_webview2_version": "System Microsoft Edge WebView2 Runtime version", "user_msedge_webview2_version": "User Microsoft Edge WebView2 Runtime version", "get_msedge_webview2_version_powershell_error": "Error occurred while getting Microsoft Edge WebView2 Runtime version", "msedge_webview2_version_registry_key_not_found": "User Microsoft Edge WebView2 Runtime version registry key not found", "get_msedge_webview2_version_registry_error": "Error occurred while getting User Microsoft Edge WebView2 Runtime version from the registry", + + "@topMenu.py": "topMenu.py", - "top_menu_files_access_key": "Files(F)", + "top_menu_files": "Files", "top_menu_files_exit": "Exit", - "top_menu_update_access_key": "Downloads & Updates(U)", + + "top_menu_update": "Downloads & Updates", "top_menu_update_GitHub": "Get the latest MSPCManagerHelper from GitHub", "top_menu_update_OneDrive": "Get the latest MSPCManagerHelper from OneDrive", "top_menu_update_LiCaoZ_Azure_Blob_PC_Manager": "Get the latest Microsoft PC Manager Fast Preview application package from Azure Blob", "top_menu_update_OneDrive_PC_Manager": "Get the latest Microsoft PC Manager application package & license file from OneDrive", "top_menu_update_WindowsAppRuntime": "Get Windows App Runtime from Microsoft Learn", - "top_menu_term_of_use_and_privacy_access_key": "Terms of Use & Privacy(T)", + + "top_menu_term_of_use_and_privacy": "Terms of Use & Privacy", "top_menu_term_of_use": "Term of Use", "top_menu_privacy": "Privacy", "TermOfUse_context": "MSPCManagerHelper Terms of Use\n\nWelcome to MSPCManagerHelper (hereinafter referred to as \"the Software\"). Please carefully read the following terms of use (hereinafter referred to as \"the Terms\") before using the Software. By downloading, installing, or using the Software, you agree to comply with these Terms. If you do not agree with these Terms, please do not use the Software. Terms are subject to change without notice.\n\nTerms Modification Date: December 22, 2024\n\n1. License to Use\nThe Software is licensed to you by individual developer GuCATs (hereinafter referred to as \"the Developer\") for personal, non-commercial use only. You may not copy, modify, distribute, sell, or lease any part of the Software without the Developer's written permission.\n\n2. Intellectual Property\nThe Software and all its content (including but not limited to text, images, icons, interfaces, code, and trademarks) are protected by copyright laws and other intellectual property laws. The Developer reserves all rights not expressly granted.\n\n3. User Responsibility\nYou agree to comply with all applicable laws and regulations while using the Software. You may not use the Software for any illegal activities or infringe upon the rights of others.\n\n4. Privacy Policy\nThe Developer respects your privacy and is committed to protecting your personal information. For detailed information on how we collect, use, and protect your information, please refer to our [Privacy Policy].\n\n5. Disclaimer\nThe Software is provided \"as is\" without any express or implied warranties, including but not limited to warranties of merchantability, fitness for a particular purpose, and non-infringement. The Developer does not guarantee that the functions of the Software will meet your requirements or that the operation of the Software will be uninterrupted or error-free. The Developer is not responsible for any issues arising from the use of the Software.\n\n6. Limitation of Liability\nTo the maximum extent permitted by applicable law, the Developer shall not be liable for any direct, indirect, incidental, special, or consequential damages resulting from the use or inability to use the Software, even if the Developer has been advised of the possibility of such damages.\n\n7. Modification of Terms\nThe Developer reserves the right to modify these Terms at any time. The modified Terms will take effect immediately upon being posted in the Software or on the Developer's website. Your continued use of the Software signifies your acceptance of the modified Terms.\n\n8. Termination\nIf you violate these Terms, the Developer reserves the right to immediately terminate your license to use the Software without prior notice.\n\n9. Governing Law\nThese Terms are governed by the laws of [Country/Region], without regard to its conflict of law principles.\n\n10. Open Source License\nThe Software uses the MIT open-source license. You can view the details at [MIT License](https://github.com/Goo-aw233/MSPCManagerHelper/blob/main/LICENSE.txt).\n\n11. Third-Party Software\n[NSudo](https://github.com/M2TeamArchived/NSudo).\n[Sysinternals](https://learn.microsoft.com/sysinternals/license-terms/?wt.mc_id=studentamb_265231).", "Privacy_context": "MSPCManagerHelper Privacy Policy\n\nMSPCManagerHelper (hereinafter referred to as \"the Software\") does not collect and upload any data in any form, including, but not limited to, computer identifiers, geographic information, and the like.\n\nWhen you visit some of the links (e.g. learn.microsoft.com/?wt.mc_id=studentamb_265231), Microsoft Student Ambassadors trackers are used to help the developer count the number of visitors.", - "top_menu_help_access_key": "Help(H)", + + "top_menu_help": "Help", "top_menu_help_about": "About", "top_menu_help_gethelp": "Get Help", "top_menu_help_official_site": "Official Site", "top_menu_help_more_contact": "More Contact", + "translation_author": "Translation Author", "project_contributors": "Project Contributors", + + + "@access_key": "access_key", + "top_menu_files_access_key": "(F)", + "top_menu_files_exit_access_key": "(E)", + + "top_menu_update_access_key": "(U)", + + "top_menu_term_of_use_and_privacy_access_key": "(T)", + "top_menu_term_of_use_access_key": "(T)", + "top_menu_privacy_access_key": "(P)", + + "top_menu_help_access_key": "(H)", + "top_menu_help_about_access_key": "(A)", + "top_menu_help_gethelp_access_key": "(G)", + "top_menu_help_official_site_access_key": "(O)", + "top_menu_help_more_contact_access_key": "(M)", + + + "@mainWindow.py": "mainWindow.py", "refresh": "Refresh", "notice_select_option": "Please select \n(Functions with * do not need to be run as administrator)", @@ -297,13 +362,16 @@ "main_cancel_button": "Cancel", "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", "other_project": "Other Project", + "repair_pc_manager": "Repair Microsoft PC Manager installation / launch issues", "get_pc_manager_logs": "Retrieve Microsoft PC Manager logs", "debug_dev_mode": "Developer Debug Mode", + "download_from_winget": "Download Microsoft PC Manager from WinGet (msstore source)", "download_from_msstore": "* Download Microsoft PC Manager from Microsoft Store", "install_for_all_users": "Install Microsoft PC Manager for all users", @@ -312,10 +380,12 @@ "update_from_application_package": "Update Microsoft PC Manager from application package", "install_from_appxmanifest": "Install Microsoft PC Manager from AppxManifest", "install_wv2_runtime": "Install Microsoft Edge WebView2 Runtime", + "uninstall_for_all_users_in_dism": "Uninstall Microsoft PC Manager via DISM for all users", "uninstall_for_all_users": "Uninstall Microsoft PC Manager for all users", "uninstall_for_current_user": "Uninstall Microsoft PC Manager for current user", "uninstall_pc_manager_beta": "Uninstall Microsoft PC Manager Public Beta", + "view_installed_antivirus": "* View installed antivirus software on this PC", "developer_options": "* Developer options", "repair_edge_wv2_setup": "Repair Microsoft Edge (WebView2 Runtime) installer failed to start", @@ -325,8 +395,9 @@ "switch_pc_manager_region": "Switch Microsoft PC Manager region", "compute_files_hash": "* Compute file hash", "get_msedge_webview2_version": "* Get Microsoft Edge WebView2 Runtime version", + "warning": "Warning", - "select_function": "Please Select the Function to Execute", + "select_function": "Please select the function to execute", "main_executing_operation": "The {main_feature_name} operation is executing.", "user_canceled": "User canceled the task.", "main_copy": "Copy", @@ -334,6 +405,8 @@ "feature_unavailable": "Feature unavailable.", "system_requirements_checking": "Checking system requirements...", "failed_to_set_dpi_awareness": "Failed to set DPI awareness.", + "illegal_language_files_title": "Illegal Language File", + "illegal_language_files": "This language file is not legal, please try another language file.", "see_term_of_use_and_privacy": "By using MSPCManagerHelper, you signify that you have read and agree to the `Terms of Use` and `Privacy Policy`, otherwise, please exit and delete the software.", "tips_run_as_dev_mode": "Run with `/DevMode` or `-DevMode` parameter to enable developer mode.", "excessive_waiting_time": "If the wait time is too long, please be patient or cancel the task and try again." diff --git a/locales/zh-cn.json b/locales/zh-cn.json index 9132fe5..4b198a2 100644 --- a/locales/zh-cn.json +++ b/locales/zh-cn.json @@ -6,20 +6,28 @@ "lang_zh-tw": "中文 (繁體)", "lang_custom": "加载语言...", + + "@Contributors": "Contributors", "localization_translators_name": "MSPCManagerHelper", "project_contributors_name": "GuCATs, ArcticFoxPro, LuYang114 及其他社群志愿者们", + + "@checkSystemRequirements.py": "checkSystemRequirements.py", "failure_to_meet_system_requirements": "当前 Windows 版本不满足微软电脑管家最低要求:\nWindows 10 版本 19042 或 Windows Server 2022", "meet_system_requirements": "当前系统符合微软电脑管家最低系统要求", + + "@getVersionNumber": "getVersionNumber.py", "cannot_read_pc_manager_version": "无法读取微软电脑管家版本信息", "current_pc_manager_version": "当前微软电脑管家版本号", "current_pc_manager_beta_version": "当前微软电脑管家公测版版本号", "pc_manager_beta_installed": "微软电脑管家公测版已安装,版本号", + + "@mainFeature.py": "mainFeature.py", "repair_pc_manager_notice": "提示 - 修复微软电脑管家无法安装 / 打开", "repair_pc_manager_to_perform": "是否修复微软电脑管家无法安装 / 打开?此操作会直接卸载所有版本的微软电脑管家,清理配置文件和残留,并修复 Microsoft Edge (WebView2 Runtime) 无法安装的问题。", @@ -66,6 +74,8 @@ "clearing_pc_manager_logs_success": "成功清理微软电脑管家日志源文件夹。", "clearing_pc_manager_logs_error": "清理微软电脑管家日志源文件夹时出错", + + "@installationFeature.py": "installationFeature.py", "winget_not_installed": "WinGet 尚未安装,请使用其他解决方案。\n您可以通过 Microsoft Learn (https://learn.microsoft.com/windows/msix/app-installer/install-update-app-installer/?wt.mc_id=studentamb_265231) 或 GitHub (https://github.com/microsoft/winget-cli/releases) 下载并安装 Windows Package Manager 后重试。", "winget_source_not_found": "未找到 msstore 源。", @@ -87,10 +97,12 @@ "winget_not_error_code": "WinGet 未提供错误代码。", "winget_output": "WinGet 输出信息", "winget_not_output": "WinGet 未提供输出信息。", + "download_from_msstore_site_opened": "已打开微软电脑管家 Microsoft Store 页面。\n当前 Microsoft Store 尚未安装,可以通过“wsreset.exe -i”命令来在线下载并重置 Microsoft Store。或通过 https://get.microsoft.com/installer/download/9PM860492SZD 来获取微软电脑管家在线安装包。", "download_from_msstore_site_error": "打开微软电脑管家 Microsoft Store 页面时出错", "download_from_msstore_app_opened": "已从 Microsoft Store 打开微软电脑管家详情页。", "download_from_msstore_app_error": "从 Microsoft Store 打开微软电脑管家详情页时出错", + "install_for_all_users_no_file_selected": "未选择任何文件。", "install_for_all_users_license_select_notice": "选择许可证文件", "install_for_all_users_license_select": "是否选择微软电脑管家的许可证文件?这在无互联网连接时将很有效。", @@ -98,11 +110,13 @@ "install_for_all_users_dependency_package_select": "是否选择微软电脑管家的依赖包文件?如果您正在安装 3.14.0.0 及更高版本则是必要的。", "install_for_all_users_success": "为 所有用户 安装微软电脑管家成功。", "install_for_all_users_error": "为 所有用户 安装微软电脑管家时出错", + "install_for_current_user_no_file_selected": "未选择任何文件。", "install_for_current_user_dependency_package_select_notice": "选择依赖包文件", "install_for_current_user_dependency_package_select": "是否选择微软电脑管家的依赖包文件?如果您正在安装 3.14.0.0 及更高版本则是必要的。", "install_for_current_user_success": "为 当前用户 安装微软电脑管家成功。", "install_for_current_user_error": "为 当前用户 安装微软电脑管家时出错", + "ask_whether_to_reinstall_for_all_users": "是否为 所有用户 重新安装微软电脑管家", "whether_to_reinstall_for_all_users": "如果需要为 所有用户 重新安装,请按下“是”;如果需要为 当前用户 重新安装,请按下“否”。", "reinstall_pc_manager_success": "重新安装微软电脑管家成功。", @@ -111,24 +125,34 @@ "reintsall_pc_manager_error_code_1": "拒绝访问。请尝试重新以管理员身份运行。", "reintsall_pc_manager_error_code_2": "应用包清单文件 (AppxManifest.xml) 出现问题,请尝试卸载微软电脑管家后重新安装。", "reintsall_pc_manager_error_code_0x80073D02": "无法安装程序包,原因是它修改的资源当前正在使用中。请退出微软电脑管家后重试。", + "update_from_application_package_no_file_selected": "未选择任何文件。", "update_from_application_package_dependency_package_select_notice": "选择依赖包文件", "update_from_application_package_dependency_package_select": "是否选择微软电脑管家的依赖包文件?如果您正在安装 3.14.0.0 及更高版本则是必要的。", "update_from_application_package_success": "从 应用程序包 更新微软电脑管家成功。", "update_from_application_package_error": "从 应用程序包 更新微软电脑管家时出错", + "install_from_appxmanifest_warn_title": "警告", "install_from_appxmanifest_warn": "如果您先前使用过此功能安装微软电脑管家,请卸载微软电脑管家后再使用此功能。您想要继续安装吗?此功能尚不稳定,缺少调试输出,请确保您已备份数据,并具有一定的调试能力。", "install_from_appxmanifest_no_file_selected": "未选择任何文件。", + "install_from_appxmanifest_copying_files": "正在复制文件...", + "install_from_appxmanifest_unzipping_files": "正在解压文件...", "install_from_appxmanifest_no_match_architecture": "未找到与当前电脑匹配的版本。", "install_from_appxmanifest_no_match_pc_manager_architecture": "未在应用程序包中找到符合的架构。请查明当前应用程序包的架构后,将其重命名为包含架构名称的应用程序包后重试。(如 x64 或 arm64)", + "install_from_appxmanifest_modifying_appxmanifest": "正在修改应用包清单 (AppxManifest.xml)...", "install_from_appxmanifest_dependency_package_select_notice": "选择依赖包文件", "install_from_appxmanifest_dependency_package_select": "是否选择微软电脑管家的依赖包文件?如果您正在安装 3.14.0.0 及更高版本则是必要的。", + "install_from_appxmanifest_installing_dependency_package": "正在安装依赖包...", + "install_from_appxmanifest_registering_app": "正在注册应用程序...", "install_from_appxmanifest_register_svc_notice": "注册微软电脑管家服务", "install_from_appxmanifest_register_svc": "是否注册微软电脑管家服务?如果服务已注册则无需再次注册。", + "install_from_appxmanifest_registering_svc": "正在注册服务...", "install_from_appxmanifest_svc_exists_warning": "服务警告", "install_from_appxmanifest_svc_exists": "微软电脑管家服务已存在。", + "install_from_appxmanifest_cleaning_up": "正在清理...", "install_from_appxmanifest_success": "从 应用包清单 安装微软电脑管家成功。", "install_from_appxmanifest_error": "从 应用包清单 安装微软电脑管家时出错", + "wv2_runtime_install_success": "Microsoft Edge WebView2 Runtime 安装成功。", "wv2_runtime_installer_download_link": "如果您需要单独保存一份 Microsoft Edge WebView2 Runtime 安装程序,请访问 https://developer.microsoft.com/microsoft-edge/webview2/?wt.mc_id=studentamb_265231 并选择 x64 或 ARM64 的“常青独立安装程序”以下载。", "wv2_installer_exit_code": "Microsoft Edge WebView2 Runtime 安装程序退出代码", @@ -140,6 +164,8 @@ "wv2_installer_error": "Microsoft Edge WebView2 Runtime 安装错误。", "wv2_installation_cancelled": "用户已取消 Microsoft Edge WebView2 Runtime 安装。", + + "@uninstallationFeaure.py": "uninstallationFeaure.py", "error_getting_nsudo_path": "获取 NSudoLC 路径时出错", "uninstall_for_all_users_in_dism_success": "通过 DISM 为 所有用户 卸载微软电脑管家成功。", @@ -166,6 +192,7 @@ "uninstall_for_all_users_in_dism_error_code": "错误代码", "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": "为 所有用户 卸载微软电脑管家时出错", "cleanup_config_and_files_notice_for_all_users": "清理配置文件和残留", @@ -189,6 +216,7 @@ "uninstall_and_cleanup_for_all_users_success": "为 所有用户 卸载微软电脑管家并清理配置文件和残留成功。", "uninstall_for_all_users_error_code": "错误代码", "uninstall_for_all_users_error_code_1": "卸载失败,请尝试重新以管理员身份运行。若以管理员身份运行后仍然有此问题,请尝试使用“通过 DISM 为 所有用户 卸载微软电脑管家”。", + "uninstall_for_current_user_success": "为 当前用户 卸载微软电脑管家成功。", "uninstall_for_current_user_error": "为 当前用户 卸载微软电脑管家时出错", "cleanup_config_and_files_notice_for_current_user": "清理配置文件和残留", @@ -201,9 +229,10 @@ "clearing_other_files_for_current_user": "正在清理其他残留", "fail_to_clear_other_files_for_current_user": "清理其他残留时出错", "fail_to_clear_other_files_info_for_current_user": "错误信息", - "uninstall_and_cleanup_for_current_user_success": "为 所有用户 卸载微软电脑管家并清理配置文件和残留成功。", + "uninstall_and_cleanup_for_current_user_success": "为 当前用户 卸载微软电脑管家并清理配置文件和残留成功。", "uninstall_for_current_user_error_code": "错误代码", "uninstall_for_current_user_error_code_1": "卸载失败,请尝试重新以管理员身份运行。若以管理员身份运行后仍然有此问题,请尝试使用“通过 DISM 为 所有用户 卸载微软电脑管家”。", + "pc_manager_beta_not_found": "微软电脑管家公测版尚未安装。", "cleanup_pc_manager_beta_config_and_files_notice": "清理配置文件和残留", "cleanup_pc_manager_beta_config_and_files": "是否清理微软电脑管家公测版配置文件和残留?", @@ -219,6 +248,8 @@ "uninstall_pc_manager_beta_error_info": "卸载微软电脑管家时遇到的错误信息", "uninstalled_cleanup_pc_manager_beta_config_and_files": "已卸载微软电脑管家公测版并清理配置文件和残留。", + + "@otherFeature.py": "otherFeature.py", "display_name": "产品名称", "path_to_signed_product_exe": "产品注册路径", @@ -227,14 +258,19 @@ "no_results": "未能获取到任何结果。", "powershell_not_found": "无法启动 PowerShell 进程。", "powershell_error": "执行 PowerShell 脚本时出错", + "developer_options_opened": "开发者选项已打开。", "developer_options_error": "打开开发者选项时出错", + "repair_edge_wv2_setup_error": "修复 Microsoft Edge (WebView2 Runtime) 无法安装 时出错", "repair_edge_wv2_setup_completed": "修复 Microsoft Edge (WebView2 Runtime) 无法安装 完成。", + "pc_manager_docs_opened": "微软电脑管家常见问题解答已打开。", "pc_manager_docs_error": "打开微软电脑管家常见问题解答时出错", + "join_preview_program_opened": "微软电脑管家预览体验计划表单已打开。", "join_preview_program_error": "打开微软电脑管家预览体验计划表单时出错", + "stopping_pc_manager_service": "正在停止微软电脑管家服务。", "stop_pc_manager_service_error": "停止微软电脑管家服务时出错", "starting_pc_manager_service": "正在启动微软电脑管家服务。", @@ -244,6 +280,7 @@ "pc_manager_service_error_code_5": "操作失败,请尝试重新以管理员身份运行。", "pc_manager_service_error_code_1056": "此服务的实例已在运行,请重新执行操作。", "pc_manager_service_error_code_1060": "微软电脑管家服务未安装。", + "ask_if_version_above_3_14_0_0": "检查微软电脑管家版本", "select_pc_manager_version": "当前微软电脑管家是否为 3.14.0.0 及更高版本?\n如果是,请按下“是”;如果不是,请按下“否”。", "how_to_switch_pc_manager_region": "请在弹出的设置中,将“国家或地区”切换为您想要设置的区域,并重启微软电脑管家。\n切换完成后若区域再次被更改,可能会导致微软电脑管家区域再次被切换。", @@ -257,38 +294,66 @@ "get_current_pc_manager_region_error": "获取当前微软电脑管家地区时出错", "restart_pc_manager_to_apply_changes": "请重启微软电脑管家以应用更改。", "switch_region_error": "切换微软电脑管家地区时出错", + "no_compute_files_selected": "未选择任何文件。", "path_to_compute_files": "文件路径", "compute_files_hash_success": "计算文件哈希值完成。", "compute_files_hash_error": "计算文件哈希值时出错", + "system_msedge_webview2_version": "当前系统 Microsoft Edge WebView2 Runtime 版本", "user_msedge_webview2_version": "当前用户 Microsoft Edge WebView2 Runtime 版本", "get_msedge_webview2_version_powershell_error": "获取系统 Microsoft Edge WebView2 Runtime 版本时出错", "msedge_webview2_version_registry_key_not_found": "未找到用户 Microsoft Edge WebView2 Runtime 注册表项", "get_msedge_webview2_version_registry_error": "获取用户 Microsoft Edge WebView2 Runtime 版本时出错", + + "@topMenu.py": "topMenu.py", - "top_menu_files_access_key": "文件(F)", + "top_menu_files": "文件", "top_menu_files_exit": "退出", - "top_menu_update_access_key": "下载与更新(U)", + + "top_menu_update": "下载与更新", "top_menu_update_GitHub": "从 GitHub 获取最新版 MSPCManagerHelper", "top_menu_update_OneDrive": "从 OneDrive 获取最新版 MSPCManagerHelper", "top_menu_update_LiCaoZ_Azure_Blob_PC_Manager": "从 Azure Blob 获取微软电脑管家最新快速预览版应用程序包", "top_menu_update_OneDrive_PC_Manager": "从 OneDrive 获取微软电脑管家最新版应用程序包与许可证文件", "top_menu_update_WindowsAppRuntime": "从 Microsoft Learn 获取 Windows App Runtime", - "top_menu_term_of_use_and_privacy_access_key": "使用条款与隐私政策(T)", + + "top_menu_term_of_use_and_privacy": "使用条款与隐私政策", "top_menu_term_of_use": "使用条款", "top_menu_privacy": "隐私政策", "TermOfUse_context": "MSPCManagerHelper 使用条款\n\n欢迎使用 MSPCManagerHelper(以下简称“本软件”)。在使用本软件之前,请仔细阅读以下使用条款(以下简称“条款”)。通过下载、安装或使用本软件,即表示您同意遵守这些条款。如果您不同意这些条款,请勿使用本软件。若条款有更新,恕不另行通知。\n\n条款修改日期:2024 年 12 月 22 日\n\n1. 许可使用\n本软件由个人开发者 GuCATs(以下简称“开发者”)授权您个人、非商业性使用。您不得复制、修改、分发、出售或出租本软件的任何部分,除非获得开发者的书面许可。\n\n2. 知识产权\n本软件及其所有内容(包括但不限于文本、图像、图标、界面、代码和商标)均受版权法和其他知识产权法的保护。开发者保留所有未明确授予的权利。\n\n3. 用户责任\n您同意在使用本软件时遵守所有适用的法律法规。您不得使用本软件进行任何非法活动或侵犯他人权利的行为。\n\n4. 隐私政策\n开发者尊重您的隐私权,并致力于保护您的个人信息。有关我们如何收集、使用和保护您的信息的详细信息,请参阅我们的[隐私政策]。\n\n5. 免责声明\n本软件按“现状”提供,不提供任何形式的明示或暗示的保证,包括但不限于适销性、特定用途适用性和非侵权性。开发者不保证本软件的功能将满足您的要求,或本软件的操作将不间断或无错误。因使用本软件引起的任何问题,开发者概不负责。\n\n6. 责任限制\n在适用法律允许的最大范围内,开发者不对因使用或无法使用本软件而导致的任何直接、间接、附带、特殊或后果性损害承担责任,即使开发者已被告知可能发生此类损害。\n\n7. 条款修改\n开发者保留随时修改这些条款的权利。修改后的条款将在本软件或开发者的网站上发布后立即生效。您继续使用本软件即表示您接受修改后的条款。\n\n8. 终止\n如果您违反这些条款,开发者有权立即终止您使用本软件的许可,且无需事先通知。\n\n9. 适用法律\n这些条款受[国家/地区]法律管辖,不考虑其法律冲突原则。\n\n10. 开源协议\n本软件使用 MIT 开源协议。您可以在[MIT 许可证](https://github.com/Goo-aw233/MSPCManagerHelper/blob/main/LICENSE.txt)中查看详细信息。\n\n11. 第三方软件\n[NSudo](https://github.com/M2TeamArchived/NSudo)。\n[Sysinternals](https://learn.microsoft.com/sysinternals/license-terms/?wt.mc_id=studentamb_265231)。", "Privacy_context": "MSPCManagerHelper 隐私政策\n\nMSPCManagerHelper (以下简称“本软件”)不会以任何形式采集并上传任何数据,包括但不限于计算机识别符、地理信息等。\n\n在您访问部分链接时(如 learn.microsoft.com/?wt.mc_id=studentamb_265231),会使用微软学生大使的跟踪符,以帮助开发者统计访客数量。", - "top_menu_help_access_key": "帮助(H)", + + "top_menu_help": "帮助", "top_menu_help_about": "关于", "top_menu_help_gethelp": "获取帮助", "top_menu_help_official_site": "官方网站", "top_menu_help_more_contact": "更多联系方式", + "translation_author": "翻译人员", "project_contributors": "项目贡献者", + + + "@access_key": "access_key", + "top_menu_files_access_key": "(F)", + "top_menu_files_exit_access_key": "(E)", + + "top_menu_update_access_key": "(U)", + + "top_menu_term_of_use_and_privacy_access_key": "(T)", + "top_menu_term_of_use_access_key": "(T)", + "top_menu_privacy_access_key": "(P)", + + "top_menu_help_access_key": "(H)", + "top_menu_help_about_access_key": "(A)", + "top_menu_help_gethelp_access_key": "(G)", + "top_menu_help_official_site_access_key": "(O)", + "top_menu_help_more_contact_access_key": "(M)", + + + "@mainWindow.py": "mainWindow.py", "refresh": "刷新", "notice_select_option": "请选择 (带 * 的功能不需要以管理员身份运行)", @@ -297,25 +362,30 @@ "main_cancel_button": "取消", "run_as_administrator": "以管理员身份运行", "run_as_administrator_error": "以管理员身份运行失败", + "main_project": "主要项目", "install_project": "安装项目", "uninstall_project": "卸载项目", "other_project": "其他项目", + "repair_pc_manager": "修复微软电脑管家无法安装 / 打开", "get_pc_manager_logs": "获取微软电脑管家日志", "debug_dev_mode": "开发者调试模式", + "download_from_winget": "从 WinGet 下载微软电脑管家 (msstore 源)", "download_from_msstore": "* 从 Microsoft Store 下载微软电脑管家", "install_for_all_users": "为 所有用户 安装微软电脑管家", "install_for_current_user": "为 当前用户 安装微软电脑管家", "reinstall_pc_manager": "重新安装微软电脑管家", "update_from_application_package": "从 应用程序包 更新微软电脑管家", - "install_from_appxmanifest" : "从 应用包清单 安装微软电脑管家", + "install_from_appxmanifest" : "从 应用包清单 (AppxManifest.xml) 安装微软电脑管家", "install_wv2_runtime": "安装 Microsoft Edge WebView2 Runtime", + "uninstall_for_all_users_in_dism": "通过 DISM 为 所有用户 卸载微软电脑管家", "uninstall_for_all_users": "为 所有用户 卸载微软电脑管家", "uninstall_for_current_user": "为 当前用户 卸载微软电脑管家", "uninstall_pc_manager_beta": "卸载微软电脑管家公测版", + "view_installed_antivirus": "* 查看当前电脑已安装的防病毒软件", "developer_options": "* 开发者选项", "repair_edge_wv2_setup": "修复 Microsoft Edge (WebView2 Runtime) 无法安装", @@ -325,6 +395,7 @@ "switch_pc_manager_region": "切换微软电脑管家地区", "compute_files_hash": "* 计算文件哈希值", "get_msedge_webview2_version": "* 获取 Microsoft Edge WebView2 Runtime 版本", + "warning": "警告", "select_function": "请选择要执行的功能", "main_executing_operation": "正在执行 {main_feature_name} 的操作。", @@ -334,6 +405,8 @@ "feature_unavailable": "功能不可用。", "system_requirements_checking": "系统要求检测中...", "failed_to_set_dpi_awareness": "无法设置 DPI 感知性。", + "illegal_language_files_title": "非法的语言文件", + "illegal_language_files": "该语言文件不合法,请尝试其他语言文件。", "see_term_of_use_and_privacy": "使用 MSPCManagerHelper 即代表您已阅读并同意《使用条款》与《隐私政策》,否则,请退出软件并删除。", "tips_run_as_dev_mode": "以“/DevMode”或“-DevMode”参数运行以启动开发者模式。", "excessive_waiting_time": "若等候时间过长,请耐心等待,或取消任务后重试。" diff --git a/locales/zh-tw.json b/locales/zh-tw.json index 96fdc96..18c0e11 100644 --- a/locales/zh-tw.json +++ b/locales/zh-tw.json @@ -6,20 +6,28 @@ "lang_zh-tw": "中文 (繁體)", "lang_custom": "載入語言...", + + "@Contributors": "Contributors", "localization_translators_name": "吳宥叡", "project_contributors_name": "GuCATs, ArcticFoxPro, LuYang114 及其他社群志工們", + + "@checkSystemRequirements.py": "checkSystemRequirements.py", "failure_to_meet_system_requirements": "目前 Windows 版本不符合 Microsoft 電腦管家的最低需求:\nWindows 10 Version 19042 或 Windows Server 2022", "meet_system_requirements": "目前系統符合 Microsoft 電腦管家最低系統需求", + + "@getVersionNumber": "getVersionNumber.py", "cannot_read_pc_manager_version": "無法擷取 Microsoft 電腦管家版本資訊", "current_pc_manager_version": "目前 Microsoft 電腦管家版本號", "current_pc_manager_beta_version": "目前 Microsoft 電腦管家 Beta 版本號", "pc_manager_beta_installed": "Microsoft 電腦管家 Beta 已安裝,版本號", + + "@mainFeature.py": "mainFeature.py", "repair_pc_manager_notice": "提醒 - 修正 Microsoft 電腦管家無法安裝 / 開啟", "repair_pc_manager_to_perform": "是否修正 Microsoft 電腦管家無法安裝 / 開啟?此操作會直接解除安裝所有版本的 Microsoft 電腦管家,清理設定和殘留檔案,並修正 Microsoft Edge (WebView2 執行階段) 無法安裝的問題。", @@ -66,6 +74,8 @@ "clearing_pc_manager_logs_success": "成功清理 Microsoft 電腦管家記錄檔源資料夾。", "clearing_pc_manager_logs_error": "清理 Microsoft 電腦管家記錄檔源資料夾時發生錯誤", + + "@installationFeature.py": "installationFeature.py", "winget_not_installed": "WinGet 尚未安裝,請嘗試使用其他解決方案。您可以前往 Microsoft Learn (https://learn.microsoft.com/windows/msix/app-installer/install-update-app-installer/?wt.mc_id=studentamb_265231) 或 或 GitHub (https://github.com/microsoft/winget-cli/releases) 下載並安裝 Windows Package Manager 後重試。", "winget_source_not_found": "未找到 msstore 來源。", @@ -87,10 +97,12 @@ "winget_not_error_code": "WinGet 未提供錯誤代碼。", "winget_output": "WinGet 輸出資訊", "winget_not_output": "WinGet 未提供輸出資訊。", + "download_from_msstore_site_opened": "已開啟 Microsoft 電腦管家 Microsoft Store 頁面。\n目前 Microsoft Store 尚未安裝,可以透過“wsreset.exe -i”命令來在線下載並重設 Microsoft Store。或透過 https://get.microsoft.com/installer/download/9PM860492SZD 來讀取 Microsoft 電腦管家在線安裝包。", "download_from_msstore_site_error": "開啟 Microsoft 電腦管家 Microsoft Store 頁面時發生錯誤", "download_from_msstore_app_opened": "已從 Microsoft Store 開啟 Microsoft 電腦管家詳情頁。", "download_from_msstore_app_error": "從 Microsoft Store 開啟 Microsoft 電腦管家詳情頁時發生錯誤", + "install_for_all_users_no_file_selected": "未選取授權檔案。", "install_for_all_users_license_select_notice": "選取授權檔案", "install_for_all_users_license_select": "是否選取 Microsoft 電腦管家的授權檔案?這在沒有網路連線時將很有效。", @@ -98,11 +110,13 @@ "install_for_all_users_dependency_package_select": "是否選取 Microsoft 電腦管家的套件檔案?如果您正在安裝 3.14.0.0 及更高版本則是必要的。", "install_for_all_users_success": "為 所有使用者 安裝 Microsoft 電腦管家成功。", "install_for_all_users_error": "為 所有使用者 安裝 Microsoft 電腦管家時發生錯誤", + "install_for_current_user_no_file_selected": "未選取任何檔案。", "install_for_current_user_dependency_package_select_notice": "選取套件檔案", "install_for_current_user_dependency_package_select": "是否選取 Microsoft 電腦管家的套件檔案?如果您正在安裝 3.14.0.0 及更高版本則是必要的。", "install_for_current_user_success": "為 目前使用者 安裝 Microsoft 電腦管家成功。", "install_for_current_user_error": "為 目前使用者 安裝 Microsoft 電腦管家時發生錯誤", + "ask_whether_to_reinstall_for_all_users": "是否為 所有使用者 重新安裝 Microsoft 電腦管家", "whether_to_reinstall_for_all_users": "如果需要為 所有使用者 重新安裝,請按下「是」;如果需要為 當前用戶 重新安裝,請按下「否」。", "reinstall_pc_manager_success": "重新安裝 Microsoft 電腦管家成功。", @@ -111,24 +125,34 @@ "reintsall_pc_manager_error_code_1": "拒絕存取。請嘗試重新以系統管理員身分執行", "reintsall_pc_manager_error_code_2": "應用程式資訊清單 (AppxManifest.xml) 出現問題,請嘗試解除安裝 Microsoft 電腦管家後重新安裝。", "reintsall_pc_manager_error_code_0x80073D02": "無法安裝套件,因為它修改的資源目前已在使用中。請結束 Microsoft 電腦管家後重試。", + "update_from_application_package_no_file_selected": "未選取任何檔案。", "update_from_application_package_dependency_package_select_notice": "選取套件檔案", "update_from_application_package_dependency_package_select": "是否選取 Microsoft 電腦管家的套件檔案?如果您正在安裝 3.14.0.0 及更高版本則是必要的。", "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_no_file_selected": "未選取任何檔案。", + "install_from_appxmanifest_copying_files": "正在複製檔案...", + "install_from_appxmanifest_unzipping_files": "正在解壓縮檔案...", "install_from_appxmanifest_no_match_architecture": "未找到與目前電腦匹配的版本。", "install_from_appxmanifest_no_match_pc_manager_architecture": "未在應用程式套件中找到符合的架構。請查明目前應用程式套件的架構後,將其重新命名為包含架構名稱的應用程式套件後重試。(如 x64 或 arm64)", + "install_from_appxmanifest_modifying_appxmanifest": "正在修改應用程式資訊清單 (AppxManifest.xml)...", "install_from_appxmanifest_dependency_package_select_notice": "選取套件檔案", "install_from_appxmanifest_dependency_package_select": "是否選取 Microsoft 電腦管家的套件檔案?如果您正在安裝 3.14.0.0 及更高版本則是必要的。", + "install_from_appxmanifest_installing_dependency_package": "正在安裝套件檔案...", + "install_from_appxmanifest_registering_app": "正在註冊應用程式...", "install_from_appxmanifest_register_svc_notice": "註冊 Microsoft 電腦管家服務", "install_from_appxmanifest_register_svc": "是否要註冊 Microsoft 電腦管家服務?如果服務已經註冊則無需再次註冊。", + "install_from_appxmanifest_registering_svc": "正在註冊服務...", "install_from_appxmanifest_svc_exists_warning": "服務警告", "install_from_appxmanifest_svc_exists": "Microsoft 電腦管家服務已存在。", + "install_from_appxmanifest_cleaning_up": "正在清理...", "install_from_appxmanifest_success": "從 應用程式資訊清單 安裝 Microsoft 電腦管家成功。", "install_from_appxmanifest_error": "從 應用程式資訊清單 安裝 Microsoft 電腦管家時發生錯誤", + "wv2_runtime_install_success": "Microsoft Edge WebView2 執行階段 安裝成功。", "wv2_runtime_installer_download_link": "如果您需要單獨保存一份 Microsoft Edge WebView2 執行階段安裝程式,請前往 https://developer.microsoft.com/microsoft-edge/webview2/?wt.mc_id=studentamb_265231 並選取 x64 或 ARM64 的“常青獨立安裝程式”以下載。", "wv2_installer_exit_code": "Microsoft Edge WebView2 執行階段 安裝程式結束代碼", @@ -140,6 +164,8 @@ "wv2_installer_error": "Microsoft Edge WebView2 執行階段 安裝錯誤。", "wv2_installation_cancelled": "使用者已取消 Microsoft Edge WebView2 執行階段 安裝。", + + "@uninstallationFeaure.py": "uninstallationFeaure.py", "error_getting_nsudo_path": "取得 NSudoLC 路徑時發生錯誤", "uninstall_for_all_users_in_dism_success": "透過 DISM 為 所有使用者 解除安裝 Microsoft 電腦管家成功。", @@ -166,6 +192,7 @@ "uninstall_for_all_users_in_dism_error_code": "錯誤代碼", "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 電腦管家時發生錯誤", "cleanup_config_and_files_notice_for_all_users": "清理設定檔和殘留", @@ -189,6 +216,7 @@ "uninstall_and_cleanup_for_all_users_success": "為 所有使用者 解除安裝 Microsoft 電腦管家並清理設定檔和殘留成功。", "uninstall_for_all_users_error_code": "錯誤代碼", "uninstall_for_all_users_error_code_1": "解除安裝失敗,請嘗試重新以系統管理員身分執行。若以系統管理員身分執行後仍然有此問題,請嘗試使用「透過 DISM 為 所有使用者 解除安裝 Microsoft 電腦管家」。", + "uninstall_for_current_user_success": "為 目前使用者 解除安裝 Microsoft 電腦管家時成功。", "uninstall_for_current_user_error": "為 目前使用者 解除安裝 Microsoft 電腦管家時發生錯誤", "cleanup_config_and_files_notice_for_current_user": "清理設定檔和殘留", @@ -201,9 +229,10 @@ "clearing_other_files_for_current_user": "正在清理其他殘留", "fail_to_clear_other_files_for_current_user": "清理其他殘留時發生錯誤", "fail_to_clear_other_files_info_for_current_user": "錯誤資訊", - "uninstall_and_cleanup_for_current_user_success": "為 所有使用者 解除安裝 Microsoft 電腦管家並清理設定檔和殘留成功。", + "uninstall_and_cleanup_for_current_user_success": "為 目前使用者 解除安裝 Microsoft 電腦管家並清理設定檔和殘留成功。", "uninstall_for_current_user_error_code": "錯誤代碼", "uninstall_for_current_user_error_code_1": "解除安裝失敗,請嘗試重新以系統管理員身分執行。若以系統管理員身分執行後仍然有此問題,請嘗試使用「透過 DISM 為 所有使用者 解除安裝 Microsoft 電腦管家」。", + "pc_manager_beta_not_found": "Microsoft 電腦管家 Beta 尚未安裝。", "cleanup_pc_manager_beta_config_and_files_notice": "清理設定檔和殘留", "cleanup_pc_manager_beta_config_and_files": "是否清理 Microsoft 電腦管家 Beta 設定檔和殘留?", @@ -219,6 +248,8 @@ "uninstall_pc_manager_beta_error_info": "解除安裝 Microsoft 電腦管家時遇到的錯誤資訊", "uninstalled_cleanup_pc_manager_beta_config_and_files": "已解除安裝 Microsoft 電腦管家 Beta 並清理設定檔和殘留。", + + "@otherFeature.py": "otherFeature.py", "display_name": "產品名稱", "path_to_signed_product_exe": "產品註冊路徑", @@ -227,14 +258,19 @@ "no_results": "未能取得到任何結果。", "powershell_not_found": "無法啟動 PowerShell 程式。", "powershell_error": "執行 PowerShell 指令碼時發生錯誤", + "developer_options_opened": "開發人員專用已開啟。", "developer_options_error": "開啟開發人員專用時發生錯誤", + "repair_edge_wv2_setup_error": "修正 Microsoft Edge (WebView2 執行階段) 無法安裝 時發生錯誤", "repair_edge_wv2_setup_completed": "修正 Microsoft Edge (WebView2 執行階段) 無法安裝 完成。", + "pc_manager_docs_opened": "Microsoft 電腦管家常見問題已開啟。", "pc_manager_docs_error": "開啟 Microsoft 電腦管家常見問題時發生錯誤", + "join_preview_program_opened": "Microsoft 電腦管家測試人員計劃表單已開啟。", "join_preview_program_error": "開啟 Microsoft 電腦管家測試人員計劃表單時發生錯誤", + "stopping_pc_manager_service": "正在停止 Microsoft 電腦管家服務。", "stop_pc_manager_service_error": "停止 Microsoft 電腦管家服務時發生錯誤", "starting_pc_manager_service": "正在啟動 Microsoft 電腦管家服務。", @@ -244,6 +280,7 @@ "pc_manager_service_error_code_5": "操作失敗,請嘗試重新以系統管理員身分執行。", "pc_manager_service_error_code_1056": "此服務的實例已在〞ˊ型,請重新執行操作。", "pc_manager_service_error_code_1060": "Microsoft 電腦管家服務未安裝。", + "ask_if_version_above_3_14_0_0": "檢查 Microsoft 電腦管家版本", "select_pc_manager_version": "目前 Microsoft 電腦管家是否為 3.14.0.0 及更高版本?\n如果是,請按下「是」;如果不是,請按下「否」。", "how_to_switch_pc_manager_region": "請在彈出的設定中,將“國家/地區”切換為您想要設定的地區,並重啟 Microsoft 電腦管家。\n切換完成後若地區再次被更改,可能會導致 Microsoft 電腦管家地區再次被切換。", @@ -257,38 +294,66 @@ "get_current_pc_manager_region_error": "擷取目前 Microsoft 電腦管家地區時發生錯誤", "restart_pc_manager_to_apply_changes": "請重啟 Microsoft 電腦管家以套用變更。", "switch_region_error": "切換 Microsoft 電腦管家地區時發生錯誤", + "no_compute_files_selected": "未選取任何檔案。", "path_to_compute_files": "檔案路徑", "compute_files_hash_success": "計算檔案雜湊函式完成。", "compute_files_hash_error": "計算檔案雜湊函式時發生錯誤", + "system_msedge_webview2_version": "系統 Microsoft Edge WebView2 執行階段 版本", "user_msedge_webview2_version": "使用者 Microsoft Edge WebView2 執行階段 版本", "get_msedge_webview2_version_powershell_error": "擷取 Microsoft Edge WebView2 執行階段 版本時發生錯誤", "msedge_webview2_version_registry_key_not_found": "未找到使用者 Microsoft Edge WebView2 執行階段 版本的登錄項目", "get_msedge_webview2_version_registry_error": "擷取使用者 Microsoft Edge WebView2 執行階段 版本的登錄項目時發生錯誤", + + "@topMenu.py": "topMenu.py", - "top_menu_files_access_key": "檔案(F)", + "top_menu_files": "檔案", "top_menu_files_exit": "結束", - "top_menu_update_access_key": "檢查更新與下載(U)", + + "top_menu_update": "檢查更新與下載", "top_menu_update_GitHub": "從 GitHub 讀取最新版 MSPCManagerHelper", "top_menu_update_OneDrive": "從 OneDrive 讀取最新版 MSPCManagerHelper", "top_menu_update_LiCaoZ_Azure_Blob_PC_Manager": "從 Azure Blob 讀取 Microsoft 電腦管家最新版快速預覽版應用程式套件", "top_menu_update_OneDrive_PC_Manager": "從 OneDrive 讀取 Microsoft 電腦管家最新版應用程式套件與授權檔案", "top_menu_update_WindowsAppRuntime": "從 Microsoft Learn 讀取 Windows App Runtime", - "top_menu_term_of_use_and_privacy_access_key": "使用規定與隱私權聲明(T)", + + "top_menu_term_of_use_and_privacy": "使用規定與隱私權聲明", "top_menu_term_of_use": "使用規定", "top_menu_privacy": "隱私權聲明", "TermOfUse_context": "MSPCManagerHelper 使用規定\n\n歡迎使用 MSPCManagerHelper(以下簡稱“本軟體”)。在使用本軟體之前,請仔細閱讀以下使用規定(以下簡稱「條款」)。通過下載、安裝或使用本軟體,即表示您同意遵守這些條款。如果您不同意這些條款,請勿使用本軟體。若條款有更新,恕不另行通知。\n\n條款更新日期:2024 年 12 月 22 日\n\n1. 許可使用\n本軟體由個人開發者 GuCATs(以下簡稱“開發者”)授權您個人、非商業性使用。您不得複製、修改、分發、出售或出租本軟體的任何部分,除非獲得開發者的書面許可。\n\n2. 智慧財產權\n本軟體及其所有內容(包括但不限於文本、圖像、圖示、界面、代碼和商標)均受版權法和其他智慧財產權法的保護。開發者保留所有未明確授予的權利。\n\n3. 用戶責任\n您同意在使用本軟體時遵守所有適用的法律法規。您不得使用本軟體進行任何非法活動或侵犯他人權利的行為。\n\n4. 隱私權聲明\n開發者尊重您的隱私權,並致力於保護您的個人資訊。有關我們如何收集、使用和保護您的資訊的詳細資訊,請參閱我們的[隱私權聲明]。\n\n5. 免責聲明\n本軟體按“現狀”提供,不提供任何形式的明示或暗示的保證,包括但不限於適銷性、特定用途適用性和非侵權性。開發者不保證本軟體的功能將滿足您的要求,或本軟體的操作將不間斷或無錯誤。因使用本軟體引起的任何問題,開發者概不負責。\n\n6. 責任限制\n在適用法律允許的最大範圍內,開發者不對因使用或無法使用本軟體而導致的任何直接、間接、附帶、特殊或後果性損害承擔責任,即使開發者已被告知可能發生此類損害。\n\n7. 條款修改\n開發者保留隨時修改這些條款的權利。修改後的條款將在本軟體或開發者的網站上發布後立即生效。您繼續使用本軟體即表示您接受修改後的條款。\n\n8. 終止\n如果您違反這些條款,開發者有權立即終止您使用本軟體的許可,且無需事先通知。\n\n9. 適用法律\n這些條款受[國家/地區]法律管轄,不考慮其法律衝突原則。\n\n10. 開源協議\n本軟體使用 MIT 開源協議。您可以在[MIT 許可證](https://github.com/Goo-aw233/MSPCManagerHelper/blob/main/LICENSE.txt)中查看詳細資訊。\n\n11. 第三方軟體\n[NSudo](https://github.com/M2TeamArchived/NSudo)。\n[Sysinternals](https://learn.microsoft.com/sysinternals/license-terms/?wt.mc_id=studentamb_265231)。", "Privacy_context": "MSPCManagerHelper 隱私權聲明\n\nMSPCManagerHelper (以下簡稱“本軟體”)不會以任何形式採集並上傳任何資料,包括但不限於計算機識別符、地理資訊等。\n\n在您訪問部分連結時(如 learn.microsoft.com/?wt.mc_id=studentamb_265231),會使用 Microsoft 學生大使的跟蹤符,以協助開發者統計訪客數量。", - "top_menu_help_access_key": "協助(H)", + + "top_menu_help": "協助", "top_menu_help_about": "關於", "top_menu_help_gethelp": "取得說明", "top_menu_help_official_site": "官方網站", "top_menu_help_more_contact": "更多連絡方式", + "translation_author": "翻譯人員", "project_contributors": "項目貢獻者", + + + "@access_key": "access_key", + "top_menu_files_access_key": "(F)", + "top_menu_files_exit_access_key": "(E)", + + "top_menu_update_access_key": "(U)", + + "top_menu_term_of_use_and_privacy_access_key": "(T)", + "top_menu_term_of_use_access_key": "(T)", + "top_menu_privacy_access_key": "(P)", + + "top_menu_help_access_key": "(H)", + "top_menu_help_about_access_key": "(A)", + "top_menu_help_gethelp_access_key": "(G)", + "top_menu_help_official_site_access_key": "(O)", + "top_menu_help_more_contact_access_key": "(M)", + + + "@mainWindow.py": "mainWindow.py", "refresh": "重新整理", "notice_select_option": "請選取 (帶 * 的功能不需要以系統管理員身分執行)", @@ -297,25 +362,30 @@ "main_cancel_button": "取消", "run_as_administrator": "以系統管理員身分執行", "run_as_administrator_error": "以系統管理員身分執行失敗", + "main_project": "主要項目", "install_project": "安裝項目", "uninstall_project": "解除安裝項目", "other_project": "其他項目", + "repair_pc_manager": "修正 Microsoft 電腦管家無法安裝 / 開啟", "get_pc_manager_logs": "擷取 Microsoft 電腦管家記錄檔", "debug_dev_mode": "開發人員偵錯模式", + "download_from_winget": "從 WinGet 下載 Microsoft 電腦管家 (msstore 來源)", "download_from_msstore": "* 從 Microsoft Store 下載 Microsoft 電腦管家", "install_for_all_users": "為 所有使用者 安裝 Microsoft 電腦管家", "install_for_current_user": "為 目前使用者 安裝 Microsoft 電腦管家", "reinstall_pc_manager": "重新安裝 Microsoft 電腦管家", "update_from_application_package": "從 應用程式套件 更新 Microsoft 電腦管家", - "install_from_appxmanifest" : "從 應用程式資訊清單 安裝 Microsoft 電腦管家", + "install_from_appxmanifest" : "從 應用程式資訊清單 (AppxManifest.xml) 安裝 Microsoft 電腦管家", "install_wv2_runtime": "安裝 Microsoft Edge WebView2 執行階段", + "uninstall_for_all_users_in_dism": "透過 DISM 為 所有使用者 解除安裝 Microsoft 電腦管家", "uninstall_for_all_users": "為 所有使用者 解除安裝 Microsoft 電腦管家", "uninstall_for_current_user": "為 目前使用者 解除安裝 Microsoft 電腦管家", "uninstall_pc_manager_beta": "解除安裝 Microsoft 電腦管家 Beta", + "view_installed_antivirus": "* 檢視本機已安裝的防毒軟體", "developer_options": "* 開發人員專用", "repair_edge_wv2_setup": "修正 Microsoft Edge (WebView2 執行階段) 無法安裝", @@ -325,6 +395,7 @@ "switch_pc_manager_region": "切換 Microsoft 電腦管家地區", "compute_files_hash": "* 計算檔案雜湊函式", "get_msedge_webview2_version": "* 擷取 Microsoft Edge WebView2 執行階段 版本", + "warning": "警告", "select_function": "請選取要執行的功能", "main_executing_operation": "正在執行 {main_feature_name} 的操作。", @@ -334,6 +405,8 @@ "feature_unavailable": "功能不可用。", "system_requirements_checking": "系統要求偵測中...", "failed_to_set_dpi_awareness": "無法設定 DPI 感知度。", + "illegal_language_files_title": "非法的語言檔案", + "illegal_language_files": "該語言檔案不合法,請嘗試其他語言檔案。", "see_term_of_use_and_privacy": "使用 MSPCManagerHelper 即代表您已閲讀並同意《使用規定》與《隱私權聲明》,否則,請離開軟體並刪除。", "tips_run_as_dev_mode": "以‘/DevMode’或‘-DevMode’參數執行以啟動開發人員模式。", "excessive_waiting_time": "若等候時間過長,請耐心等待,或取消任務後重試。" diff --git a/mainFeature.py b/mainFeature.py index 74c078c..57608ad 100644 --- a/mainFeature.py +++ b/mainFeature.py @@ -141,7 +141,7 @@ def get_pc_manager_logs(self): pass # 复制 Crash 文件夹(崩溃文件) - if os.path.exists(crash_files_source): + if os.path.exists(crash_files_source) and os.listdir(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"), @@ -253,13 +253,8 @@ def get_pc_manager_logs(self): try: self.textbox("\n" + self.translator.translate("retrieving_computer_info")) computer_info_path = os.path.join(logs_destination, "ComputerInfo.txt") - get_info_powershell_command = ( - "Get-ComputerInfo | Select-Object CsName, WindowsVersion, OSDisplayVersion, WindowsBuildLabEx, " - "OsArchitecture, WindowsEditionId, OsLanguage, BiosManufacturer, BiosVersion, CsManufacturer, " - "CsModel, CsTotalPhysicalMemory, CsSystemType, TimeZone, OsLocale, OsUILanguage | " - "Out-File -FilePath '{}' -Encoding utf8".format(computer_info_path) - ) - subprocess.run(["powershell.exe", "-Command", get_info_powershell_command], capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) + subprocess.run(["powershell.exe", "-Command", "Get-ComputerInfo | Out-File -FilePath '{}' -Encoding utf8".format(computer_info_path)], + capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) self.textbox(self.translator.translate("retrieve_computer_info_success")) except Exception as e: self.textbox(self.translator.translate("retrieve_computer_info_error") + f":\n{str(e)}") diff --git a/mainWindow.py b/mainWindow.py index df14845..1d1cffa 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.8" + self.MSPCManagerHelper_Version = "Beta v0.2.0.9" title = f"MSPCManagerHelper {self.MSPCManagerHelper_Version}" if AdvancedStartup.is_admin(): title += " (Administrator)" @@ -317,19 +317,18 @@ def update_feature_combobox(self, event): options[self.translator.translate("main_project")].append(self.translator.translate("debug_dev_mode")) # 插入到末尾 options[self.translator.translate("install_project")].insert(5, self.translator.translate("install_from_appxmanifest")) # 插入到第 5 个位置(从 0 开始) - """ - # 获取当前选择的语言 - current_language = self.language_combobox.get() - - # 根据语言隐藏特定选项 - language_hidden_options = [self.translator.translate("pc_manager_docs")] - - # 如果当前语言是 en-us 或 zh-tw 或其它语言,隐藏特定选项 - if current_language in [self.translator.translate("lang_en-us"), - self.translator.translate("lang_zh-tw")]: - for key in options: - options[key] = [option for option in options[key] if option not in language_hidden_options] - """ + # 不以管理员身份运行时,只显示不需要管理员身份运行的功能 + if not AdvancedStartup.is_admin(): + options[self.translator.translate("main_project")] = [] + options[self.translator.translate("install_project")] = [self.translator.translate("download_from_msstore")] + options[self.translator.translate("uninstall_project")] = [] + options[self.translator.translate("other_project")] = [ + self.translator.translate("view_installed_antivirus"), + self.translator.translate("developer_options"), + self.translator.translate("pc_manager_docs"), + self.translator.translate("compute_files_hash"), + self.translator.translate("get_msedge_webview2_version") + ] # 更新功能组合框的值 self.feature_combobox['values'] = options.get(selection, []) diff --git a/topMenu.py b/topMenu.py index 6853615..b7b25c8 100644 --- a/topMenu.py +++ b/topMenu.py @@ -25,13 +25,13 @@ def create_menu(self): self.top_menu_term_of_use_and_privacy = tk.Menu(self.top_menu, tearoff=0) self.top_menu_update = tk.Menu(self.top_menu, tearoff=0) - # “文件(F)”菜单(underline 以第一个为 0 字符开始计算,直到快捷键) - self.top_menu.add_cascade(label=self.translator.translate("top_menu_files_access_key"), underline=3, menu=self.top_menu_files) + # “文件(F)”菜单(计算翻译值长度,将快捷键索引为翻译值后紧接的 access key 的第一 +1 个字符) + self.top_menu.add_cascade(label=f"{self.translator.translate('top_menu_files')}{self.translator.translate('top_menu_files_access_key')}", underline=len(self.translator.translate('top_menu_files')) + 1, menu=self.top_menu_files) self.top_menu_files.add_separator() - self.top_menu_files.add_command(label=self.translator.translate("top_menu_files_exit"), command=lambda: TopMenuFiles.exit_program(self.parent)) + self.top_menu_files.add_command(label=f"{self.translator.translate('top_menu_files_exit')}{self.translator.translate('top_menu_files_exit_access_key')}", underline=len(self.translator.translate('top_menu_files_exit')) + 1, command=lambda: TopMenuFiles.exit_program(self.parent)) - # “下载与更新(U)”菜单(underline 以第一个为 0 字符开始计算,直到快捷键) - self.top_menu.add_cascade(label=self.translator.translate("top_menu_update_access_key"), underline=6, menu=self.top_menu_update) + # “下载与更新(U)”菜单(计算翻译值长度,将快捷键索引为翻译值后紧接的 access key 的第一 +1 个字符) + self.top_menu.add_cascade(label=f"{self.translator.translate('top_menu_update')}{self.translator.translate('top_menu_update_access_key')}", underline=len(self.translator.translate('top_menu_update')) + 1, menu=self.top_menu_update) self.top_menu_update.add_command(label=self.translator.translate("top_menu_update_GitHub"), command=TopMenuUpdate.open_github_update) self.top_menu_update.add_command(label=self.translator.translate("top_menu_update_OneDrive"), command=TopMenuUpdate.open_onedrive_update) self.top_menu_update.add_separator() @@ -40,17 +40,17 @@ def create_menu(self): self.top_menu_update.add_separator() self.top_menu_update.add_command(label=self.translator.translate("top_menu_update_WindowsAppRuntime"), command=TopMenuUpdate.open_windowsappruntime_download) - # “使用条款与隐私政策(T)”菜单(underline 以第一个为 0 字符开始计算,直到快捷键) - self.top_menu.add_cascade(label=self.translator.translate("top_menu_term_of_use_and_privacy_access_key"), underline=10, menu=self.top_menu_term_of_use_and_privacy) - self.top_menu_term_of_use_and_privacy.add_command(label=self.translator.translate("top_menu_term_of_use"), command=self.top_menu_term_of_use) - self.top_menu_term_of_use_and_privacy.add_command(label=self.translator.translate("top_menu_privacy"), command=self.top_menu_privacy) - - # “帮助(H)”菜单(underline 以第一个为 0 字符开始计算,直到快捷键) - self.top_menu.add_cascade(label=self.translator.translate("top_menu_help_access_key"), underline=3, menu=self.top_menu_help) - self.top_menu_help.add_command(label=self.translator.translate("top_menu_help_about"), command=self.top_menu_help_about) - self.top_menu_help.add_command(label=self.translator.translate("top_menu_help_gethelp"), command=TopMenuHelp.open_gethelp) - self.top_menu_help.add_command(label=self.translator.translate("top_menu_help_official_site"), command=TopMenuHelp.open_official_site) - self.top_menu_help.add_command(label=self.translator.translate("top_menu_help_more_contact"), command=lambda: TopMenuHelp.open_more_contact(self.translator)) + # “使用条款与隐私政策(T)”菜单(计算翻译值长度,将快捷键索引为翻译值后紧接的 access key 的第一 +1 个字符) + self.top_menu.add_cascade(label=f"{self.translator.translate('top_menu_term_of_use_and_privacy')}{self.translator.translate('top_menu_term_of_use_and_privacy_access_key')}", underline=len(self.translator.translate('top_menu_term_of_use_and_privacy')) + 1, menu=self.top_menu_term_of_use_and_privacy) + self.top_menu_term_of_use_and_privacy.add_command(label=f"{self.translator.translate('top_menu_term_of_use')}{self.translator.translate('top_menu_term_of_use_access_key')}", underline=len(self.translator.translate('top_menu_term_of_use')) + 1, command=self.top_menu_term_of_use) + self.top_menu_term_of_use_and_privacy.add_command(label=f"{self.translator.translate('top_menu_privacy')}{self.translator.translate('top_menu_privacy_access_key')}", underline=len(self.translator.translate('top_menu_privacy')) + 1, command=self.top_menu_privacy) + + # “帮助(H)”菜单(计算翻译值长度,将快捷键索引为翻译值后紧接的 access key 的第一 +1 个字符) + self.top_menu.add_cascade(label=f"{self.translator.translate('top_menu_help')}{self.translator.translate('top_menu_help_access_key')}", underline=len(self.translator.translate('top_menu_help')) + 1, menu=self.top_menu_help) + self.top_menu_help.add_command(label=f"{self.translator.translate('top_menu_help_about')}{self.translator.translate('top_menu_help_about_access_key')}", underline=len(self.translator.translate('top_menu_help_about')) + 1, command=self.top_menu_help_about) + self.top_menu_help.add_command(label=f"{self.translator.translate('top_menu_help_gethelp')}{self.translator.translate('top_menu_help_gethelp_access_key')}", underline=len(self.translator.translate('top_menu_help_gethelp')) + 1, command=TopMenuHelp.open_gethelp) + self.top_menu_help.add_command(label=f"{self.translator.translate('top_menu_help_official_site')}{self.translator.translate('top_menu_help_official_site_access_key')}", underline=len(self.translator.translate('top_menu_help_official_site')) + 1, command=TopMenuHelp.open_official_site) + self.top_menu_help.add_command(label=f"{self.translator.translate('top_menu_help_more_contact')}{self.translator.translate('top_menu_help_more_contact_access_key')}", underline=len(self.translator.translate('top_menu_help_more_contact')) + 1, command=lambda: TopMenuHelp.open_more_contact(self.translator)) def top_menu_term_of_use(self): TopMenuTermOfUse(self.parent, self.translator).show_term_of_use_window() diff --git a/version_ARM64.txt b/version_ARM64.txt index 88ad4d1..2abb774 100644 --- a/version_ARM64.txt +++ b/version_ARM64.txt @@ -6,8 +6,8 @@ VSVersionInfo( ffi=FixedFileInfo( - filevers=(0, 2, 0, 8), - prodvers=(0, 2, 0, 8), + filevers=(0, 2, 0, 9), + prodvers=(0, 2, 0, 9), 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.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.8_ARM64.exe'), + StringStruct('FileVersion', 'Beta v0.2.0.9 ARM64'), + StringStruct('InternalName', 'MSPCManagerHelper_Beta_v0.2.0.9_ARM64'), + StringStruct(u'LegalCopyright', u'© 2025 GuCATs All rights reserved.'), + StringStruct('OriginalFilename', 'MSPCManagerHelper_Beta_v0.2.0.9_ARM64.exe'), StringStruct('ProductName', 'MSPCManagerHelper'), - StringStruct('ProductVersion', 'Beta v0.2.0.8 ARM64') + StringStruct('ProductVersion', 'Beta v0.2.0.9 ARM64') ] ) ] diff --git a/version_x64.txt b/version_x64.txt index e276030..91cdf86 100644 --- a/version_x64.txt +++ b/version_x64.txt @@ -6,8 +6,8 @@ VSVersionInfo( ffi=FixedFileInfo( - filevers=(0, 2, 0, 8), - prodvers=(0, 2, 0, 8), + filevers=(0, 2, 0, 9), + prodvers=(0, 2, 0, 9), 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.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.8_x64.exe'), + StringStruct('FileVersion', 'Beta v0.2.0.9 x64'), + StringStruct('InternalName', 'MSPCManagerHelper_Beta_v0.2.0.9_x64'), + StringStruct(u'LegalCopyright', u'© 2025 GuCATs All rights reserved.'), + StringStruct('OriginalFilename', 'MSPCManagerHelper_Beta_v0.2.0.9_x64.exe'), StringStruct('ProductName', 'MSPCManagerHelper'), - StringStruct('ProductVersion', 'Beta v0.2.0.8 x64') + StringStruct('ProductVersion', 'Beta v0.2.0.9 x64') ] ) ]