From cfd7c17fc7a1f65c7b8856b81ada47d3b997e6f4 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 15 Jul 2023 12:18:13 +0200 Subject: [PATCH] Add script for installing amd chipset driver --- profiles/DerGeret/Windows/Drivers.ps1 | 1 + .../Drivers/AMDChipsetX399/Install.ps1 | 5 ++++ scripts/Windows/Scripts/SoftwarePackage.ps1 | 25 +++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 scripts/Windows/Drivers/AMDChipsetX399/Install.ps1 create mode 100644 scripts/Windows/Scripts/SoftwarePackage.ps1 diff --git a/profiles/DerGeret/Windows/Drivers.ps1 b/profiles/DerGeret/Windows/Drivers.ps1 index d31d5034..5ea131e0 100644 --- a/profiles/DerGeret/Windows/Drivers.ps1 +++ b/profiles/DerGeret/Windows/Drivers.ps1 @@ -13,4 +13,5 @@ function Install-PortValhallaDrivers { . "$mbDriverPath/IntelWiFi/Install.ps1" $context; . "$mbDriverPath/AMDChipsetX399/Install.ps1" $context; . "$mbDriverPath/IntelBluetooth/Install.ps1" $context; + . "$driverPath/AMDChipsetX399/Install.ps1" $context; } diff --git a/scripts/Windows/Drivers/AMDChipsetX399/Install.ps1 b/scripts/Windows/Drivers/AMDChipsetX399/Install.ps1 new file mode 100644 index 00000000..49620a33 --- /dev/null +++ b/scripts/Windows/Drivers/AMDChipsetX399/Install.ps1 @@ -0,0 +1,5 @@ + +#!/bin/pwsh +param([Context] $context) +. "$PSScriptRoot/../../Scripts/SoftwarePackage.ps1"; +Install-SoftwarePackage $context "https://drivers.amd.com/drivers/amd_chipset_software_5.05.16.529.exe"; diff --git a/scripts/Windows/Scripts/SoftwarePackage.ps1 b/scripts/Windows/Scripts/SoftwarePackage.ps1 new file mode 100644 index 00000000..3dac0bcf --- /dev/null +++ b/scripts/Windows/Scripts/SoftwarePackage.ps1 @@ -0,0 +1,25 @@ +. "$PSScriptRoot/Context.ps1"; + +function Install-SoftwarePackage([Context] $context, [string] $location, [string[]] $argumentList = @("/S"), [switch]$local) { + [string]$filePath = ""; + [string]$tempDir = $null; + + if (-not ($local.IsPresent)) { + $tempDir = $context.GetTempDirectory(); + + $request = [System.Net.WebRequest]::Create($location); + $request.AllowAutoRedirect = $false; + $response = $request.GetResponse(); + $fileName = [System.IO.Path]::GetFileName($response.GetResponseHeader("Location")); + + $filePath = Join-Path $tempDir $fileName; + } else { + $filePath = $location; + } + + Start-Process -Wait -FilePath $filePath -ArgumentList $argumentList; + + if ($tempDir) { + Remove-Item -Recurse $tempDir; + } +}