9 Commits

Author SHA1 Message Date
欧阳淇淇
803f32b567 ci(build-release): 放宽触发条件以支持任意标签
将 GitHub Actions 工作流的触发条件从仅限 'v*' 标签更改为
任意标签都会触发构建,提高发布流程的灵活性。
2025-12-17 23:46:50 +08:00
欧阳淇淇
ca6ef6443b ci(build-release): 添加图标文件验证步骤并修复图标路径配置
在构建发布工作流中添加了图标文件存在性验证步骤,确保构建时图标文件存在。
同时修改了 build.spec 文件中的图标路径配置方式,使用相对路径替代原有的绝对路径拼接方式,
以提高配置的可靠性和可维护性。
2025-12-17 23:43:56 +08:00
欧阳淇淇
ef7763dea0 refactor(extraction_thread): 优化压缩包内容分析的日志输出格式
将文件类型判断逻辑提取为变量,提高代码可读性。
2025-12-17 23:37:34 +08:00
欧阳淇淇
4b170b14f4 build(spec): 更新构建配置以包含新的模块和PySide6依赖
新增对 core.managers、core.handlers 和 ui.components 模块的子模块收集,
并移除旧的 handlers 模块引用。同时添加 PySide6 相关的隐藏导入依赖,
确保打包时包含必要的 Qt 模块。
2025-12-17 23:29:49 +08:00
欧阳淇淇
7f8e94fc25 build(gitignore): 添加 source/build.spec 到版本控制
新增 PyInstaller 构建配置文件 build.spec,用于定义应用打包时的模块、资源及可执行文件属性。
同时更新 .gitignore 以确保该配置文件被纳入版本管理。
2025-12-17 23:23:32 +08:00
欧阳淇淇
ba653b3470 build(workflow): 简化PyInstaller构建命令
将GitHub工作流中的PyInstaller构建步骤从冗长的手动参数调用改为使用build.spec配置文件,
以提高构建脚本的可维护性和清晰度。
2025-12-17 23:18:55 +08:00
欧阳淇淇
b1807abff7 build(workflow): 更新构建工作流配置以包含新增模块和资源
在 PyInstaller 构建命令中添加了新的数据目录 (bin, ui) 和多个隐藏导入模块,
包括 workers、core、handlers、utils 和 ui 等子模块。同时使用 --collect-submodules
选项确保所有相关子模块被正确收集,以解决打包后可能缺失依赖的问题。
2025-12-17 23:13:23 +08:00
欧阳淇淇
75ac82cb41 feat(ui): 为多个按钮文本添加颜色样式
在Ui_install.py中为“开始安装”、“禁/启用补丁”、“卸载补丁”和“退出程序”按钮
文本添加了颜色样式(color: #3333),以提升界面视觉效果。
2025-12-17 23:04:36 +08:00
欧阳淇淇
e75f52ab9c feat(workflow): 添加构建和发布 GitHub Actions 工作流
新增一个 GitHub Actions 配置文件,用于在推送版本标签时自动构建并发布应用。
该工作流使用 PyInstaller 打包 Windows 可执行文件,并上传为 Release 资源。
2025-12-17 22:45:49 +08:00
6 changed files with 148 additions and 7 deletions

65
.github/workflows/build-release.yml vendored Normal file
View File

@@ -0,0 +1,65 @@
name: Build and Release
on:
push:
tags:
- '*' # 任意 tag 都会触发构建
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'source/requirements.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r source/requirements.txt
- name: Get version from tag
id: get_version
run: |
$version = "${{ github.ref_name }}"
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
- name: Verify icon file
run: |
cd source
if (Test-Path "assets/images/ICO/icon.ico") {
Write-Host "Icon file found"
Get-Item "assets/images/ICO/icon.ico"
} else {
Write-Host "Icon file NOT found!"
exit 1
}
- name: Build with PyInstaller
run: |
cd source
pyinstaller --noconfirm build.spec
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: release-${{ steps.get_version.outputs.VERSION }}
path: source/dist/FRAISEMOE_Addons_Installer_NEXT.exe
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: release-${{ steps.get_version.outputs.VERSION }}
files: source/dist/FRAISEMOE_Addons_Installer_NEXT.exe
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored
View File

@@ -31,6 +31,7 @@ MANIFEST
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
!source/build.spec
# Installer logs
pip-log.txt

73
source/build.spec Normal file
View File

@@ -0,0 +1,73 @@
# -*- mode: python ; coding: utf-8 -*-
import os
import sys
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
block_cipher = None
# 收集所有子模块
hiddenimports = []
hiddenimports += collect_submodules('workers')
hiddenimports += collect_submodules('core')
hiddenimports += collect_submodules('core.managers')
hiddenimports += collect_submodules('core.handlers')
hiddenimports += collect_submodules('ui')
hiddenimports += collect_submodules('ui.components')
hiddenimports += collect_submodules('utils')
hiddenimports += collect_submodules('config')
# PySide6 相关隐藏导入
hiddenimports += ['PySide6.QtCore', 'PySide6.QtGui', 'PySide6.QtWidgets']
a = Analysis(
['Main.py'],
pathex=['.'],
binaries=[],
datas=[
('assets', 'assets'),
('data', 'data'),
('config', 'config'),
('bin', 'bin'),
('ui', 'ui'),
('workers', 'workers'),
('core', 'core'),
('utils', 'utils'),
],
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='FRAISEMOE_Addons_Installer_NEXT',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=os.path.join('assets', 'images', 'ICO', 'icon.ico'),
)

View File

@@ -4,12 +4,12 @@ import datetime
# 配置信息
app_data = {
"APP_VERSION": "1.4.0",
"APP_VERSION": "1.4.2",
"APP_NAME": "FRAISEMOE Addons Installer NEXT",
"TEMP": "TEMP",
"CACHE": "FRAISEMOE",
"PLUGIN": "PLUGIN",
"CONFIG_URL": "aHR0cHM6Ly9hcGkuMncyLnRvcC9hcGkvb3V5YW5ncWlxaS9uZWtvcGFyYS9kb3dubG9hZF91cmwuanNvbg==",
"CONFIG_URL": "aHR0cHM6Ly9uZWtvcGFyYS1hcGkub3ZvZmlzaC5jb20vYXBpL291eWFuZ3FpcWkvbmVrb3BhcmEvZG93bmxvYWRfdXJsLmpzb24=",
"UA_TEMPLATE": "Mozilla/5.0 (Linux debian12 FraiseMoe2-Accept-Next) Gecko/20100101 Firefox/114.0 FraiseMoe2/{}",
"game_info": {
"NEKOPARA Vol.1": {

View File

@@ -410,7 +410,7 @@ class Ui_MainWindows(object):
self.start_install_text.setText("开始安装")
self.start_install_text.setFont(self.custom_font)
self.start_install_text.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.start_install_text.setStyleSheet("letter-spacing: 1px;")
self.start_install_text.setStyleSheet("color: #333333; letter-spacing: 1px;")
# 点击区域透明按钮
self.start_install_btn = QPushButton(self.button_container)
@@ -444,7 +444,7 @@ class Ui_MainWindows(object):
self.toggle_patch_text.setText("禁/启用补丁")
self.toggle_patch_text.setFont(self.custom_font)
self.toggle_patch_text.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.toggle_patch_text.setStyleSheet("letter-spacing: 1px;")
self.toggle_patch_text.setStyleSheet("color: #333333; letter-spacing: 1px;")
# 点击区域透明按钮
self.toggle_patch_btn = QPushButton(self.toggle_patch_container)
@@ -478,7 +478,7 @@ class Ui_MainWindows(object):
self.uninstall_text.setText("卸载补丁")
self.uninstall_text.setFont(self.custom_font)
self.uninstall_text.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.uninstall_text.setStyleSheet("letter-spacing: 1px;")
self.uninstall_text.setStyleSheet("color: #333333; letter-spacing: 1px;")
# 点击区域透明按钮
self.uninstall_btn = QPushButton(self.uninstall_container)
@@ -513,7 +513,7 @@ class Ui_MainWindows(object):
self.exit_text.setText("退出程序")
self.exit_text.setFont(self.custom_font)
self.exit_text.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.exit_text.setStyleSheet("letter-spacing: 1px;")
self.exit_text.setStyleSheet("color: #333333; letter-spacing: 1px;")
# 点击区域透明按钮
self.exit_btn = QPushButton(self.exit_container)

View File

@@ -105,7 +105,9 @@ class ExtractionThread(QThread):
debug_logger.debug(f"压缩包内容分析:")
debug_logger.debug(f"- 文件总数: {len(file_list)}")
for i, f in enumerate(file_list):
debug_logger.debug(f" {i+1}. {f} - 类型: {'文件夹' if f.endswith('/') or f.endswith('\\') else '文件'}")
is_folder = f.endswith('/') or f.endswith('\\')
file_type = '文件夹' if is_folder else '文件'
debug_logger.debug(f" {i+1}. {f} - 类型: {file_type}")
update_progress(20, f"正在分析 {self.game_version} 的补丁文件...")