geopro/installer/README.md

67 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Geopro Windows 安装包
把已构建的 `geopro_desktop` 打包成单个 Inno Setup 安装程序(带安装向导、开始菜单/桌面快捷方式、卸载程序,并自动安装 VC++ 运行时)。
## 一键打包
```powershell
# 1) 先构建 Release若尚未构建
build.bat app
# 2) 打包(默认版本 3.0.0,文件名带当天日期)
powershell -ExecutionPolicy Bypass -File installer\build_installer.ps1
```
产物:`installer\dist\Geopro_Setup_<版本>-<yyyyMMdd>.exe`
### 常用参数
| 参数 | 说明 |
|------|------|
| `-Version 3.1.0` | 指定版本号(最终文件名 `Geopro_Setup_3.1.0-<日期>.exe` |
| `-Rebuild` | 打包前先 `build.bat rebuild` 干净重编 |
| `-QtPrefix D:/Qt/6.11.1/msvc2022_64` | 指定 Qt 路径(默认从 `CMakePresets.json` 解析) |
| `-SkipDeploy` | 跳过 windeployqt不推荐仅 staging 已补齐时用) |
## 打包流程build_installer.ps1 做了什么)
1. **stage** — 把 `build/release/src/app` 复制到 `installer/staging`,剔除构建产物
`CMakeFiles/`、`*_autogen/`、`*.pdb`、`*.log`、`*.cmake`)。
2. **windeployqt** — 在 staging 上补齐 Qt 运行时缺件:`D3Dcompiler_47.dll`、`opengl32sw.dll`
(软件 OpenGL 回退、WebEngine QML、各类插件。
> 自动绕过已知坑:`qt6advanceddocking.dll` 名字带 `qt6` 前缀会被 windeployqt 误判为 Qt 模块、
> 去 `Qt\bin` 找它而报错中止——脚本临时把它拷进 `Qt\bin`,跑完即删。
3. **redist** — 确保 `vc_redist.x64.exe` 就位(缺则从本机 Visual Studio 复制)。
4. **ISCC** — 调用 Inno Setup 编译 `geopro.iss`LZMA2/max 固实压缩,输出到 `dist/`
## 安装包行为
- 默认装入 `C:\Program Files\Geopro`(需管理员权限)。
- 仅在系统**未安装** VC++ 2015-2022 x64 运行时时,静默安装 `vc_redist.x64.exe`
- 创建开始菜单项;桌面快捷方式为可选项(默认不勾)。
- 程序日志/配置写入 `%LOCALAPPDATA%\Geomative\Geopro3`,与安装目录解耦。
- 向导支持简体中文 / 英文。
## 前置依赖(打包机)
| 工具 | 获取方式 |
|------|----------|
| Inno Setup 6 | `winget install --id JRSoftware.InnoSetup -e` |
| Qt 6.11.1 (msvc2022_64) | 含 `windeployqt.exe`,已是构建依赖 |
| Visual Studio 2022/2026 (C++) | 提供 `vc_redist.x64.exe`,已是构建依赖 |
## 仓库内/生成物
入库(打包工具本体):
- `geopro.iss` — Inno Setup 脚本
- `build_installer.ps1` — 一键打包工具
- `lang/ChineseSimplified.isl` — 向导简体中文语言包
- `README.md`
不入库(每次生成,见 `.gitignore`
- `staging/` — 临时部署副本
- `redist/` — 复制来的 `vc_redist.x64.exe`
- `dist/` — 最终安装包