259 lines
6.4 KiB
YAML
259 lines
6.4 KiB
YAML
# Multi-Platform App - 多平台应用示例配置
|
|
# 这个示例展示了如何在一个配置文件中为多个平台和多种包类型配置安装包
|
|
|
|
name: "MultiPlatformApp"
|
|
version: "3.2.1"
|
|
description: "A comprehensive multi-platform application"
|
|
author: "Cross-Platform Team"
|
|
license: "Apache-2.0"
|
|
|
|
# 构建目标 - 为多个平台生成多种类型的安装包
|
|
targets:
|
|
# Windows 平台
|
|
- platform: "windows"
|
|
arch: "amd64"
|
|
packageType: "msi"
|
|
outputPath: "dist/windows/msi"
|
|
- platform: "windows"
|
|
arch: "amd64"
|
|
packageType: "zip"
|
|
outputPath: "dist/windows/zip"
|
|
|
|
# Linux 平台
|
|
- platform: "linux"
|
|
arch: "amd64"
|
|
packageType: "deb"
|
|
outputPath: "dist/linux/debian"
|
|
- platform: "linux"
|
|
arch: "amd64"
|
|
packageType: "rpm"
|
|
outputPath: "dist/linux/redhat"
|
|
- platform: "linux"
|
|
arch: "amd64"
|
|
packageType: "zip"
|
|
outputPath: "dist/linux/zip"
|
|
|
|
# macOS 平台
|
|
- platform: "darwin"
|
|
arch: "amd64"
|
|
packageType: "zip"
|
|
outputPath: "dist/macos"
|
|
|
|
# 文件 - 指定要包含在安装包中的文件,根据平台区分
|
|
files:
|
|
# 主程序 - 根据平台选择不同的可执行文件
|
|
- source: "bin/app-win.exe"
|
|
destination: "bin/app.exe"
|
|
permissions: "0755"
|
|
platforms: ["windows"]
|
|
- source: "bin/app-linux"
|
|
destination: "bin/app"
|
|
permissions: "0755"
|
|
platforms: ["linux"]
|
|
- source: "bin/app-macos"
|
|
destination: "bin/app"
|
|
permissions: "0755"
|
|
platforms: ["darwin"]
|
|
|
|
# 配置文件 - 所有平台通用
|
|
- source: "config/app.yaml"
|
|
destination: "config/app.yaml"
|
|
permissions: "0644"
|
|
|
|
# 平台特定配置文件
|
|
- source: "config/windows-config.yaml"
|
|
destination: "config/platform-config.yaml"
|
|
permissions: "0644"
|
|
platforms: ["windows"]
|
|
- source: "config/linux-config.yaml"
|
|
destination: "config/platform-config.yaml"
|
|
permissions: "0644"
|
|
platforms: ["linux"]
|
|
- source: "config/macos-config.yaml"
|
|
destination: "config/platform-config.yaml"
|
|
permissions: "0644"
|
|
platforms: ["darwin"]
|
|
|
|
# 文档 - 所有平台通用
|
|
- source: "README.md"
|
|
destination: "docs/README.md"
|
|
permissions: "0644"
|
|
- source: "LICENSE"
|
|
destination: "LICENSE"
|
|
permissions: "0644"
|
|
|
|
# 平台特定文档
|
|
- source: "docs/windows-guide.md"
|
|
destination: "docs/platform-guide.md"
|
|
permissions: "0644"
|
|
platforms: ["windows"]
|
|
- source: "docs/linux-guide.md"
|
|
destination: "docs/platform-guide.md"
|
|
permissions: "0644"
|
|
platforms: ["linux"]
|
|
- source: "docs/macos-guide.md"
|
|
destination: "docs/platform-guide.md"
|
|
permissions: "0644"
|
|
platforms: ["darwin"]
|
|
|
|
# 目录 - 指定要包含在安装包中的目录
|
|
directories:
|
|
# 共享资源 - 所有平台通用
|
|
- source: "assets/common"
|
|
destination: "assets"
|
|
permissions: "0755"
|
|
recursive: true
|
|
|
|
# 平台特定资源
|
|
- source: "assets/windows"
|
|
destination: "assets/platform"
|
|
permissions: "0755"
|
|
recursive: true
|
|
platforms: ["windows"]
|
|
- source: "assets/linux"
|
|
destination: "assets/platform"
|
|
permissions: "0755"
|
|
recursive: true
|
|
platforms: ["linux"]
|
|
- source: "assets/macos"
|
|
destination: "assets/platform"
|
|
permissions: "0755"
|
|
recursive: true
|
|
platforms: ["darwin"]
|
|
|
|
# 插件目录 - 所有平台通用
|
|
- source: "plugins"
|
|
destination: "plugins"
|
|
permissions: "0755"
|
|
recursive: true
|
|
|
|
# 平台特定配置
|
|
plugins:
|
|
# Windows MSI 配置
|
|
msi:
|
|
productCode: "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
|
|
upgradeCode: "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
|
|
manufacturer: "Cross-Platform Team"
|
|
|
|
# 快捷方式配置
|
|
shortcuts:
|
|
- name: "Multi-Platform App"
|
|
target: "[INSTALLDIR]bin\\app.exe"
|
|
workingDirectory: "INSTALLDIR"
|
|
icon: "assets/icon.ico"
|
|
location: "Desktop"
|
|
- name: "Multi-Platform App"
|
|
target: "[INSTALLDIR]bin\\app.exe"
|
|
workingDirectory: "INSTALLDIR"
|
|
icon: "assets/icon.ico"
|
|
location: "StartMenu"
|
|
|
|
# Linux DEB 配置
|
|
deb:
|
|
section: "utils"
|
|
priority: "optional"
|
|
maintainer: "Cross-Platform Team <team@example.com>"
|
|
|
|
# 创建桌面图标
|
|
desktop:
|
|
name: "Multi-Platform App"
|
|
exec: "/usr/bin/app"
|
|
icon: "/usr/share/icons/hicolor/256x256/apps/multiplatformapp.png"
|
|
categories: "Utility;Development;"
|
|
|
|
# 控制脚本
|
|
scripts:
|
|
postinst: "debian/postinst"
|
|
|
|
# Linux RPM 配置
|
|
rpm:
|
|
group: "Applications/Productivity"
|
|
vendor: "Cross-Platform Team"
|
|
|
|
# 创建桌面图标
|
|
desktop:
|
|
name: "Multi-Platform App"
|
|
exec: "/usr/bin/app"
|
|
icon: "/usr/share/icons/hicolor/256x256/apps/multiplatformapp.png"
|
|
categories: "Utility;Development;"
|
|
|
|
# 控制脚本
|
|
scripts:
|
|
post: "rpm/post"
|
|
|
|
# 安装前脚本 - 根据平台选择不同的脚本
|
|
preInstall:
|
|
windows:
|
|
path: "scripts/pre-install-win.ps1"
|
|
type: "powershell"
|
|
args: ["-ExecutionPolicy", "Bypass"]
|
|
linux:
|
|
path: "scripts/pre-install-linux.sh"
|
|
type: "shell"
|
|
args: ["--check-deps"]
|
|
darwin:
|
|
path: "scripts/pre-install-macos.sh"
|
|
type: "shell"
|
|
args: ["--check-deps"]
|
|
|
|
# 安装后脚本 - 根据平台选择不同的脚本
|
|
postInstall:
|
|
windows:
|
|
path: "scripts/post-install-win.ps1"
|
|
type: "powershell"
|
|
args: ["-ExecutionPolicy", "Bypass"]
|
|
linux:
|
|
path: "scripts/post-install-linux.sh"
|
|
type: "shell"
|
|
args: ["--configure"]
|
|
darwin:
|
|
path: "scripts/post-install-macos.sh"
|
|
type: "shell"
|
|
args: ["--configure"]
|
|
|
|
# 依赖项 - 根据平台定义不同的依赖
|
|
dependencies:
|
|
windows:
|
|
- name: ".NET Runtime"
|
|
version: ">=6.0.0"
|
|
type: "runtime"
|
|
- name: "Visual C++ Redistributable"
|
|
version: ">=14.0"
|
|
type: "runtime"
|
|
|
|
linux:
|
|
- name: "glibc"
|
|
version: ">=2.28"
|
|
type: "runtime"
|
|
- name: "libssl"
|
|
version: ">=1.1.0"
|
|
type: "runtime"
|
|
|
|
darwin:
|
|
- name: "libssl"
|
|
version: ">=1.1.0"
|
|
type: "runtime"
|
|
|
|
# 启动脚本 - 根据平台定义不同的启动脚本
|
|
scripts:
|
|
start:
|
|
windows: "bin\\start.bat"
|
|
linux: "bin/start.sh"
|
|
darwin: "bin/start.sh"
|
|
stop:
|
|
windows: "bin\\stop.bat"
|
|
linux: "bin/stop.sh"
|
|
darwin: "bin/stop.sh"
|
|
|
|
# 升级配置
|
|
upgrade:
|
|
# 保留的配置文件
|
|
keepFiles:
|
|
- "config/user-settings.yaml"
|
|
- "data/user-data.db"
|
|
|
|
# 升级前备份
|
|
backup: true
|
|
|
|
# 版本兼容性检查
|
|
compatibilityCheck: true |