From 181426ee413a5f7f6a5685b910a0b5959dca8b1e Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 7 Aug 2024 14:40:24 +0200 Subject: [PATCH] Add a script for installing ASUS packages --- scripts/Windows/Scripts/Software.ps1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/Windows/Scripts/Software.ps1 b/scripts/Windows/Scripts/Software.ps1 index 3cdd2776..ac2d1eae 100644 --- a/scripts/Windows/Scripts/Software.ps1 +++ b/scripts/Windows/Scripts/Software.ps1 @@ -58,6 +58,32 @@ $null = New-Module { } } + <# + .SYNOPSIS + Installs a package downloaded from ASUS. + + .PARAMETER URL + The URL to download the package from. + #> + function Install-AsusPackage { + param( + [string] $URL + ) + + $file = "AsusPackage.zip"; + $dir = New-TemporaryDirectory; + $unpackDir = New-TemporaryDirectory; + + $null = Push-Location $dir; + Invoke-WebRequest $URL -OutFile $file; + Expand-Archive $file $unpackDir; + $null = Pop-Location; + Remove-Item -Recurse $dir; + + $null = Start-Process -Wait -WorkingDirectory $unpackDir -FilePath (Join-Path $unpackDir "AsusSetup.exe") -ArgumentList "/S"; + Remove-Item -Recurse $unpackDir; + } + function Start-SoftwareInstaller { param( [string] $Name,