diff options
Diffstat (limited to '')
| -rw-r--r-- | scripts/installers/windows.ps1.in | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/installers/windows.ps1.in b/scripts/installers/windows.ps1.in index fd2b8b3..4b8e61d 100644 --- a/scripts/installers/windows.ps1.in +++ b/scripts/installers/windows.ps1.in | |||
| @@ -6,6 +6,9 @@ | |||
| 6 | # | 6 | # |
| 7 | # Run it with: | 7 | # Run it with: |
| 8 | # powershell -ExecutionPolicy Bypass -File .\zagan-bet-gui-*-install.ps1 | 8 | # powershell -ExecutionPolicy Bypass -File .\zagan-bet-gui-*-install.ps1 |
| 9 | # Add -NoPause to run it unattended. | ||
| 10 | param([switch]$NoPause) | ||
| 11 | |||
| 9 | $ErrorActionPreference = "Stop" | 12 | $ErrorActionPreference = "Stop" |
| 10 | 13 | ||
| 11 | $Version = "__VERSION__" | 14 | $Version = "__VERSION__" |
| @@ -13,9 +16,16 @@ $Binary = "__BINARY__" | |||
| 13 | $Sha256 = "__SHA256__" | 16 | $Sha256 = "__SHA256__" |
| 14 | $Url = "__URL__" | 17 | $Url = "__URL__" |
| 15 | 18 | ||
| 19 | function Finish([int]$Code) { | ||
| 20 | if (-not $NoPause) { | ||
| 21 | Read-Host "Press Enter to close" | Out-Null | ||
| 22 | } | ||
| 23 | exit $Code | ||
| 24 | } | ||
| 25 | |||
| 16 | function Stop-Install([string]$Message) { | 26 | function Stop-Install([string]$Message) { |
| 17 | Write-Host "install: $Message" -ForegroundColor Red | 27 | Write-Host "install: $Message" -ForegroundColor Red |
| 18 | exit 1 | 28 | Finish 1 |
| 19 | } | 29 | } |
| 20 | 30 | ||
| 21 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path | 31 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path |
| @@ -73,3 +83,5 @@ try { | |||
| 73 | Remove-Item -LiteralPath $temporary -Force | 83 | Remove-Item -LiteralPath $temporary -Force |
| 74 | } | 84 | } |
| 75 | } | 85 | } |
| 86 | |||
| 87 | Finish 0 | ||
