# 桌面安装包 安装包输出写入仓库 `dist/`,不提交构建产物。Linux 暂存目录位于 `${TMPDIR:-/tmp}`, 避免 WSL 挂载盘的权限导致 dpkg 拒绝打包;脚本打印暂存路径,保留供检查和手动清理。版本默认取 `flutter_sender/pubspec.yaml` 的前三段版本号,可通过参数覆盖。 ## Windows x64 日常交付使用统一入口(默认递增补丁版本和构建号、同步 Android/Flutter/Rust,编译测试后生成三种 Android APK 与 Windows 安装器): ```powershell ./installer/release.ps1 -VCRedist 'C:/path/to/vc_redist.x64.exe' -Iscc 'C:/path/to/ISCC.exe' ``` 已在本轮手动递增版本时增加 `-UseCurrentVersion`,避免重复递增。产物位于 `dist/releases/v<版本>/`, 含 SHA256SUMS。新版成功生成后清理旧安装包和暂存目录;用户日志和本地设备配置保留在 `dist/validation/retained-artifact-data/`。 安装器在覆盖文件前按完整路径停止目标安装目录中的主控与信令进程;停止失败时中止安装并提示重试。 需要 Windows Flutter/Visual Studio C++、Rust MSVC、Go、Inno Setup 6。 从 Microsoft/Visual Studio 获取官方 `vc_redist.x64.exe`,安装器会运行它安装运行库 (运行库安装可能请求管理员权限)。安装程序默认按当前用户安装,含开始菜单、可选桌面快捷方式、卸载入口。 ```powershell ./installer/windows/setup.ps1 -VCRedist 'C:/path/to/vc_redist.x64.exe' # 指定 Inno Setup 或使用已有的完整 Release 便携目录,跳过应用编译 ./installer/windows/setup.ps1 -Bundle './dist/TTSTDConnect-Windows' -Iscc 'C:/Program Files (x86)/Inno Setup 6/ISCC.exe' -VCRedist 'C:/path/to/vc_redist.x64.exe' -Version 0.1.0 ``` 输出 `dist/windows/TTSTDConnect-<版本>-windows-x64-setup.exe`。默认执行 Rust 离线检查、 单元测试、Release 构建,Flutter pub get、分析、Debug/Release 构建及 Go 信令构建; 先准备 Cargo 缓存(`cargo fetch --locked`)。已有 `package.ps1` 仍提供便携包。 ## Linux x86_64 / WSL Ubuntu 需要 Linux Flutter SDK、Clang、CMake、Ninja、pkg-config、GTK 开发包、Rust、Go (版本满足 `signaling_server/go.mod`)。不要使用 Windows Flutter SDK。 Ubuntu 构建依赖示例: ```bash sudo apt install clang cmake ninja-build pkg-config libgtk-3-dev file dpkg-dev rpm # Rust 依赖只需首次联网准备 (cd rust_core && cargo fetch --locked) bash installer/linux/package.sh --format deb bash installer/linux/package.sh --format rpm # 自行安装官方 appimagetool,或通过 APPIMAGETOOL 指定其路径 APPIMAGETOOL=/path/to/appimagetool bash installer/linux/package.sh --format appimage bash installer/package.sh --format all ``` 输出在 `dist/linux/`,支持 `--version 0.1.0`。脚本先检查选定格式工具,再编译 Rust、 Flutter Release 和 Go。包安装到 `/opt/ttstdconnect`,命令为 `ttstdconnect`,含桌面菜单入口。 Rust 库与信令服务放在可执行文件旁。 已有完整 **Linux Release** bundle 时,可跳过应用编译: ```bash bash installer/linux/package.sh --format deb --bundle /absolute/path/to/bundle ``` 该目录必须包含 `ttstd_sender`、`libttstdconnect_core.so`、`signaling_server`、 `lib/libflutter_linux_gtk.so`、`lib/libapp.so`、`data/flutter_assets`;不接受 Debug bundle。 Windows 和 Linux 共用源码目录时,先运行各自的 `flutter pub get`,避免另一平台的 SDK 缓存路径导致分析失败。 AppImage 打包工具自身若依赖 FUSE,可按其说明设置 `APPIMAGE_EXTRACT_AND_RUN=1`。 AppImage 包含应用私有库,系统 GTK/glibc 等仍由目标系统提供;建议在最老的目标发行版编译, Ubuntu 24.04 产物不保证能在较老发行版运行。deb/rpm 声明构建宿主机的 glibc 下限。 RPM 的 License 暂按 Proprietary 填写(仓库尚无 LICENSE);发布前确认授权和维护者信息。 这些脚本不增加 Linux 视频/音频插件,打包成功不代表投屏功能已补齐。