forked from dalyIsaac/Whim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Create-Installer.ps1
31 lines (26 loc) · 743 Bytes
/
Create-Installer.ps1
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
<#
.SYNOPSIS
Creates the Whim installer.
#>
param (
[Parameter(Mandatory = $true, Position = 0)]
[ValidateSet('x64', 'arm64')]
[string]$Architecture
)
$buildDir = "src\Whim.Runner\bin\${Architecture}\Release\net8.0-windows10.0.19041.0"
$version = (Get-Item "${buildDir}\Whim.Runner.exe").VersionInfo.ProductVersion
$installerName = "WhimInstaller-${Architecture}-${version}"
$output = & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" .\whim-installer.iss `
/DMyBuildDir="$buildDir" `
/DMyOutputBaseFilename="$installerName" `
/DMyVersion="$version"
$path = $output.Split("\n")[-1]
# Test if the installer exists.
if (Test-Path $path) {
return $path
}
else {
Write-Host "Failed to create installer"
Write-Host $output
exit 1
}