nano11 builder script refinement
Signed-off-by: Stefan Knoblich <stkn@bitplumber.de>
This commit is contained in:
@@ -240,7 +240,7 @@ foreach ($package in $packagesToRemove) {
|
|||||||
|
|
||||||
Write-Host "Removing of system apps complete! Now proceeding to removal of system packages..."
|
Write-Host "Removing of system apps complete! Now proceeding to removal of system packages..."
|
||||||
Start-Sleep -Seconds 1
|
Start-Sleep -Seconds 1
|
||||||
Clear-Host
|
#Clear-Host
|
||||||
|
|
||||||
$packagePatterns = @(
|
$packagePatterns = @(
|
||||||
"Microsoft-Windows-InternetExplorer-Optional-Package~",
|
"Microsoft-Windows-InternetExplorer-Optional-Package~",
|
||||||
@@ -306,11 +306,11 @@ Get-ChildItem -Path "$driverRepo" -Directory | ForEach-Object {
|
|||||||
Set-ItemOwnershipAndAccess -Path $driverFolder.FullName -Recurse
|
Set-ItemOwnershipAndAccess -Path $driverFolder.FullName -Recurse
|
||||||
& 'robocopy' "$emptyDirForDrivers" $driverFolder.FullName /MIR /R:0 /W:0 | Out-Null
|
& 'robocopy' "$emptyDirForDrivers" $driverFolder.FullName /MIR /R:0 /W:0 | Out-Null
|
||||||
Remove-Item -Path $driverFolder.FullName -Recurse -Force
|
Remove-Item -Path $driverFolder.FullName -Recurse -Force
|
||||||
break
|
break # Move to the next folder once a match is found
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Remove-Item -Path $emptyDirForDrivers -Recurse -Force
|
Remove-Item -Path "$emptyDirForDrivers" -Recurse -Force
|
||||||
|
|
||||||
$fontsPath = Join-Path -Path "$winDir" -ChildPath "Fonts"
|
$fontsPath = Join-Path -Path "$winDir" -ChildPath "Fonts"
|
||||||
if (Test-Path "$fontsPath") {
|
if (Test-Path "$fontsPath") {
|
||||||
@@ -532,6 +532,7 @@ Write-Host "Bypassing system requirements (on boot image):"
|
|||||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' /v 'BypassSecureBootCheck' /t REG_DWORD /d 1 /f | Out-Null
|
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' /v 'BypassSecureBootCheck' /t REG_DWORD /d 1 /f | Out-Null
|
||||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' /v 'BypassStorageCheck' /t REG_DWORD /d 1 /f | Out-Null
|
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' /v 'BypassStorageCheck' /t REG_DWORD /d 1 /f | Out-Null
|
||||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' /v 'BypassTPMCheck' /t REG_DWORD /d 1 /f | Out-Null
|
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' /v 'BypassTPMCheck' /t REG_DWORD /d 1 /f | Out-Null
|
||||||
|
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\MoSetup' /v 'AllowUpgradesWithUnsupportedTPMOrCPU' /t REG_DWORD /d 1 /f | Out-Null
|
||||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup' /v 'CmdLine' /t REG_SZ /d 'x:\sources\setup.exe' /f | Out-Null
|
& 'reg' 'add' 'HKLM\zSYSTEM\Setup' /v 'CmdLine' /t REG_SZ /d 'x:\sources\setup.exe' /f | Out-Null
|
||||||
reg unload HKLM\zSYSTEM | Out-Null
|
reg unload HKLM\zSYSTEM | Out-Null
|
||||||
|
|
||||||
@@ -542,7 +543,7 @@ Remove-Item -Path $bootWimPath -Force
|
|||||||
& 'dism' /English /Export-Image "/SourceImageFile:$newBootWimPath" /SourceIndex:1 "/DestinationImageFile:$finalBootWimPath" /compress:max
|
& 'dism' /English /Export-Image "/SourceImageFile:$newBootWimPath" /SourceIndex:1 "/DestinationImageFile:$finalBootWimPath" /compress:max
|
||||||
Remove-Item -Path $newBootWimPath -Force
|
Remove-Item -Path $newBootWimPath -Force
|
||||||
Rename-Item -Path $finalBootWimPath -NewName "boot.wim"
|
Rename-Item -Path $finalBootWimPath -NewName "boot.wim"
|
||||||
Clear-Host
|
#Clear-Host
|
||||||
|
|
||||||
Write-Host "Exporting final image to highly compressed ESD format..."
|
Write-Host "Exporting final image to highly compressed ESD format..."
|
||||||
& dism /English /Export-Image /SourceImageFile:"$scratchDrive\nano11\sources\install.wim" /SourceIndex:1 /DestinationImageFile:"$scratchDrive\nano11\sources\install.esd" /Compress:recovery
|
& dism /English /Export-Image /SourceImageFile:"$scratchDrive\nano11\sources\install.wim" /SourceIndex:1 /DestinationImageFile:"$scratchDrive\nano11\sources\install.esd" /Compress:recovery
|
||||||
|
|||||||
Reference in New Issue
Block a user