From 3e63a50f92a0a7e6103d9ef63d8d9593a21debc6 Mon Sep 17 00:00:00 2001 From: Alan Mason <1923621+2Shirt@users.noreply.github.com> Date: Tue, 28 Nov 2017 17:48:52 -0800 Subject: [PATCH] Drivers and Killer Drivers * Add-WindowsDriver section to include extra drivers in WinPE * Added Killer Network Driver to the download list * Bugfix: $Drivers was not set properly --- .bin/Scripts/build_pe.ps1 | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/.bin/Scripts/build_pe.ps1 b/.bin/Scripts/build_pe.ps1 index 7506f9ed..4f5fd432 100644 --- a/.bin/Scripts/build_pe.ps1 +++ b/.bin/Scripts/build_pe.ps1 @@ -158,7 +158,6 @@ if ($MyInvocation.InvocationName -ne ".") { if (Ask-User "Update Tools?") { $DownloadErrors = 0 - $Path = $Temp ## Download Tools ## $ToolSources = @( @@ -176,6 +175,11 @@ if ($MyInvocation.InvocationName -ne ".") { # HWiNFO @("hwinfo64.zip", "http://app.oldfoss.com:81/download/HWiNFO/hw64_560.zip"), @("hwinfo32.zip", "http://app.oldfoss.com:81/download/HWiNFO/hw32_560.zip"), + # Killer Network Drivers + @( + "killerinf.zip", + ("http://www.killernetworking.com"+(FindDynamicUrl "http://www.killernetworking.com/driver-downloads/item/killer-drivers-inf" "Download Killer-Ethernet").replace('&', '&')) + ), # Notepad++ @("npp_amd64.7z", "https://notepad-plus-plus.org/repository/7.x/7.5.2/npp.7.5.2.bin.minimalist.x64.7z"), @("npp_x86.7z", "https://notepad-plus-plus.org/repository/7.x/7.5.2/npp.7.5.2.bin.minimalist.7z"), @@ -299,6 +303,25 @@ if ($MyInvocation.InvocationName -ne ".") { Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red" } + # Killer Network Driver + Write-Host "Extracting: Killer Network Driver" + try { + $ArgumentList = @( + "e", "$Temp\killerinf.zip", "-o$Root\Drivers\amd64\Killer", + "-aoa", "-bso0", "-bse0", "-bsp0", + "Production\Windows10-x64\Eth\*") + Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait + $ArgumentList = @( + "e", "$Temp\killerinf.zip", "-o$Root\Drivers\x86\Killer", + "-aoa", "-bso0", "-bse0", "-bsp0", + "Production\Windows10-x86\Eth\*") + Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait + Remove-Item "$Temp\killerinf*" + } + catch { + Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red" + } + # HWiNFO Write-Host "Extracting: HWiNFO" try { @@ -467,9 +490,9 @@ if ($MyInvocation.InvocationName -ne ".") { ## Build ## foreach ($Arch in @("amd64", "x86")) { - $Drivers = "$Root\Drivers\%arch" + $Drivers = "$Root\Drivers\$Arch" $Mount = "$Root\Mount" - $PEFiles = "$Root\PEFiles\$arch" + $PEFiles = "$Root\PEFiles\$Arch" # Copy WinPE files Write-Host "Copying files..." @@ -490,6 +513,9 @@ if ($MyInvocation.InvocationName -ne ".") { New-Item -Path $Mount -ItemType "directory" -Force | Out-Null Mount-WindowsImage -Path $Mount -ImagePath "$PEFiles\media\sources\boot.wim" -Index 1 | Out-Null + # Add drivers + Add-WindowsDriver -Path $Mount -Driver $Drivers -Recurse | Out-Null + # Add packages Write-Host "Adding packages:" foreach ($Package in $WinPEPackages) {