-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmake_inno.ps1
46 lines (40 loc) · 1.2 KB
/
make_inno.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
param (
[string]$Arch = "x64",
[string]$Version = "1.0.0",
[string]$Build = "1",
[string]$Branding,
[switch]$Sign = $false,
[string]$CertName = "Ascensio System SIA",
[string]$TimestampServer = "http://timestamp.digicert.com"
)
$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
# Check app directory
if ( -Not (Test-Path -Path "build\app") ) {
Write-Error "Path build\app does not exist"
}
# ISCC path
if ( $env:INNOPATH ) {
$InnoPath = $env:INNOPATH
}
else
{
$InnoPath = (Get-ItemProperty "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1")."Inno Setup: App Path"
}
$env:Path = "$InnoPath;$env:Path"
# ISCC args
$InnoArgs = "/DAPP_DIR=..\build\app",
"/DOUTPUT_DIR=..\build",
"/DARCH=$Arch",
"/DVERSION=$Version.$Build"
if ( $Branding ) {
$InnoArgs += "/DBRANDING_DIR=$Branding"
}
if ( $Sign ) {
$InnoArgs += "/DSIGN"
$InnoArgs += "/Sbyparam=signtool.exe sign /a /v /n `$q$CertName`$q /t $TimestampServer `$f"
}
# Build
Write-Host "ISCC $InnoArgs exe\builder.iss" -ForegroundColor Yellow
& ISCC $InnoArgs exe\builder.iss
Exit $LastExitCode