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 1/2] 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) { From b689c33c962b44c700b8d1a0352d29b2bdaf508c Mon Sep 17 00:00:00 2001 From: Alan Mason <1923621+2Shirt@users.noreply.github.com> Date: Tue, 28 Nov 2017 17:49:24 -0800 Subject: [PATCH 2/2] Bugfix: Updating over current tools is working --- .bin/Scripts/build_pe.ps1 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.bin/Scripts/build_pe.ps1 b/.bin/Scripts/build_pe.ps1 index 4f5fd432..c467aefc 100644 --- a/.bin/Scripts/build_pe.ps1 +++ b/.bin/Scripts/build_pe.ps1 @@ -270,8 +270,8 @@ if ($MyInvocation.InvocationName -ne ".") { Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait Remove-Item "$Root\WK\amd64\ConEmu\ConEmu.exe" Remove-Item "$Root\WK\amd64\ConEmu\ConEmu.map" - Move-Item "$Root\WK\amd64\ConEmu\ConEmu64.exe" "$Root\WK\amd64\ConEmu\ConEmu.exe" - Move-Item "$Root\WK\amd64\ConEmu\ConEmu64.map" "$Root\WK\amd64\ConEmu\ConEmu.map" + Move-Item "$Root\WK\amd64\ConEmu\ConEmu64.exe" "$Root\WK\amd64\ConEmu\ConEmu.exe" -Force + Move-Item "$Root\WK\amd64\ConEmu\ConEmu64.map" "$Root\WK\amd64\ConEmu\ConEmu.map" -Force $ArgumentList = @( "x", "$Temp\ConEmuPack.7z", "-o$Root\WK\x86\ConEmu", "-aoa", "-bso0", "-bse0", "-bsp0") @@ -334,8 +334,8 @@ if ($MyInvocation.InvocationName -ne ".") { "-aoa", "-bso0", "-bse0", "-bsp0", "HWiNFO32.exe") Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait Remove-Item "$Temp\hwinfo*" - Move-Item "$Root\WK\amd64\HWiNFO\HWiNFO64.exe" "$Root\WK\amd64\HWiNFO\HWiNFO.exe" - Move-Item "$Root\WK\x86\HWiNFO\HWiNFO32.exe" "$Root\WK\x86\HWiNFO\HWiNFO.exe" + Move-Item "$Root\WK\amd64\HWiNFO\HWiNFO64.exe" "$Root\WK\amd64\HWiNFO\HWiNFO.exe" -Force + Move-Item "$Root\WK\x86\HWiNFO\HWiNFO32.exe" "$Root\WK\x86\HWiNFO\HWiNFO.exe" -Force } catch { Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red" @@ -353,8 +353,8 @@ if ($MyInvocation.InvocationName -ne ".") { "-aoa", "-bso0", "-bse0", "-bsp0") Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait Remove-Item "$Temp\npp*" - Move-Item "$Root\WK\amd64\NotepadPlusPlus\notepad++.exe" "$Root\WK\amd64\NotepadPlusPlus\notepadplusplus.exe" - Move-Item "$Root\WK\x86\NotepadPlusPlus\notepad++.exe" "$Root\WK\x86\NotepadPlusPlus\notepadplusplus.exe" + Move-Item "$Root\WK\amd64\NotepadPlusPlus\notepad++.exe" "$Root\WK\amd64\NotepadPlusPlus\notepadplusplus.exe" -Force + Move-Item "$Root\WK\x86\NotepadPlusPlus\notepad++.exe" "$Root\WK\x86\NotepadPlusPlus\notepadplusplus.exe" -Force } catch { Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red" @@ -368,7 +368,7 @@ if ($MyInvocation.InvocationName -ne ".") { "-aoa", "-bso0", "-bse0", "-bsp0", "ntpwedit64.exe", "*.txt") Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait - Move-Item "$Root\WK\amd64\NT Password Editor\ntpwedit64.exe" "$Root\WK\amd64\NT Password Editor\ntpwedit.exe" + Move-Item "$Root\WK\amd64\NT Password Editor\ntpwedit64.exe" "$Root\WK\amd64\NT Password Editor\ntpwedit.exe" -Force $ArgumentList = @( "e", "$Temp\ntpwed.zip", ('-o"{0}\WK\x86\NT Password Editor"' -f $Root), "-aoa", "-bso0", "-bse0", "-bsp0", @@ -386,12 +386,16 @@ if ($MyInvocation.InvocationName -ne ".") { $ArgumentList = @( "x", "$Temp\testdisk64.zip", "-o$Root\WK\amd64\TestDisk", "-aoa", "-bso0", "-bse0", "-bsp0") + # Remove destination since Move-Item -Force can't handle this recursive merge + Remove-Item "$Root\WK\amd64\TestDisk" -Recurse -Force Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait Move-Item "$Root\WK\amd64\TestDisk\testdisk-7.1-WIP\*" "$Root\WK\amd64\TestDisk" -Force Remove-Item "$Root\WK\amd64\TestDisk\testdisk-7.1-WIP" -Recurse -Force $ArgumentList = @( "x", "$Temp\testdisk32.zip", "-o$Root\WK\x86\TestDisk", "-aoa", "-bso0", "-bse0", "-bsp0") + # Remove destination since Move-Item -Force can't handle this recursive merge + Remove-Item "$Root\WK\x86\TestDisk" -Recurse -Force Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait Move-Item "$Root\WK\x86\TestDisk\testdisk-7.1-WIP\*" "$Root\WK\x86\TestDisk" -Force Remove-Item "$Root\WK\x86\TestDisk\testdisk-7.1-WIP" -Recurse -Force