feat(install): 更新安装目录选择逻辑和资源打包配置- 修改默认安装路径为 C:\Program Files- 简化目录选择对话框标题

- 新增 gameins 模块到 Tauri 应用
- 配置 game.7z 文件作为应用资源打包
This commit is contained in:
Chaos
2025-11-11 20:29:06 +08:00
parent e3a89d2b77
commit 9f9a0f72de
5 changed files with 7 additions and 4 deletions

BIN
src-tauri/sources/game.7z Normal file

Binary file not shown.

0
src-tauri/src/gameins.rs Normal file
View File

View File

@@ -1,5 +1,5 @@
mod network; mod network;
mod gameins;
#[cfg_attr(mobile, tauri::mobile_entry_point)] #[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() { pub fn run() {
tauri::Builder::default() tauri::Builder::default()

View File

@@ -34,7 +34,10 @@
"icons/128x128@2x.png", "icons/128x128@2x.png",
"icons/icon.icns", "icons/icon.icns",
"icons/icon.ico" "icons/icon.ico"
] ],
"resources": [
"sources/game.7z"
]
} }
} }

View File

@@ -8,7 +8,7 @@
// 1. 打开目录选择对话框 // 1. 打开目录选择对话框
async function selectInstallDir() { async function selectInstallDir() {
// 默认打开 C:/Program Files仅限 Windows
const defaultPath = 'C:\\Program Files'; const defaultPath = 'C:\\Program Files';
if (installPath !== '未选择安装路径'){ if (installPath !== '未选择安装路径'){
log("重新选择安装目录"); log("重新选择安装目录");
@@ -17,7 +17,7 @@
const selected = await open({ const selected = await open({
directory: true, // 必须选择目录 directory: true, // 必须选择目录
multiple: false, // 只能选择一个 multiple: false, // 只能选择一个
title: '请选择游戏的安装目录', title: '请选择安装目录',
defaultPath: defaultPath, // 初始打开的路径 defaultPath: defaultPath, // 初始打开的路径
}); });