Files
LanMountainDesktop/docs/LAUNCHER_DISTRIBUTION.md

130 lines
3.5 KiB
Markdown
Raw Normal View History

Launcher (#4) * 激进的更新 * 试试 * fix.可爱的我一直在修CI( * fix.启动器一定要能够启动 * feat.尝试弄了AOT的启动器。 * fix.修CI,好像是因为Linux那边有个问题,反正修就对了。 * fix.ci难修,为什么liunx跑不起来呢? * Update build.yml * Update LanMountainDesktop.csproj * changed.调整了启动逻辑,优化了更新页面。 * changed.优化了更新体验 * feat.依旧试增量更新这一块,看看velopack * fix.我们试验性地修复了启动器无法正常启动的问题,原因可能是这个画面没有启动,就GUI没显示。然后还把编译问题修了一下。 * fix.继续修ci,ci怎么天天炸 * changed.velopack,试试rust * fix.修ci,修融合桌面,修启动器 * fix.GitHub Action工作流怎么天天出问题 * feat.引入velopack,不好,是rust(至少内存很安全了。 * chore: migrate release pipeline to signed filemap and wire rainyun s3 * fix: make optional s3 upload step workflow-parse safe * fix: make delta pack generation robust for empty diffs and linux paths * chore: rotate launcher update public key for pdc signing * fix: restore stable launcher update public key * fix: sync launcher public key with update signing secret * fix: normalize PEM line endings in signing key validation * fix: rotate launcher public key to match ci signing secret * fix: compare signing keys by SPKI instead of PEM text * refactor update backend to host-managed PDC pipeline * fix release workflow env key collisions * relax publish-pdc precheck to require S3 only * set GH_TOKEN for PDCC installer step * ci: add local pdc mock fallback for release publish * ci: fix pdc mock process log redirection * ci: fallback pdcc signing key to update private key * ci: ensure pdcc signing passphrase env is always set * ci: create pdcc publish root before invoking client * ci: set pdcc version variable from release version * ci: decouple pdcc installer version from publish config version * ci: package pdcc subchannels with generated filemap and changelog * ci: make local pdc mock diff return empty for fast fallback * ci: fix pdcc variable mapping and pdc signing prechecks * Update App.axaml.cs * ci: wire aws cli credentials for rainyun s3 * ci: pin pdcc client version separately from app version * ci: harden local pdc mock transport handling * ci: publish pdcc subchannels in one pass * ci: add pdcc publish heartbeat and timeout * ci: fix pdcc publish workdir bootstrap * feat.Penguin Logistics Online Network Distribution System * ci: fix plonds s3 probe and signing fallback * ci: validate signing key and quiet missing baselines * ci: relax aws checksum mode for rainyun s3 * ci: avoid multipart uploads to rainyun s3 * ci: handle empty plonds baselines safely * ci.plonds * Rebuild release pipeline around PLONDS and DDSS * Fix Windows installer script path in release workflow
2026-04-21 20:59:52 +08:00
# Launcher 打包分发指南
## 目录结构
打包给用户的 Launcher 应该包含以下结构:
```
LanMountainDesktop/
├── LanMountainDesktop.Launcher.exe # 启动器可执行文件
├── LanMountainDesktop.Launcher.dll # 启动器依赖
├── ... # 其他启动器依赖文件
├── app-1.0.0/ # 主程序部署目录
│ ├── LanMountainDesktop.exe # 主程序可执行文件
│ ├── LanMountainDesktop.dll # 主程序依赖
│ ├── version.json # 版本信息文件
│ └── .current # 当前版本标记文件
└── plugins/ # 插件目录(可选)
```
## 打包步骤
### 1. 构建 Launcher
```bash
dotnet build LanMountainDesktop.Launcher/LanMountainDesktop.Launcher.csproj -c Release
```
### 2. 构建主程序
```bash
dotnet build LanMountainDesktop/LanMountainDesktop.csproj -c Release
```
### 3. 创建部署目录
```powershell
# 创建版本目录
New-Item -ItemType Directory -Path "dist/app-1.0.0" -Force
# 复制主程序文件
Copy-Item "LanMountainDesktop/bin/Release/net10.0/*" "dist/app-1.0.0/" -Recurse
# 创建版本标记
New-Item -ItemType File -Path "dist/app-1.0.0/.current" -Force
```
### 4. 复制 Launcher
```powershell
# 复制启动器文件
Copy-Item "LanMountainDesktop.Launcher/bin/Release/net10.0/*" "dist/" -Recurse
```
### 5. 创建安装包
可以使用以下工具创建安装包:
- **Inno Setup** - Windows 安装程序
- **WiX Toolset** - Windows Installer
- **MSIX** - Windows 应用包
- **Zip** - 便携版
## 用户数据存储位置
Launcher 会将用户配置存储在以下位置:
```
%LOCALAPPDATA%\LanMountainDesktop\.launcher\
├── devmode.config # 开发模式状态
└── custom-host-path.config # 自定义主程序路径
```
这些文件:
- **不会**随应用更新而删除
- **不会**随应用卸载而删除(除非用户手动清理)
- 在重装应用后会自动恢复之前的配置
## 生产环境行为
### 正常启动流程
1. 用户双击 `LanMountainDesktop.Launcher.exe`
2. Launcher 查找 `app-*` 目录中的主程序
3. 启动主程序并传递版本信息
4. 主程序显示正确的版本和开发代号
### 更新流程
1. 新版本下载到 `app-{new-version}/`
2. 创建 `.current` 标记指向新版本
3. 旧版本标记为 `.destroy`
4. 下次启动时自动使用新版本
## 开发环境配置
### 启用开发模式
1. 启动 Launcher如果找不到主程序会显示错误窗口
2.`Ctrl+Shift+D` 打开调试窗口
3. 勾选"启用开发模式"
4. 选择自定义主程序路径
5. 关闭窗口,配置会自动保存
### 开发模式优先级
开发模式的配置**不会**影响生产环境:
- 生产环境优先使用 `app-*` 目录
- 开发模式仅在找不到部署目录时生效
- 开发模式配置保存在用户数据目录,不影响其他用户
## 故障排除
### Launcher 找不到主程序
1. 检查 `app-*` 目录是否存在
2. 检查 `.current` 标记文件是否存在
3. 检查主程序可执行文件是否存在
4. 查看 `%LOCALAPPDATA%\LanMountainDesktop\.launcher\` 下的配置
### 版本信息不正确
1. 检查 `app-*/version.json` 是否存在
2. 检查 `version.json` 内容是否正确
3. 重新构建主程序生成新的 `version.json`
### 开发模式配置丢失
1. 检查 `%LOCALAPPDATA%\LanMountainDesktop\.launcher\` 目录权限
2. 检查磁盘空间是否充足
3. 手动删除配置目录后重新配置