From 0d69995cdd6cc5bf6a2f8981930a92dfddec3c4c Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 15 Jul 2023 20:22:51 +0200 Subject: [PATCH] Refactor amd driver installation script --- .../Windows/Drivers/AMDChipsetX399/Install.ps1 | 5 +++-- scripts/Windows/Scripts/AmdSoftwarePackage.ps1 | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 scripts/Windows/Scripts/AmdSoftwarePackage.ps1 diff --git a/scripts/Windows/Drivers/AMDChipsetX399/Install.ps1 b/scripts/Windows/Drivers/AMDChipsetX399/Install.ps1 index 49620a33..e4cfadae 100644 --- a/scripts/Windows/Drivers/AMDChipsetX399/Install.ps1 +++ b/scripts/Windows/Drivers/AMDChipsetX399/Install.ps1 @@ -1,5 +1,6 @@ #!/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"; +. "$PSScriptRoot/../../Scripts/AmdSoftwarePackage.ps1"; + +Install-AmdSoftwarePackage "https://www.amd.com/en/support/chipsets/amd-socket-tr4/x399"; diff --git a/scripts/Windows/Scripts/AmdSoftwarePackage.ps1 b/scripts/Windows/Scripts/AmdSoftwarePackage.ps1 new file mode 100644 index 00000000..15e2e431 --- /dev/null +++ b/scripts/Windows/Scripts/AmdSoftwarePackage.ps1 @@ -0,0 +1,15 @@ +#!/bin/pwsh +. "$PSScriptRoot/BrowserAutomation.ps1"; + +function Install-AmdSoftwarePackage() { + param( + [string]$url + ) + + $tempDir = $context.GetTempDirectory(); + $selector = 'summary:first div.driver:first a:contains("Download")'; + $file = Start-AutomatedDownload $context $url $selector $tempDir; + + Start-Process -Wait -FilePath $file -ArgumentList "/S"; + Remove-Item -Recurse $tempDir; +}