1+ # Don't use mkdir -p which is failing on GitHub Actions
2+ # Instead use native PowerShell commands with error handling
3+
4+ # Clean and recreate the directories to ensure fresh state
5+ try {
6+ # Create directories if they don't exist (no error if they do)
7+ if (-not (Test-Path " inno-setup" )) {
8+ New-Item - Path " inno-setup" - ItemType Directory - Force | Out-Null
9+ Write-Host " Created inno-setup directory"
10+ } else {
11+ Write-Host " inno-setup directory already exists"
12+ }
13+
14+ if (-not (Test-Path " inno-setup\input" )) {
15+ New-Item - Path " inno-setup\input" - ItemType Directory - Force | Out-Null
16+ Write-Host " Created inno-setup\input directory"
17+ } else {
18+ Write-Host " inno-setup\input directory already exists"
19+ }
20+
21+ # Copy signed artifacts with error handling
22+ if (Test-Path " SignedArtifacts" ) {
23+ Copy-Item " SignedArtifacts\*" - Destination " inno-setup\input\" - Recurse - Force
24+ Write-Host " Copied artifacts successfully"
25+ } else {
26+ Write-Host " WARNING: SignedArtifacts directory not found"
27+ }
28+
29+ # Get platform from environment if available
30+ $platform = if ($env: PLATFORM ) { $env: PLATFORM } else { " x64" }
31+
32+ # Display directory contents for debugging
33+ Write-Host " Contents of inno-setup\input directory after copy:"
34+ Get-ChildItem " inno-setup\input" - ErrorAction SilentlyContinue
35+
36+ # Check if Companion directory exists
37+ if (Test-Path " inno-setup\input\Companion" ) {
38+ Write-Host " Contents of Companion directory:"
39+ Get-ChildItem " inno-setup\input\Companion" - Recurse - ErrorAction SilentlyContinue
40+ } else {
41+ Write-Host " Companion directory not found"
42+ }
43+
44+ # Set release tag
45+ $releaseTag = (Get-Date ).ToString(' yy.MM.dd' )
46+ if (Test-Path " inno-setup\Setup.iss" ) {
47+ (Get-Content " inno-setup\Setup.iss" ) |
48+ ForEach-Object { $_ -replace ' 1.0.0' , $releaseTag } |
49+ Set-Content " inno-setup\Setup.iss"
50+ Write-Host " Updated version to $releaseTag "
51+ } else {
52+ Write-Host " WARNING: inno-setup\Setup.iss not found"
53+ }
54+
55+ # ARM64-specific handling
56+ if ($platform -eq ' ARM64' ) {
57+ Write-Host " Handling ARM64-specific changes"
58+ if (Test-Path " inno-setup\Setup.iss" ) {
59+ (Get-Content " inno-setup\Setup.iss" ) |
60+ ForEach-Object { $_ -replace ' x64compatible' , ' arm64' } |
61+ Set-Content " inno-setup\Setup.iss"
62+
63+ (Get-Content " inno-setup\Setup.iss" ) |
64+ ForEach-Object { $_ -replace ' -x64' , ' -arm64' } |
65+ Set-Content " inno-setup\Setup.iss"
66+
67+ Write-Host " Updated architecture settings in Setup.iss"
68+ }
69+
70+ # VDDSysTray has been replaced with VDDControl
71+ if (Test-Path " inno-setup\input\Companion\VDDControl.exe" ) {
72+ Remove-Item " inno-setup\input\Companion\VDDControl.exe" - Force
73+ Write-Host " Removed x64 VDDControl.exe"
74+ }
75+
76+ # Check if ARM64 VDDControl exists before copying
77+ if (Test-Path " inno-setup\input\Companion\arm64\VDDControl.exe" ) {
78+ Copy-Item " inno-setup\input\Companion\arm64\VDDControl.exe" - Destination " inno-setup\input\Companion\" - Force
79+ Write-Host " Copied ARM64 VDDControl.exe"
80+ } else {
81+ Write-Host " WARNING: ARM64 VDDControl.exe not found in expected location"
82+ Get-ChildItem " inno-setup\input\Companion" - Recurse - ErrorAction SilentlyContinue
83+ }
84+ }
85+
86+ Write-Host " Script completed successfully"
87+ } catch {
88+ Write-Host " ERROR: $_ "
89+ throw $_
90+ }
0 commit comments