-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild-installer.ps1
More file actions
69 lines (59 loc) · 2.3 KB
/
build-installer.ps1
File metadata and controls
69 lines (59 loc) · 2.3 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
# Create inno-setup directories if they don't exist already
if (-not (Test-Path "inno-setup")) {
New-Item -Path "inno-setup" -ItemType Directory -Force | Out-Null
}
if (-not (Test-Path "inno-setup\input")) {
New-Item -Path "inno-setup\input" -ItemType Directory -Force | Out-Null
}
# Copy signed artifacts
if (Test-Path "SignedArtifacts") {
Copy-Item "SignedArtifacts\*" -Destination "inno-setup\input\" -Recurse -Force
}
$platform = "x64"
# Display directory contents for debugging
Write-Host "Contents of SignedArtifacts directory:"
if (Test-Path "SignedArtifacts") {
Get-ChildItem "SignedArtifacts"
} else {
Write-Host "SignedArtifacts directory not found"
}
Write-Host "Contents of inno-setup\input directory after copy:"
Get-ChildItem "inno-setup\input"
# Check if Companion directory exists before attempting operations
if (Test-Path "inno-setup\input\Companion") {
Write-Host "Contents of Companion directory:"
Get-ChildItem "inno-setup\input\Companion" -Recurse
} else {
Write-Host "Companion directory not found"
}
# Set release tag
$releaseTag = (Get-Date).ToString('yy.MM.dd')
if (Test-Path "inno-setup\Setup.iss") {
(Get-Content "inno-setup\Setup.iss") |
ForEach-Object { $_ -replace '1.0.0', $releaseTag } |
Set-Content "inno-setup\Setup.iss"
}
# ARM64-specific handling
if ($platform -eq 'ARM64') {
if (Test-Path "inno-setup\Setup.iss") {
(Get-Content "inno-setup\Setup.iss") |
ForEach-Object { $_ -replace 'x64compatible', 'arm64' } |
Set-Content "inno-setup\Setup.iss"
(Get-Content "inno-setup\Setup.iss") |
ForEach-Object { $_ -replace '-x64', '-arm64' } |
Set-Content "inno-setup\Setup.iss"
}
# VDDSysTray has been replaced with VDDControl
if (Test-Path "inno-setup\input\Companion\VDDControl.exe") {
Remove-Item "inno-setup\input\Companion\VDDControl.exe" -Force
Write-Host "Removed x64 VDDControl.exe"
}
# Check if ARM64 VDDControl exists before copying
if (Test-Path "inno-setup\input\Companion\arm64\VDDControl.exe") {
Copy-Item "inno-setup\input\Companion\arm64\VDDControl.exe" -Destination "inno-setup\input\Companion\" -Force
Write-Host "Copied ARM64 VDDControl.exe"
} else {
Write-Host "Warning: ARM64 VDDControl.exe not found in expected location"
Get-ChildItem "inno-setup\input\Companion" -Recurse
}
}