download and install instead of direct installation
This commit is contained in:
@@ -8,9 +8,14 @@ If ( IsAdmin )
|
||||
Else { $URL = 'https://download.wireguard.com/windows-client/wireguard-x86-latest.msi' }
|
||||
|
||||
## Install package
|
||||
Try { Start-Process "msiexec.exe" -ArgumentList "/i ${URL} /qn /norestart DO_NOT_LAUNCH=1" -Wait -ErrorAction Stop }
|
||||
$Installer = Download-File -URL $URL
|
||||
Try { Start-Process "msiexec.exe" -ArgumentList "/i ${Installer} /qn /norestart DO_NOT_LAUNCH=1" -Wait -ErrorAction Stop }
|
||||
Catch { LogErr $_.Exception.Message ; Exit }
|
||||
|
||||
## Delete installer
|
||||
Try { If ( Test-Path $Installer ) { Remove-Item $Installer -Force } }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
|
||||
## Install manager service
|
||||
Try { Start-Process "${Env:ProgramFiles}\WireGuard\wireguard.exe" -ArgumentList '/installmanagerservice' -Wait -ErrorAction SilentlyContinue }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
|
||||
Reference in New Issue
Block a user