-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.ps1
More file actions
81 lines (66 loc) · 2.52 KB
/
package.ps1
File metadata and controls
81 lines (66 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Cross‑platform packaging script for PaintPower
# Creates installers for Windows (MSIX), macOS (DMG), Linux (AppImage)
$ErrorActionPreference = "Stop"
# RIDs to package
$targets = @(
"win-x86",
"win-x64",
"win-arm64",
"linux-x64",
"linux-arm64",
"linux-musl-x64",
"linux-musl-arm64",
"osx-x64",
"osx-arm64"
)
# Create output folder
New-Item -ItemType Directory -Force -Path "dist" | Out-Null
foreach ($rid in $targets) {
Write-Host "Packaging $rid..."
$publishDir = "publish/$rid"
$outputDir = "dist/$rid"
New-Item -ItemType Directory -Force -Path $outputDir | Out-Null
if ($rid -like "win-*") {
# Windows MSIX packaging
Write-Host " -> Creating MSIX package..."
# This assumes you have an AppxManifest.xml in your project
Copy-Item "$publishDir/*" $outputDir -Recurse -Force
# Developer note: MSIX packaging normally uses MakeAppx.exe or VS packaging project
# Here we simply stage the folder for packaging
}
elseif ($rid -like "osx-*") {
# macOS DMG packaging
Write-Host " -> Creating DMG..."
$appName = "PaintPower.app"
$appPath = "$outputDir/$appName"
# Create .app bundle structure
New-Item -ItemType Directory -Force -Path "$appPath/Contents/MacOS" | Out-Null
New-Item -ItemType Directory -Force -Path "$appPath/Contents/Resources" | Out-Null
Copy-Item "$publishDir/*" "$appPath/Contents/MacOS" -Recurse -Force
# Create DMG
$dmgName = "PaintPower-$rid.dmg"
hdiutil create -volname "PaintPower" -srcfolder $appPath -ov -format UDZO "dist/$dmgName"
}
elseif ($rid -like "linux-*") {
# Linux AppImage packaging
Write-Host " -> Creating AppImage..."
$appDir = "$outputDir/AppDir"
New-Item -ItemType Directory -Force -Path $appDir | Out-Null
Copy-Item "$publishDir/*" $appDir -Recurse -Force
# Basic AppImage structure
New-Item -ItemType File -Force -Path "$appDir/AppRun" | Out-Null
Set-Content "$appDir/AppRun" "#!/bin/bash`nexec ./PaintPower" -NoNewline
chmod +x "$appDir/AppRun"
# Desktop entry
Set-Content "$appDir/paintpower.desktop" "[Desktop Entry]
Type=Application
Name=PaintPower
Exec=PaintPower
Icon=paintpower
Categories=Graphics;" -NoNewline
# AppImage creation (requires appimagetool)
$appImageName = "PaintPower-$rid.AppImage"
appimagetool $appDir "dist/$appImageName"
}
}
Write-Host "All installers created in /dist"