mirror of
https://github.com/hyb-oyqq/FRAISEMOE-Addons-Installer-NEXT.git
synced 2025-12-15 19:30:28 +00:00
refactor(source): 重构代码并优化 imports
- 移除 FAQ-en.md 和 README-en.md 文件 - 更新 Main.py 中的导入语句和错误处理 - 修改消息框相关的代码,使用更合适的 Qt 类 - 调整窗口标志设置,使用正确的枚举值 - 更新 requirements.txt,修改 PyQt-SiliconUI 版本
This commit is contained in:
227
FAQ-en.md
227
FAQ-en.md
@@ -1,227 +0,0 @@
|
||||
# 🍓FRAISEMOE NEKOPARA Addons Installer🍓
|
||||
|
||||
<!-- TOP TITLE -->
|
||||
<div style="text-align: center;">
|
||||
<h1>NEKOPARA Addons Installer</h1>
|
||||
<h3>A simple application for installing patches for the Nekopara series of games.</h3>
|
||||
</div>
|
||||
|
||||
<!-- INTRODUCTION -->
|
||||
<p align="center">
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/">
|
||||
<svg role="img" viewBox="0 0 25 25" width="20" height="20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/>
|
||||
</svg>
|
||||
Github
|
||||
</a> |
|
||||
<a href="https://www.bilibili.com/video/BV1hn9UYwE6p/">
|
||||
<svg role="img" viewBox="0 0 24 24" width="20" height="20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17.813 4.653h.854c1.51.054 2.769.578 3.773 1.574 1.004.995 1.524 2.249 1.56 3.76v7.36c-.036 1.51-.556 2.769-1.56 3.773s-2.262 1.524-3.773 1.56H5.333c-1.51-.036-2.769-.556-3.773-1.56S.036 18.858 0 17.347v-7.36c.036-1.511.556-2.765 1.56-3.76 1.004-.996 2.262-1.52 3.773-1.574h.774l-1.174-1.12a1.234 1.234 0 0 1-.373-.906c0-.356.124-.658.373-.907l.027-.027c.267-.249.573-.373.92-.373.347 0 .653.124.92.373L9.653 4.44c.071.071.134.142.187.213h4.267a.836.836 0 0 1 .16-.213l2.853-2.747c.267-.249.573-.373.92-.373.347 0 .662.151.929.4.267.249.391.551.391.907 0 .355-.124.657-.373.906zM5.333 7.24c-.746.018-1.373.276-1.88.773-.506.498-.769 1.13-.786 1.894v7.52c.017.764.28 1.395.786 1.893.507.498 1.134.756 1.88.773h13.334c.746-.017 1.373-.275 1.88-.773.506-.498.769-1.129.786-1.893v-7.52c-.017-.765-.28-1.396-.786-1.894-.507-.497-1.134-.755-1.88-.773zM8 11.107c.373 0 .684.124.933.373.25.249.383.569.4.96v1.173c-.017.391-.15.711-.4.96-.249.25-.56.374-.933.374s-.684-.125-.933-.374c-.25-.249-.383-.569-.4-.96V12.44c0-.373.129-.689.386-.947.258-.257.574-.386.947-.386zm8 0c.373 0 .684.124.933.373.25.249.383.569.4.96v1.173c-.017.391-.15.711-.4.96-.249.25-.56.374-.933.374s-.684-.125-.933-.374c-.25-.249-.383-.569-.4-.96V12.44c.017-.391.15-.711.4-.96.249-.249.56-.373.933-.373Z"/>
|
||||
</svg>
|
||||
Bilibili
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/blob/master/FAQ.md">Chinese</a> |
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/blob/master/FAQ-en.md">English</a>
|
||||
</p>
|
||||
|
||||
<div style="text-align: center;">
|
||||
<h5><b><u>Please strictly adhere to all regulations in the <a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/blob/master/FAQ.md">Usage Guidelines Document</a>. If violated, the developers will not be held responsible.</u></b></h5>
|
||||
<h5><b><u>This tool is intended solely for educational and communication purposes; please do not use it for commercial purposes.</u></b></h5>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## 🎮 Supported Games:
|
||||
|
||||
- **NEKOPARA Vol. 1**
|
||||
- **NEKOPARA Vol. 2**
|
||||
- **NEKOPARA Vol. 3**
|
||||
- **NEKOPARA Vol. 4**
|
||||
|
||||
---
|
||||
|
||||
⚠️ **Special Notice:**
|
||||
|
||||
> **1. NEKOPARA Vol. 0 & NEKOPARA Extra are not supported for patch installation ❗**
|
||||
|
||||
> **2. Patches will not be installed for games you do not own ❗**
|
||||
|
||||
> **3. This tool is only for patch installation and does not install games ❗ It is limited to Windows systems ❗**
|
||||
|
||||
> **4. The tool requires administrator privileges to run ❗
|
||||
> Reason: To prevent users from running the game while using this tool, which can affect the installation process, the tool checks and closes any running game processes before proceeding ❗**
|
||||
|
||||
> **5. Before using this tool, you need to understand the basic knowledge of patch installation:**
|
||||
>
|
||||
> **5-1. Why is it necessary to install patches? What content is included in the patches?**
|
||||
>
|
||||
> **5-2. Based on the information provided in the documentation, consider why these errors occur or why the installation fails?**
|
||||
>
|
||||
> **5-3. After successfully installing the patch, how do you troubleshoot related settings to confirm if the installation was successful?**
|
||||
>
|
||||
> **_If you are completely unfamiliar with the above knowledge, please refrain from using this tool or refer to tutorial videos. If you have already downloaded this tool, it is recommended to move it to the recycle bin and delete it._**
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Usage Instructions/Process:
|
||||
|
||||
1. Download "FRAISEMOE Addons Installer.exe" from the repository.
|
||||
2. **Close any running instances of the [supported games](#supported-games).**
|
||||
3. If prompted to run as an administrator, grant administrative privileges. **If administrative privileges cannot be obtained, the application will not run and will exit automatically.**
|
||||
4. If prompted to close any running games, select "Yes". **If the running games cannot be closed, the application will not run and will exit automatically.**
|
||||
5. After entering the application, choose "Start Install", and select **the parent directory of the game directory**.
|
||||
|
||||
> **Important Note 1** ❓ What is the "parent directory of the game directory"? How do I obtain it?
|
||||
> For Steam platform, find the "Library" option at the top, then locate the [supported games list](#supported-games) in the left game list; right-click on the game, choose "Manage" -> "Browse Local Files" to get the game directory. In the address bar, click the "←" button in the File Explorer. If you see the game folder (e.g., "NEKOPARA Vol. 1") in the File Explorer, the current directory is the parent directory of the game directory; copy the path from the address bar.
|
||||
|
||||
> **Important Note 2** ❓ How do I use this tool for third-party installed games?
|
||||
> For third-party installations with non-fixed paths, manually copy the parent directory of the game directory, similar to the method used for Steam-installed games.
|
||||
|
||||
> Example (for reference only, do not copy directly):
|
||||
> Game folder: C:\ (drive letter may vary)\Steam\steamapps\common\NEKOPARA Vol. 1
|
||||
> Parent directory of the game folder: C:\ (drive letter may vary)\Steam\steamapps\common
|
||||
|
||||
6. In the directory selection page, paste the copied path into the **address bar** of the File Explorer and click "Select Folder". **(Ensure that the text in the lower folder selection box matches the last folder name in the path; if not, reselect the folder).**
|
||||
|
||||
> √ Correct example (for reference only, do not copy directly):
|
||||
> Path entered in the address bar: C:\ (drive letter may vary)\Steam\steamapps\common
|
||||
> Folder name below: common
|
||||
|
||||
7. After selecting the folder, you may encounter the following situations:
|
||||
<table>
|
||||
<tr>
|
||||
<td><h5>Status</h5></td>
|
||||
<td><h5>Action</h5></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Game exists but patch is not installed</td>
|
||||
<td>Proceed with the download task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Game exists,<br />but patch has been installed from another source or patch files are corrupted</td>
|
||||
<td>Ask whether to reinstall the patch using this tool. If the patch from another source is usable, you can choose not to reinstall.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Game does not exist</td>
|
||||
<td>Skip the patch installation step</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Game exists,<br />but the corresponding version patch cannot be installed using this tool</td>
|
||||
<td>Repeat the installation steps</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
8. Confirm the final installation result, then choose "Exit".
|
||||
9. Go to the game and check if there are more options in the "Settings" section. Or if you have previously entered an additional episode and have it in the "EXTRA" option, the patch has been successfully installed. If none of the above happens, repeat the installation steps.
|
||||
|
||||
---
|
||||
|
||||
## 🔰 Software Features:
|
||||
|
||||
- Detects the patch status of the [supported games](#supported-games) and compares the [Hash(SHA-256)](#hashsha-256-checksum) to determine if the patch file is intact. If the patch file from another source is damaged, it asks whether to reinstall the patch, deletes the old patch file, downloads the patch package, and reinstalls it.
|
||||
- Detects all uninstalled versions and executes the installation tasks.
|
||||
|
||||
---
|
||||
|
||||
## ❓ Common Issues & Usage Guidelines
|
||||
|
||||
<h4><u>During Usage</u></h4>
|
||||
|
||||
- The application opens but loads slowly.
|
||||
- Please wait patiently; it is not a program crash.
|
||||
- Do not open the application multiple times during loading to avoid unnecessary issues.
|
||||
|
||||
<h4><u>When Prompted That the Application Is Running / Being Used</u></h4>
|
||||
|
||||
- Due to frequent opening of the application, the Task Manager refreshes incorrectly. Manually enter Task Manager, find "FRAISEMOE-Addons-Installer", end the process, and restart the application.
|
||||
|
||||
<h4><u>1. Download Errors</u></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><h5>Common Error Types</h5></td>
|
||||
<td><h5>Error Information</h5></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Contains "403"/"Access is denied by the server"</td>
|
||||
<td>Access denied by the server. Check if a network proxy (VPN) is set up and reset the network proxy (or exit the relevant VPN proxy program), then "Restart the application" and try again.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Contains "port=443"/"The remote host forcibly closes an existing connection"</td>
|
||||
<td>Download interruption. Wait for other tasks to complete file integrity checks/download tasks, then use "Start Install" again, selecting the previously input "parent directory of the game" to install.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Contains other text</td>
|
||||
<td>1. Most likely due to abnormal network conditions. Check and fix your network connection before trying again.<br />2. In some cases, it could be a server issue. Report the problem to the author or individuals listed in the credits.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h4><u>2. Issues During Download and Installation</u></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><h5>Common Issue Types</h5></td>
|
||||
<td><h5>Solution</h5></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Slow download progress with pauses</td>
|
||||
<td>If there is no error message, wait a bit longer.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>File integrity check window flickers</td>
|
||||
<td>This is normal; ignore it.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Download progress window appears, covered by hash value verification window/red close button</td>
|
||||
<td>Some patch files are large, and calculating the hash value takes time. Wait a bit longer. If it takes too long, manually refresh the status by clicking the main window/download progress window/hash value verification window.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h4><u>3. Unable to Exit the Program During Download</u></h4>
|
||||
|
||||
- To ensure the effectiveness of the patch installation, do not exit the program during download and installation. Any adverse effects caused by violating this
|
||||
|
||||
<h4><u>4. Forcefully terminating the program during download</u></h4>
|
||||
|
||||
- It may cause patch file corruption. Upon restarting the application, it will automatically overwrite the downloaded files. Any adverse effects caused by violating this guideline are the user's responsibility.
|
||||
|
||||
<h4><u>5. After multiple downloads and installations of patches, network speed significantly decreases despite normal network status</u></h4>
|
||||
|
||||
- To ensure server stability and resource security, download sources are divided into domestic and international sources. To guarantee download quality for more users, domestic sources have a download limit; tasks exceeding this limit will be redirected to international sources for downloading.
|
||||
|
||||
<h4><u>6. Discovering identical/similar repositories/applications outside of this repository</u></h4>
|
||||
|
||||
- These might be modified by other developers or use unknown source patch files. Do not download/use such repositories/applications.
|
||||
|
||||
<h4><u>7. Obtaining this application through non-free means before using it</u></h4>
|
||||
|
||||
- This application is free and open-source. If obtained through non-free channels, please immediately request a refund from the source and actively protect your rights.
|
||||
|
||||
---
|
||||
|
||||
## 💫 HASH(SHA-256) Checksum
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><h5>Game Patch</h5></td>
|
||||
<td><h5>SHA-256 (Checksum created: 2024/07-2024-08)</h5></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vol.1</td>
|
||||
<td>04b48b231a7f34431431e5027fcc7b27affaa951b8169c541709156acf754f3e</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vol.2</td>
|
||||
<td>b9c00a2b113a1e768bf78400e4f9075ceb7b35349cdeca09be62eb014f0d4b42</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vol.3</td>
|
||||
<td>2ce7b223c84592e1ebc3b72079dee1e5e8d064ade15723328a64dee58833b9d5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vol.4</td>
|
||||
<td>4a4a9ae5a75a18aacbe3ab0774d7f93f99c046afe3a777ee0363e8932b90f36a</td>
|
||||
</tr>
|
||||
</table>
|
||||
123
README-en.md
123
README-en.md
@@ -1,123 +0,0 @@
|
||||
# 🍓FRAISEMOE Addons Installer🍓
|
||||
|
||||
```
|
||||
|
||||
🔊 Notice: "FraiseMoe Addons Installer" has fulfilled its purpose as a beta version. Thank you for the support and companionship of our users.
|
||||
Starting July 14, 2025 at 00:00, the "FraiseMoe Addons Installer" GitHub repository will be archived, and the download service will be permanently discontinued.
|
||||
A completely reconstructed version of this application will be released at "https://github.com/Yanam1Anna/FRAISEMOE-Addons-Manager" on July 14, 2025 at 23:59.
|
||||
Due to high CDN service costs and long-term high server load, we are unable to continue providing free services. Additionally, due to poor open-source effectiveness of this version, the new version will be released in a closed-source manner.
|
||||
From the release of the new version and the archival of this version, to maintain server revenue balance, a fee mechanism may be introduced to ensure continued operation, or the project will enter a lifecycle management phase.
|
||||
|
||||
```
|
||||
|
||||
|
||||
<!-- PROJECT SHIELDS -->
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/stargazers" class="shield">
|
||||
<img src="https://img.shields.io/github/stars/Yanam1Anna/FRAISEMOE-Addons-Installer?style=flat-square&label=%E2%AD%90%20Stars&color=blue" alt="Stars">
|
||||
</a>
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/issues" class="shield">
|
||||
<img src="https://img.shields.io/github/issues/Yanam1Anna/FRAISEMOE-Addons-Installer?style=flat-square&label=%F0%9F%92%AC%20Report%20Issues/Pull%20Requests&color=blue" alt="Issues/Pull Requests">
|
||||
</a>
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/releases/latest" class="shield">
|
||||
<img src="https://img.shields.io/github/v/release/Yanam1Anna/FRAISEMOE-Addons-Installer?style=flat-square&label=%F0%9F%92%AF%20Latest%20Release&color=blue" alt="Latest Release">
|
||||
</a>
|
||||
<img src="https://img.shields.io/github/downloads/Yanam1Anna/FRAISEMOE-Addons-Installer/total?style=flat-square&label=%F0%9F%93%A5%20Download%20Count&color=blue" alt="Download Count" class="shield">
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/blob/master/LICENSE" class="shield">
|
||||
<img src="https://img.shields.io/github/license/Yanam1Anna/FRAISEMOE-Addons-Installer?style=flat-square&label=%F0%9F%93%96%20License&color=blue" alt="License">
|
||||
</a>
|
||||
</a>
|
||||
<img src="https://img.shields.io/badge/Python-3.12.10-blue?style=flat-square&logo=python" alt="Python" class="shield">
|
||||
</p>
|
||||
|
||||
<!-- PROJECT LOGO -->
|
||||
<br>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer">
|
||||
<img src="https://raw.githubusercontent.com/Yanam1Anna/FRAISEMOE-Addons-Installer/master/introduction_imgs/main-en.png" alt="Logo">
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
If this tool is helpful to you, please Star⭐~
|
||||
<br />
|
||||
<br />
|
||||
⚠️ This tool is unofficial and does not represent the official stance ⚠️
|
||||
<br />
|
||||
<br />
|
||||
<strong><a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer">Explore the documentation »</a></strong>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/issues">Report Bugs</a>
|
||||
·
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/issues">Request Features</a>
|
||||
·
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/blob/master/FAQ.md">【Read Before Use】Usage Guidelines</a>
|
||||
<br />
|
||||
</p>
|
||||
|
||||
<!-- Language -->
|
||||
<p align="center">
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer">Chinese</a> |
|
||||
<a href="https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/blob/master/README-en.md">English</a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## 📕 Table of Contents
|
||||
|
||||
- [Getting Started](#getting-started)
|
||||
- [Installation](#installation)
|
||||
- [Usage Steps](#usage-steps)
|
||||
- [Version Control](#version-control)
|
||||
- [Author](#author)
|
||||
- [Donate/Reward this project](#-donation-voluntary-non-compulsory-non-refundable)
|
||||
- [Acknowledgements](#-acknowledgements)
|
||||
- [License](#license)
|
||||
|
||||
---
|
||||
|
||||
## Getting Started
|
||||
|
||||
### 📥 Installation
|
||||
|
||||
Please download the latest version of the application from the [Releases Page](https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/releases).
|
||||
|
||||

|
||||
|
||||
### ❗ Usage Steps
|
||||
|
||||
1. **Important Notice**: Please read the [Usage Guidelines](https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/blob/master/FAQ.md) before using.
|
||||
2. **Detailed Tutorial**: Refer to the [Video Tutorial](https://www.bilibili.com/video/BV1hn9UYwE6p/).
|
||||
|
||||
### ⭕ Version Control
|
||||
|
||||
This project uses Git for version control. You can view the available versions on the [Releases Page](https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/releases).
|
||||
|
||||
---
|
||||
|
||||
## 💡 Important Notes
|
||||
|
||||
1. Do not use modified versions: The author and developers are not responsible for any personal losses caused by using unknown or modified versions.
|
||||
2. Follow all rules: Please strictly adhere to the [Usage Guidelines](https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/blob/master/FAQ.md) and this document. The author and developers are not responsible for any violations.
|
||||
3. Free and Open Source: This application is free and open source. If you obtain it through a paid source, immediately request a refund and seek legal protection.
|
||||
|
||||
---
|
||||
|
||||
## 📝 Author
|
||||
|
||||
- [Yanam1Anna](https://github.com/Yanam1Anna)   Email: [icon.hirasawayui@gmail.com](mailto:icon.hirasawayui@gmail.com)
|
||||
|
||||
## 🧧 Donation (voluntary, non-compulsory, non-refundable)
|
||||
|
||||
<img src="https://raw.githubusercontent.com/Yanam1Anna/FRAISEMOE-Addons-Installer/refs/heads/master/introduction_imgs/donations.png" alt="Donations" width="500">
|
||||
|
||||
## 🎉 Acknowledgements
|
||||
|
||||
- [HTony03](https://github.com/HTony03): Provided significant support in refactoring parts of the source code, optimizing logic, and implementing features.
|
||||
- [Akatsuki Misaki](https://github.com/Akatsuki-Misaki): Provided significant support for cloud resource storage.
|
||||
|
||||
## 📖 License
|
||||
|
||||
This application is licensed under the [GPL-3.0](https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/blob/master/LICENSE). Please refer to the [LICENSE](https://github.com/Yanam1Anna/FRAISEMOE-Addons-Installer/blob/master/LICENSE) file for more information.
|
||||
@@ -12,10 +12,10 @@ from PySide6.QtGui import QIcon
|
||||
from collections import deque
|
||||
from pic_data import img_data
|
||||
|
||||
from PySide6.QtCore import ( Qt,
|
||||
Signal, QThread, QTimer)
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
from PySide6.QtCore import (Qt, Signal, QThread, QTimer)
|
||||
from PySide6.QtGui import (QIcon, QPixmap, )
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QMainWindow, QMessageBox,
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QMainWindow,
|
||||
QProgressBar, QVBoxLayout, QFileDialog, QDialog)
|
||||
|
||||
from Ui_install import Ui_MainWindows
|
||||
@@ -79,7 +79,7 @@ def decode_base64(encoded_str):
|
||||
# 全局变量
|
||||
APP_VERSION = app_data["APP_VERSION"]
|
||||
APP_NAME = app_data["APP_NAME"]
|
||||
TEMP = os.getenv(app_data["TEMP"])
|
||||
TEMP = os.getenv(app_data["TEMP"]) or app_data["TEMP"]
|
||||
CACHE = os.path.join(TEMP, app_data["CACHE"])
|
||||
PLUGIN = os.path.join(CACHE, app_data["PLUGIN"])
|
||||
CONFIG_URL = decode_base64(app_data["CONFIG_URL"])
|
||||
@@ -90,8 +90,8 @@ HASH_SIZE = 134217728
|
||||
PLUGIN_HASH = {game: info["hash"] for game, info in GAME_INFO.items()}
|
||||
PROCESS_INFO = {info["exe"]: game for game, info in GAME_INFO.items()}
|
||||
|
||||
def msgbox_frame(title, text, buttons=QMessageBox.StandardButton.NoButton):
|
||||
msg_box = QMessageBox()
|
||||
def msgbox_frame(title, text, buttons=QtWidgets.QMessageBox.StandardButton.NoButton):
|
||||
msg_box = QtWidgets.QMessageBox()
|
||||
msg_box.setWindowTitle(title)
|
||||
|
||||
# 设置弹窗图标
|
||||
@@ -100,9 +100,9 @@ def msgbox_frame(title, text, buttons=QMessageBox.StandardButton.NoButton):
|
||||
pixmap = load_base64_image(icon_data)
|
||||
if not pixmap.isNull():
|
||||
msg_box.setWindowIcon(QIcon(pixmap))
|
||||
msg_box.setIconPixmap(pixmap.scaled(64, 64, Qt.KeepAspectRatio))
|
||||
msg_box.setIconPixmap(pixmap.scaled(64, 64, QtCore.Qt.AspectRatioMode.KeepAspectRatio))
|
||||
else:
|
||||
msg_box.setIcon(QMessageBox.Information)
|
||||
msg_box.setIcon(QtWidgets.QMessageBox.Icon.Information)
|
||||
|
||||
msg_box.setText(text)
|
||||
msg_box.setStandardButtons(buttons)
|
||||
@@ -135,7 +135,7 @@ class HashManager:
|
||||
msg_box = msgbox_frame(
|
||||
f"错误 {APP_NAME}",
|
||||
f"\n文件哈希值计算失败\n\n【错误信息】:{e}\n",
|
||||
QMessageBox.StandardButton.Ok,
|
||||
QtWidgets.QMessageBox.StandardButton.Ok,
|
||||
)
|
||||
msg_box.exec()
|
||||
return results
|
||||
@@ -157,9 +157,9 @@ class HashManager:
|
||||
reply = msgbox_frame(
|
||||
f"文件校验 {APP_NAME}",
|
||||
f"\n检测到 {game_version} 的文件哈希值不匹配,是否重新安装?\n",
|
||||
QMessageBox.Yes | QMessageBox.No,
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No,
|
||||
).exec()
|
||||
if reply == QMessageBox.Yes:
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
installed_status[game_version] = False
|
||||
else:
|
||||
installed_status[game_version] = True
|
||||
@@ -178,7 +178,7 @@ class HashManager:
|
||||
msg_box = msgbox_frame(
|
||||
f"文件校验 {APP_NAME}",
|
||||
f"\n检测到 {game} 的文件哈希值不匹配\n",
|
||||
QMessageBox.StandardButton.Ok,
|
||||
QtWidgets.QMessageBox.StandardButton.Ok,
|
||||
)
|
||||
msg_box.exec()
|
||||
installed_status[game] = False
|
||||
@@ -208,10 +208,10 @@ class AdminPrivileges:
|
||||
msg_box = msgbox_frame(
|
||||
f"权限检测 {APP_NAME}",
|
||||
"\n需要管理员权限运行此程序\n",
|
||||
QMessageBox.Yes | QMessageBox.No,
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No,
|
||||
)
|
||||
reply = msg_box.exec()
|
||||
if reply == QMessageBox.Yes:
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
try:
|
||||
ctypes.windll.shell32.ShellExecuteW(
|
||||
None, "runas", sys.executable, " ".join(sys.argv), None, 1
|
||||
@@ -220,7 +220,7 @@ class AdminPrivileges:
|
||||
msg_box = msgbox_frame(
|
||||
f"错误 {APP_NAME}",
|
||||
f"\n请求管理员权限失败\n\n【错误信息】:{e}\n",
|
||||
QMessageBox.StandardButton.Ok,
|
||||
QtWidgets.QMessageBox.StandardButton.Ok,
|
||||
)
|
||||
msg_box.exec()
|
||||
sys.exit(1)
|
||||
@@ -228,7 +228,7 @@ class AdminPrivileges:
|
||||
msg_box = msgbox_frame(
|
||||
f"权限检测 {APP_NAME}",
|
||||
"\n无法获取管理员权限,程序将退出\n",
|
||||
QMessageBox.StandardButton.Ok,
|
||||
QtWidgets.QMessageBox.StandardButton.Ok,
|
||||
)
|
||||
msg_box.exec()
|
||||
sys.exit(1)
|
||||
@@ -239,10 +239,10 @@ class AdminPrivileges:
|
||||
msg_box = msgbox_frame(
|
||||
f"进程检测 {APP_NAME}",
|
||||
f"\n检测到游戏正在运行: {proc.info['name']} \n\n是否终止?\n",
|
||||
QMessageBox.Yes | QMessageBox.No,
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No,
|
||||
)
|
||||
reply = msg_box.exec()
|
||||
if reply == QMessageBox.Yes:
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
try:
|
||||
proc.terminate()
|
||||
proc.wait(timeout=3)
|
||||
@@ -250,7 +250,7 @@ class AdminPrivileges:
|
||||
msg_box = msgbox_frame(
|
||||
f"错误 {APP_NAME}",
|
||||
f"\n无法关闭游戏: {proc.info['name']} \n\n请手动关闭后重启应用\n",
|
||||
QMessageBox.StandardButton.Ok,
|
||||
QtWidgets.QMessageBox.StandardButton.Ok,
|
||||
)
|
||||
msg_box.exec()
|
||||
sys.exit(1)
|
||||
@@ -258,7 +258,7 @@ class AdminPrivileges:
|
||||
msg_box = msgbox_frame(
|
||||
f"进程检测 {APP_NAME}",
|
||||
f"\n未关闭的游戏: {proc.info['name']} \n\n请手动关闭后重启应用\n",
|
||||
QMessageBox.StandardButton.Ok,
|
||||
QtWidgets.QMessageBox.StandardButton.Ok,
|
||||
)
|
||||
msg_box.exec()
|
||||
sys.exit(1)
|
||||
@@ -296,8 +296,8 @@ class ProgressWindow(QDialog):
|
||||
self.setWindowTitle(f"下载进度 {APP_NAME}")
|
||||
self.resize(400, 100)
|
||||
self.progress_bar_max = 100
|
||||
self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint)
|
||||
self.setWindowFlags(self.windowFlags() & ~Qt.WindowSystemMenuHint)
|
||||
self.setWindowFlags(self.windowFlags() & ~Qt.WindowType.WindowCloseButtonHint)
|
||||
self.setWindowFlags(self.windowFlags() & ~Qt.WindowType.WindowSystemMenuHint)
|
||||
|
||||
layout = QVBoxLayout()
|
||||
self.progress_bar = QProgressBar()
|
||||
@@ -354,7 +354,7 @@ class MainWindow(QMainWindow):
|
||||
try:
|
||||
os.makedirs(PLUGIN)
|
||||
except OSError as e:
|
||||
QMessageBox.critical(
|
||||
QtWidgets.QMessageBox.critical(
|
||||
self,
|
||||
f"错误 {APP_NAME}",
|
||||
f"\n无法创建缓存位置\n\n使用管理员身份运行或检查文件读写权限\n\n【错误信息】:{e}\n",
|
||||
@@ -385,7 +385,7 @@ class MainWindow(QMainWindow):
|
||||
self, f"选择游戏所在【上级目录】 {APP_NAME}"
|
||||
)
|
||||
if not self.selected_folder:
|
||||
QMessageBox.warning(
|
||||
QtWidgets.QMessageBox.warning(
|
||||
self, f"通知 {APP_NAME}", "\n未选择任何目录,请重新选择\n"
|
||||
)
|
||||
return
|
||||
@@ -414,14 +414,14 @@ class MainWindow(QMainWindow):
|
||||
json_title = "配置文件异常,无法解析错误类型"
|
||||
json_message = "配置文件异常,无法解析错误信息"
|
||||
|
||||
QMessageBox.critical(
|
||||
QtWidgets.QMessageBox.critical(
|
||||
self,
|
||||
f"错误 {APP_NAME}",
|
||||
f"\n下载配置获取失败\n\n【HTTP状态】:{status_code}\n【错误类型】:{json_title}\n【错误信息】:{json_message}\n",
|
||||
)
|
||||
return {}
|
||||
except ValueError as e:
|
||||
QMessageBox.critical(
|
||||
QtWidgets.QMessageBox.critical(
|
||||
self,
|
||||
f"错误 {APP_NAME}",
|
||||
f"\n配置文件格式异常\n\n【错误信息】:{e}\n",
|
||||
@@ -493,11 +493,11 @@ class MainWindow(QMainWindow):
|
||||
shutil.copy(sig_path, game_folder)
|
||||
|
||||
self.installed_status[game_version] = True
|
||||
QMessageBox.information(
|
||||
QtWidgets.QMessageBox.information(
|
||||
self, f"通知 {APP_NAME}", f"\n{game_version} 补丁已安装\n"
|
||||
)
|
||||
except (py7zr.Bad7zFile, FileNotFoundError, Exception) as e:
|
||||
QMessageBox.critical(
|
||||
QtWidgets.QMessageBox.critical(
|
||||
self,
|
||||
f"错误 {APP_NAME}",
|
||||
f"\n文件操作失败,请重试\n\n【错误信息】:{e}\n",
|
||||
@@ -505,7 +505,7 @@ class MainWindow(QMainWindow):
|
||||
finally:
|
||||
msg_box.close()
|
||||
else:
|
||||
QMessageBox.critical(
|
||||
QtWidgets.QMessageBox.critical(
|
||||
self,
|
||||
f"错误 {APP_NAME}",
|
||||
f"\n文件获取失败\n网络状态异常或服务器故障\n\n【错误信息】:{error}\n",
|
||||
@@ -526,7 +526,7 @@ class MainWindow(QMainWindow):
|
||||
|
||||
config = self.get_download_url()
|
||||
if not config:
|
||||
QMessageBox.critical(
|
||||
QtWidgets.QMessageBox.critical(
|
||||
self, f"错误 {APP_NAME}", "\n网络状态异常或服务器故障,请重试\n"
|
||||
)
|
||||
return
|
||||
@@ -583,7 +583,7 @@ class MainWindow(QMainWindow):
|
||||
failed_ver = "\n".join(
|
||||
[i for i in self.installed_status if not self.installed_status[i]]
|
||||
)
|
||||
QMessageBox.information(
|
||||
QtWidgets.QMessageBox.information(
|
||||
self,
|
||||
f"完成 {APP_NAME}",
|
||||
f"\n安装结果:\n安装成功数:{len(installed_version.splitlines())} 安装失败数:{len(failed_ver.splitlines())}\n"
|
||||
@@ -594,20 +594,20 @@ class MainWindow(QMainWindow):
|
||||
self.shutdown_app(event)
|
||||
|
||||
def shutdown_app(self, event=None):
|
||||
reply = QMessageBox.question(
|
||||
reply = QtWidgets.QMessageBox.question(
|
||||
self,
|
||||
"退出程序",
|
||||
"\n是否确定退出?\n",
|
||||
QMessageBox.Yes | QMessageBox.No,
|
||||
QMessageBox.No,
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No,
|
||||
QtWidgets.QMessageBox.StandardButton.No,
|
||||
)
|
||||
|
||||
if reply == QMessageBox.Yes:
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
if (
|
||||
self.current_download_thread
|
||||
and self.current_download_thread.isRunning()
|
||||
):
|
||||
QMessageBox.critical(
|
||||
QtWidgets.QMessageBox.critical(
|
||||
self,
|
||||
f"错误 {APP_NAME}",
|
||||
"\n当前有下载任务正在进行,完成后再试\n",
|
||||
@@ -623,7 +623,7 @@ class MainWindow(QMainWindow):
|
||||
break
|
||||
except Exception as e:
|
||||
if attempt == 2:
|
||||
QMessageBox.critical(
|
||||
QtWidgets.QMessageBox.critical(
|
||||
self,
|
||||
f"错误 {APP_NAME}",
|
||||
f"\n清理缓存失败\n\n【错误信息】:{e}\n",
|
||||
|
||||
@@ -46,7 +46,7 @@ pyinstaller==6.14.1
|
||||
pyinstaller-hooks-contrib==2025.5
|
||||
pyparsing==3.2.3
|
||||
pyppmd==1.2.0
|
||||
PyQt-SiliconUI==1.0.1
|
||||
PyQt-SiliconUI==0.0.1
|
||||
PyQt5==5.15.11
|
||||
PyQt5-Qt5==5.15.2
|
||||
PyQt5_sip==12.17.0
|
||||
|
||||
Reference in New Issue
Block a user