From 69bd13ff37030b34968eee5d13c25adcc489221c Mon Sep 17 00:00:00 2001 From: Thierry Lelegard Date: Fri, 21 Apr 2023 17:06:38 +0200 Subject: [PATCH] Fixed install script --- install.ps1 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/install.ps1 b/install.ps1 index a03dc1e..9067fe7 100644 --- a/install.ps1 +++ b/install.ps1 @@ -3,20 +3,17 @@ [CmdletBinding(SupportsShouldProcess=$true)] param([switch]$NoPause = $false) -# Find architecture directory. $OSArch = (Get-WmiObject Win32_OperatingSystem).OSArchitecture $Arch = if ($OSArch -like "*arm*") {"arm64"} elseif ($OSArch -like "*64*") {"x64"} else {"x86"} +$EndOpt = if ($NoPause) {"-np"} else {"-p"} if (Test-Path "$PSScriptRoot\$Arch\Release\kbdadmin.exe") { - & "$PSScriptRoot\$Arch\Release\kbdadmin.exe" -i "$PSScriptRoot\$Arch\Release" + & "$PSScriptRoot\$Arch\Release\kbdadmin.exe" -i "$PSScriptRoot\$Arch\Release" $EndOpt } elseif (Test-Path "$PSScriptRoot\$Arch\setup.exe") { - & "$PSScriptRoot\$Arch\setup.exe" + & "$PSScriptRoot\$Arch\setup.exe" $EndOpt } else { Write-Output "No installation program found" -} - -if (-not $NoPause) { - pause + if (-not $NoPause) {pause} }