From 10a8ca7ab7c31b4056e2b7131ae1773631201941 Mon Sep 17 00:00:00 2001 From: installer Date: Wed, 22 Apr 2026 08:56:57 +0200 Subject: [PATCH] Good unattended --- .gitignore | 3 + .../desktop/11/data/autounattend.pkrtpl.hcl | 910 +++++++++++++----- .../11/data/autounattend.pkrtpl.hcl.old | 220 +++++ builds/windows/desktop/11/variables.pkr.hcl | 2 +- builds/windows/desktop/11/windows.pkr.hcl | 4 +- 5 files changed, 916 insertions(+), 223 deletions(-) create mode 100644 builds/windows/desktop/11/data/autounattend.pkrtpl.hcl.old diff --git a/.gitignore b/.gitignore index 89e143f..f82dfd0 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ manifests/*.json plugin.hwm plugin.pwd plugin.pwi + +crash.log +tmp/ diff --git a/builds/windows/desktop/11/data/autounattend.pkrtpl.hcl b/builds/windows/desktop/11/data/autounattend.pkrtpl.hcl index 26a5260..7f699f9 100644 --- a/builds/windows/desktop/11/data/autounattend.pkrtpl.hcl +++ b/builds/windows/desktop/11/data/autounattend.pkrtpl.hcl @@ -1,220 +1,690 @@ - - - - - - ${vm_inst_os_language} - - ${vm_inst_os_keyboard} - ${vm_inst_os_language} - ${vm_inst_os_language} - ${vm_inst_os_language} - ${vm_inst_os_language} - - - - - F:\viostor\w11\amd64\ - - - F:\NetKVM\w11\amd64\ - - - - - - - 0 - true - - - - 1 - Primary - 550 - - - - 2 - EFI - 100 - - - - 3 - MSR - 128 - - - - 4 - Primary - true - - - - - - 1 - 1 - - NTFS - DE94BBA4-06D1-4D40-A16A-BFD50179D6AC - - - - 2 - 2 - - FAT32 - - - - 3 - 3 - - - - 4 - 4 - - C - NTFS - - - - - - - - - /IMAGE/NAME - ${vm_inst_os_image} - - - - 0 - 4 - - - - - - 1 - - cmd /c powercfg.exe /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c - - - - true - ${build_username} - ${build_username} - %{if vm_inst_os_eval != true ~} - - ${vm_inst_os_key} - OnError - - %{ endif ~} - - false - - - - - false - - - - - 1 - - - - - - false - - ${vm_guest_os_timezone} - - - - true - - - true - - - true - - - - - ${vm_guest_os_keyboard} - ${vm_guest_os_language} - ${vm_guest_os_language} - ${vm_guest_os_language} - ${vm_guest_os_language} - - - - - ${build_password} - true</PlainText> - </Password> - <Enabled>true</Enabled> - <Username>${build_username}</Username> - </AutoLogon> - <OOBE> - <HideEULAPage>true</HideEULAPage> - <HideLocalAccountScreen>true</HideLocalAccountScreen> - <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> - <HideOnlineAccountScreens>true</HideOnlineAccountScreens> - <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> - <NetworkLocation>Work</NetworkLocation> - <ProtectYourPC>2</ProtectYourPC> - </OOBE> - <UserAccounts> - <AdministratorPassword> - <Value>${build_password}</Value> - <PlainText>true</PlainText> - </AdministratorPassword> - <LocalAccounts> - <LocalAccount wcm:action="add"> - <Password> - <Value>${build_password}</Value> - <PlainText>true</PlainText> - </Password> - <Group>administrators</Group> - <DisplayName>${build_username}</DisplayName> - <Name>${build_username}</Name> - <Description>Build Account</Description> - </LocalAccount> - </LocalAccounts> - </UserAccounts> - <FirstLogonCommands> - <SynchronousCommand wcm:action="add"> - <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> - <Description>Set Execution Policy 64-Bit</Description> - <Order>1</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> - <Description>Set Execution Policy 32-Bit</Description> - <Order>2</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -File E:\windows-virtio.ps1</CommandLine> - <Order>3</Order> - <Description>Install VMware Tools</Description> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -File E:\windows-init.ps1</CommandLine> - <Order>4</Order> - <Description>Initial Configuration</Description> - </SynchronousCommand> - </FirstLogonCommands> - </component> - </settings> -</unattend> +<?xml version="1.0" encoding="utf-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> + <!--https://schneegans.de/windows/unattend-generator/?LanguageMode=Unattended&UILanguage=fr-FR&Locale=fr-FR&Keyboard=0000040c&UseKeyboard2=true&Locale2=en-US&Keyboard2=00000409&GeoLocation=84&ProcessorArchitecture=amd64&BypassRequirementsCheck=true&ComputerNameMode=Random&CompactOsMode=Default&TimeZoneMode=Explicit&TimeZone=Romance+Standard+Time&PartitionMode=Unattended&PartitionLayout=GPT&EspSize=300&RecoveryMode=None&DiskAssertionMode=Skip&WindowsEditionMode=Generic&WindowsEdition=pro&InstallFromMode=Automatic&PEMode=Default&UserAccountMode=Unattended&AccountName0=Admin&AccountDisplayName0=&AccountPassword0=&AccountGroup0=Administrators&AccountName1=Installer&AccountDisplayName1=Installer&AccountPassword1=Stid_2026-03&AccountGroup1=Users&AutoLogonMode=Own&PasswordExpirationMode=Unlimited&LockoutMode=Default&HideFiles=Hidden&ShowFileExtensions=true&ClassicContextMenu=true&TaskbarSearch=Box&TaskbarIconsMode=Default&DisableWidgets=true&StartTilesMode=Default&StartPinsMode=Empty&DisableDefender=true&DisableUac=true&DisableSystemRestore=true&EnableRemoteDesktop=true&AllowPowerShellScripts=true&TurnOffSystemSounds=true&DisableAppSuggestions=true&PreventDeviceEncryption=true&HideEdgeFre=true&DisableEdgeStartupBoost=true&EffectsMode=Performance&DesktopIconsMode=Default&StartFoldersMode=Default&VirtIoGuestTools=true&WifiMode=Skip&ExpressSettings=DisableAll&LockKeysMode=Skip&StickyKeysMode=Default&ColorMode=Default&WallpaperMode=Default&LockScreenMode=Default&Remove3DViewer=true&RemoveBingSearch=true&RemoveCalculator=true&RemoveCamera=true&RemoveClipchamp=true&RemoveCopilot=true&RemoveCortana=true&RemoveDevHome=true&RemoveWindowsHello=true&RemoveFamily=true&RemoveFeedbackHub=true&RemoveGameAssist=true&RemoveGetHelp=true&RemoveHandwriting=true&RemoveInternetExplorer=true&RemoveMailCalendar=true&RemoveMaps=true&RemoveMathInputPanel=true&RemoveMediaFeatures=true&RemoveStore=true&RemoveMixedReality=true&RemoveZuneVideo=true&RemoveNews=true&RemoveOffice365=true&RemoveOneDrive=true&RemoveOneNote=true&RemoveOneSync=true&RemoveOpenSSHClient=true&RemoveOutlook=true&RemovePaint=true&RemovePaint3D=true&RemovePeople=true&RemovePhotos=true&RemovePowerAutomate=true&RemoveQuickAssist=true&RemoveRecall=true&RemoveRdpClient=true&RemoveSkype=true&RemoveSnippingTool=true&RemoveSolitaire=true&RemoveSpeech=true&RemoveStepsRecorder=true&RemoveStickyNotes=true&RemoveTeams=true&RemoveGetStarted=true&RemoveToDo=true&RemoveVoiceRecorder=true&RemoveWallet=true&RemoveWeather=true&RemoveFaxAndScan=true&RemoveWindowsMediaPlayer=true&RemoveZuneMusic=true&RemoveWordPad=true&RemoveXboxApps=true&RemoveYourPhone=true&WdacMode=Skip&AppLockerMode=Skip--> + <settings pass="offlineServicing"></settings> + <settings pass="windowsPE"> + <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <UILanguage>fr-FR</UILanguage> + </component> + <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <ImageInstall> + <OSImage> + <InstallTo> + <DiskID>0</DiskID> + <PartitionID>3</PartitionID> + </InstallTo> + </OSImage> + </ImageInstall> + <UserData> + <ProductKey> + <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key> + <WillShowUI>OnError</WillShowUI> + </ProductKey> + <AcceptEula>true</AcceptEula> + </UserData> + <UseConfigurationSet>false</UseConfigurationSet> + <RunSynchronous> + <RunSynchronousCommand wcm:action="add"> + <Order>1</Order> + <Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>2</Order> + <Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>3</Order> + <Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>4</Order> + <Path>cmd.exe /c &gt;&gt;X:\diskpart.txt (echo:SELECT DISK=0&amp;echo:CLEAN&amp;echo:CONVERT GPT&amp;echo:CREATE PARTITION EFI SIZE=300&amp;echo:FORMAT QUICK FS=FAT32 LABEL=^"System^"&amp;echo:ASSIGN LETTER=S&amp;echo:CREATE PARTITION MSR SIZE=16&amp;echo:CREATE PARTITION PRIMARY)</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>5</Order> + <Path>cmd.exe /c &gt;&gt;X:\diskpart.txt (echo:FORMAT QUICK FS=NTFS LABEL=^"Windows^"&amp;echo:ASSIGN LETTER=W)</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>6</Order> + <Path>cmd.exe /c "diskpart.exe /s "X:\diskpart.txt" &gt;&gt;"X:\diskpart.log" || ( type "X:\diskpart.log" &amp; echo diskpart encountered an error. &amp; pause &amp; exit /b 1 )"</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>7</Order> + <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:WScript.Echo ^"Scanning for newly created SYSTEM registry hive file to disable Windows Defender services...^"&amp;echo:Set fso = CreateObject(^"Scripting.FileSystemObject^"^))</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>8</Order> + <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set existing = CreateObject(^"Scripting.Dictionary^"^)&amp;echo:Function Execute(command^)&amp;echo:WScript.Echo ^"Running command '^" + command + ^"'^"&amp;echo:Set shell = CreateObject(^"WScript.Shell^"^))</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>9</Order> + <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set exec = shell.Exec(command^)&amp;echo:Do While exec.Status = 0&amp;echo:WScript.Sleep 100&amp;echo:Loop&amp;echo:WScript.Echo exec.StdOut.ReadAll&amp;echo:WScript.Echo exec.StdErr.ReadAll&amp;echo:Execute = exec.ExitCode&amp;echo:End Function)</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>10</Order> + <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Function FindHiveFiles&amp;echo:Set FindHiveFiles = CreateObject(^"Scripting.Dictionary^"^)&amp;echo:For Each drive In fso.Drives&amp;echo:If drive.IsReady And drive.DriveLetter ^&lt;^&gt; ^"X^" Then)</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>11</Order> + <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each folder In Array(^"$Windows.~BT\NewOS\Windows^", ^"Windows^"^)&amp;echo:file = fso.BuildPath(fso.BuildPath(drive.RootFolder, folder^), ^"System32\config\SYSTEM^"^))</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>12</Order> + <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:If fso.FileExists(file^) And fso.FileExists(file + ^".LOG1^"^) And fso.FileExists(file + ^".LOG2^"^) Then&amp;echo:FindHiveFiles.Add file, Nothing&amp;echo:End If&amp;echo:Next&amp;echo:End If&amp;echo:Next&amp;echo:End Function)</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>13</Order> + <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each file In FindHiveFiles&amp;echo:WScript.Echo ^"Will ignore file at '^" + file + ^"' because it was already present when Windows Setup started.^"&amp;echo:existing.Add file, Nothing&amp;echo:Next&amp;echo:Do)</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>14</Order> + <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each file In FindHiveFiles&amp;echo:If Not existing.Exists(file^) Then&amp;echo:ret = 1&amp;echo:While ret ^&gt; 0&amp;echo:WScript.Sleep 500&amp;echo:ret = Execute(^"reg.exe LOAD HKLM\mount ^" + file^)&amp;echo:Wend)</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>15</Order> + <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each service In Array(^"Sense^", ^"WdBoot^", ^"WdFilter^", ^"WdNisDrv^", ^"WdNisSvc^", ^"WinDefend^"^))</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>16</Order> + <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:ret = Execute(^"reg.exe ADD HKLM\mount\ControlSet001\Services\^" + service + ^" /v Start /t REG_DWORD /d 4 /f^"^)&amp;echo:Next&amp;echo:ret = Execute(^"reg.exe UNLOAD HKLM\mount^"^))</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>17</Order> + <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:WScript.Echo ^"Found and successfully modified SYSTEM registry hive file at '^" + file + ^"'. This window will now close.^"&amp;echo:WScript.Sleep 5000&amp;echo:Exit Do&amp;echo:End If&amp;echo:WScript.Sleep 1000&amp;echo:Next&amp;echo:Loop)</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>18</Order> + <Path>cmd.exe /c "start /MIN cscript.exe //E:vbscript X:\defender.vbs"</Path> + </RunSynchronousCommand> + </RunSynchronous> + </component> + </settings> + <settings pass="generalize"></settings> + <settings pass="specialize"> + <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <RunSynchronous> + <RunSynchronousCommand wcm:action="add"> + <Order>1</Order> + <Path>powershell.exe -WindowStyle "Normal" -NoProfile -Command "$xml = [xml]::new(); $xml.Load('C:\Windows\Panther\unattend.xml'); $sb = [scriptblock]::Create( $xml.unattend.Extensions.ExtractScript ); Invoke-Command -ScriptBlock $sb -ArgumentList $xml;"</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>2</Order> + <Path>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\Specialize.ps1"</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>3</Order> + <Path>reg.exe load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT"</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>4</Order> + <Path>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\DefaultUser.ps1"</Path> + </RunSynchronousCommand> + <RunSynchronousCommand wcm:action="add"> + <Order>5</Order> + <Path>reg.exe unload "HKU\DefaultUser"</Path> + </RunSynchronousCommand> + </RunSynchronous> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <TimeZone>Romance Standard Time</TimeZone> + </component> + </settings> + <settings pass="auditSystem"></settings> + <settings pass="auditUser"></settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <InputLocale>040c:0000040c;0409:00000409</InputLocale> + <SystemLocale>fr-FR</SystemLocale> + <UILanguage>fr-FR</UILanguage> + <UserLocale>fr-FR</UserLocale> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <UserAccounts> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Name>Admin</Name> + <DisplayName></DisplayName> + <Group>Administrators</Group> + <Password> + <Value></Value> + <PlainText>true</PlainText> + </Password> + </LocalAccount> + <LocalAccount wcm:action="add"> + <Name>Installer</Name> + <DisplayName>Installer</DisplayName> + <Group>Users</Group> + <Password> + <Value>Stid_2026-03</Value> + <PlainText>true</PlainText> + </Password> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <AutoLogon> + <Username>Admin</Username> + <Enabled>true</Enabled> + <LogonCount>1</LogonCount> + <Password> + <Value></Value> + <PlainText>true</PlainText> + </Password> + </AutoLogon> + <OOBE> + <ProtectYourPC>3</ProtectYourPC> + <HideEULAPage>true</HideEULAPage> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <HideOnlineAccountScreens>false</HideOnlineAccountScreens> + </OOBE> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <Order>1</Order> + <CommandLine>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\FirstLogon.ps1"</CommandLine> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> + <Extensions xmlns="https://schneegans.de/windows/unattend-generator/"> + <Build> + <Commit> + <Hash>b5944ad0b8d26588e78d963562e0f80ee2e33aeb</Hash> + <GitHubUrl>https://github.com/cschneegans/unattend-generator/commit/b5944ad0b8d26588e78d963562e0f80ee2e33aeb</GitHubUrl> + </Commit> + </Build> + <ExtractScript> +param( + [xml] $Document +); + +foreach( $file in $Document.unattend.Extensions.File ) { + $path = [System.Environment]::ExpandEnvironmentVariables( $file.GetAttribute( 'path' ) ); + mkdir -Path( $path | Split-Path -Parent ) -ErrorAction 'SilentlyContinue'; + $encoding = switch( [System.IO.Path]::GetExtension( $path ) ) { + { $_ -in '.ps1', '.xml' } { [System.Text.Encoding]::UTF8; } + { $_ -in '.reg', '.vbs', '.js' } { [System.Text.UnicodeEncoding]::new( $false, $true ); } + default { [System.Text.Encoding]::Default; } + }; + $bytes = $encoding.GetPreamble() + $encoding.GetBytes( $file.InnerText.Trim() ); + [System.IO.File]::WriteAllBytes( $path, $bytes ); +} + </ExtractScript> + <File path="C:\Windows\Setup\Scripts\RemovePackages.ps1"> +$selectors = @( + 'Microsoft.Microsoft3DViewer'; + 'Microsoft.BingSearch'; + 'Microsoft.WindowsCalculator'; + 'Microsoft.WindowsCamera'; + 'Clipchamp.Clipchamp'; + 'Microsoft.Copilot'; + 'Microsoft.549981C3F5F10'; + 'Microsoft.Windows.DevHome'; + 'MicrosoftCorporationII.MicrosoftFamily'; + 'Microsoft.WindowsFeedbackHub'; + 'Microsoft.Edge.GameAssist'; + 'Microsoft.GetHelp'; + 'Microsoft.Getstarted'; + 'microsoft.windowscommunicationsapps'; + 'Microsoft.WindowsMaps'; + 'Microsoft.MixedReality.Portal'; + 'Microsoft.BingNews'; + 'Microsoft.MicrosoftOfficeHub'; + 'Microsoft.Office.OneNote'; + 'Microsoft.OutlookForWindows'; + 'Microsoft.Paint'; + 'Microsoft.MSPaint'; + 'Microsoft.People'; + 'Microsoft.Windows.Photos'; + 'Microsoft.PowerAutomateDesktop'; + 'MicrosoftCorporationII.QuickAssist'; + 'Microsoft.SkypeApp'; + 'Microsoft.ScreenSketch'; + 'Microsoft.MicrosoftSolitaireCollection'; + 'Microsoft.MicrosoftStickyNotes'; + 'Microsoft.WindowsStore'; + 'Microsoft.StorePurchaseApp'; + 'MicrosoftTeams'; + 'MSTeams'; + 'Microsoft.Todos'; + 'Microsoft.WindowsSoundRecorder'; + 'Microsoft.Wallet'; + 'Microsoft.BingWeather'; + 'Microsoft.Xbox.TCUI'; + 'Microsoft.XboxApp'; + 'Microsoft.XboxGameOverlay'; + 'Microsoft.XboxGamingOverlay'; + 'Microsoft.XboxIdentityProvider'; + 'Microsoft.XboxSpeechToTextOverlay'; + 'Microsoft.GamingApp'; + 'Microsoft.YourPhone'; + 'Microsoft.ZuneMusic'; + 'Microsoft.ZuneVideo'; +); +$getCommand = { + Get-AppxProvisionedPackage -Online; +}; +$filterCommand = { + $_.DisplayName -eq $selector; +}; +$removeCommand = { + [CmdletBinding()] + param( + [Parameter( Mandatory, ValueFromPipeline )] + $InputObject + ); + process { + $InputObject | Remove-AppxProvisionedPackage -AllUsers -Online -ErrorAction 'Continue'; + } +}; +$type = 'Package'; +$logfile = 'C:\Windows\Setup\Scripts\RemovePackages.log'; +&amp; { + $installed = &amp; $getCommand; + foreach( $selector in $selectors ) { + $result = [ordered] @{ + Selector = $selector; + }; + $found = $installed | Where-Object -FilterScript $filterCommand; + if( $found ) { + $result.Output = $found | &amp; $removeCommand; + if( $? ) { + $result.Message = "$type removed."; + } else { + $result.Message = "$type not removed."; + $result.Error = $Error[0]; + } + } else { + $result.Message = "$type not installed."; + } + $result | ConvertTo-Json -Depth 3 -Compress; + } +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; $logfile; + </File> + <File path="C:\Windows\Setup\Scripts\RemoveCapabilities.ps1"> +$selectors = @( + 'Print.Fax.Scan'; + 'Language.Handwriting'; + 'Browser.InternetExplorer'; + 'MathRecognizer'; + 'OneCoreUAP.OneSync'; + 'OpenSSH.Client'; + 'Microsoft.Windows.MSPaint'; + 'App.Support.QuickAssist'; + 'Microsoft.Windows.SnippingTool'; + 'Language.Speech'; + 'Language.TextToSpeech'; + 'App.StepsRecorder'; + 'Hello.Face.18967'; + 'Hello.Face.Migration.18967'; + 'Hello.Face.20134'; + 'Media.WindowsMediaPlayer'; + 'Microsoft.Windows.WordPad'; +); +$getCommand = { + Get-WindowsCapability -Online | Where-Object -Property 'State' -NotIn -Value @( + 'NotPresent'; + 'Removed'; + ); +}; +$filterCommand = { + ($_.Name -split '~')[0] -eq $selector; +}; +$removeCommand = { + [CmdletBinding()] + param( + [Parameter( Mandatory, ValueFromPipeline )] + $InputObject + ); + process { + $InputObject | Remove-WindowsCapability -Online -ErrorAction 'Continue'; + } +}; +$type = 'Capability'; +$logfile = 'C:\Windows\Setup\Scripts\RemoveCapabilities.log'; +&amp; { + $installed = &amp; $getCommand; + foreach( $selector in $selectors ) { + $result = [ordered] @{ + Selector = $selector; + }; + $found = $installed | Where-Object -FilterScript $filterCommand; + if( $found ) { + $result.Output = $found | &amp; $removeCommand; + if( $? ) { + $result.Message = "$type removed."; + } else { + $result.Message = "$type not removed."; + $result.Error = $Error[0]; + } + } else { + $result.Message = "$type not installed."; + } + $result | ConvertTo-Json -Depth 3 -Compress; + } +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; $logfile; + </File> + <File path="C:\Windows\Setup\Scripts\RemoveFeatures.ps1"> +$selectors = @( + 'MediaPlayback'; + 'Microsoft-RemoteDesktopConnection'; + 'Recall'; + 'Microsoft-SnippingTool'; +); +$getCommand = { + Get-WindowsOptionalFeature -Online | Where-Object -Property 'State' -NotIn -Value @( + 'Disabled'; + 'DisabledWithPayloadRemoved'; + ); +}; +$filterCommand = { + $_.FeatureName -eq $selector; +}; +$removeCommand = { + [CmdletBinding()] + param( + [Parameter( Mandatory, ValueFromPipeline )] + $InputObject + ); + process { + $InputObject | Disable-WindowsOptionalFeature -Online -Remove -NoRestart -ErrorAction 'Continue'; + } +}; +$type = 'Feature'; +$logfile = 'C:\Windows\Setup\Scripts\RemoveFeatures.log'; +&amp; { + $installed = &amp; $getCommand; + foreach( $selector in $selectors ) { + $result = [ordered] @{ + Selector = $selector; + }; + $found = $installed | Where-Object -FilterScript $filterCommand; + if( $found ) { + $result.Output = $found | &amp; $removeCommand; + if( $? ) { + $result.Message = "$type removed."; + } else { + $result.Message = "$type not removed."; + $result.Error = $Error[0]; + } + } else { + $result.Message = "$type not installed."; + } + $result | ConvertTo-Json -Depth 3 -Compress; + } +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; $logfile; + </File> + <File path="C:\Windows\Setup\Scripts\TurnOffSystemSounds.ps1"> +$excludes = Get-ChildItem -LiteralPath 'Registry::HKU\DefaultUser\AppEvents\EventLabels' | + Where-Object -FilterScript { ($_ | Get-ItemProperty).ExcludeFromCPL -eq 1; } | + Select-Object -ExpandProperty 'PSChildName'; +Get-ChildItem -Path 'Registry::HKU\DefaultUser\AppEvents\Schemes\Apps\*\*' | + Where-Object -Property 'PSChildName' -NotIn $excludes | + Get-ChildItem -Include '.Current' | Set-ItemProperty -Name '(Default)' -Value ''; + </File> + <File path="C:\Windows\Setup\Scripts\VirtIoGuestTools.ps1"> +&amp; { + foreach( $letter in 'DEFGHIJKLMNOPQRSTUVWXYZ'.ToCharArray() ) { + $exe = "${letter}:\virtio-win-guest-tools.exe"; + if( Test-Path -LiteralPath $exe ) { + Start-Process -FilePath $exe -ArgumentList '/passive', '/norestart' -Wait; + return; + } + } + 'VirtIO Guest Tools image (virtio-win-*.iso) is not attached to this VM.'; +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; 'C:\Windows\Setup\Scripts\VirtIoGuestTools.log'; + </File> + <File path="C:\Windows\Setup\Scripts\SetStartPins.ps1"> +$json = '{"pinnedList":[]}'; +if( [System.Environment]::OSVersion.Version.Build -lt 20000 ) { + return; +} +$key = 'Registry::HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start'; +New-Item -Path $key -ItemType 'Directory' -ErrorAction 'SilentlyContinue'; +Set-ItemProperty -LiteralPath $key -Name 'ConfigureStartPins' -Value $json -Type 'String'; + </File> + <File path="C:\Windows\Setup\Scripts\Specialize.ps1"> +$scripts = @( + { + reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f; + }; + { + ReAgentc.exe /disable; + Remove-Item -LiteralPath 'C:\Windows\System32\Recovery\Winre.wim' -Force -ErrorAction 'SilentlyContinue'; + }; + { + Remove-Item -LiteralPath 'Registry::HKLM\Software\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate' -Force -ErrorAction 'SilentlyContinue'; + }; + { + Remove-Item -LiteralPath 'C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk', 'C:\Windows\System32\OneDriveSetup.exe', 'C:\Windows\SysWOW64\OneDriveSetup.exe' -ErrorAction 'Continue'; + }; + { + Remove-Item -LiteralPath 'Registry::HKLM\Software\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate' -Force -ErrorAction 'SilentlyContinue'; + }; + { + reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v ConfigureChatAutoInstall /t REG_DWORD /d 0 /f; + }; + { + &amp; 'C:\Windows\Setup\Scripts\RemovePackages.ps1'; + }; + { + &amp; 'C:\Windows\Setup\Scripts\RemoveCapabilities.ps1'; + }; + { + &amp; 'C:\Windows\Setup\Scripts\RemoveFeatures.ps1'; + }; + { + net.exe accounts /maxpwage:UNLIMITED; + }; + { + reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Notifications" /v DisableNotifications /t REG_DWORD /d 1 /f; + }; + { + reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f + }; + { + netsh.exe advfirewall firewall set rule group="@FirewallAPI.dll,-28752" new enable=Yes; + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f; + }; + { + Set-ExecutionPolicy -Scope 'LocalMachine' -ExecutionPolicy 'RemoteSigned' -Force; + }; + { + reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Dsh" /v AllowNewsAndInterests /t REG_DWORD /d 0 /f; + }; + { + reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation" /v DisableStartupSound /t REG_DWORD /d 1 /f; + reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EditionOverrides" /v UserSetting_DisableStartupSound /t REG_DWORD /d 1 /f; + }; + { + reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d 1 /f; + }; + { + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\BitLocker" /v "PreventDeviceEncryption" /t REG_DWORD /d 1 /f; + }; + { + reg.exe add "HKLM\Software\Policies\Microsoft\Edge" /v HideFirstRunExperience /t REG_DWORD /d 1 /f; + }; + { + reg.exe add "HKLM\Software\Policies\Microsoft\Edge\Recommended" /v BackgroundModeEnabled /t REG_DWORD /d 0 /f; + reg.exe add "HKLM\Software\Policies\Microsoft\Edge\Recommended" /v StartupBoostEnabled /t REG_DWORD /d 0 /f; + }; + { + &amp; 'C:\Windows\Setup\Scripts\SetStartPins.ps1'; + }; + { + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ControlAnimations" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\AnimateMinMax" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TaskbarAnimations" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMAeroPeekEnabled" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\MenuAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TooltipAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\SelectionFade" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMSaveThumbnailEnabled" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\CursorShadow" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ThumbnailsOrIcon" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewAlphaSelect" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ComboBoxAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListBoxSmoothScrolling" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DropShadow" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force; + }; +); + +&amp; { + [float] $complete = 0; + [float] $increment = 100 / $scripts.Count; + foreach( $script in $scripts ) { + Write-Progress -Id 0 -Activity 'Running scripts to customize your Windows installation. Do not close this window.' -PercentComplete $complete; + '*** Will now execute command &#xAB;{0}&#xBB;.' -f $( + $script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;'; + ); + $start = [datetime]::Now; + &amp; $script; + '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds; + "`r`n" * 3; + $complete += $increment; + } +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "C:\Windows\Setup\Scripts\Specialize.log"; + </File> + <File path="C:\Windows\Setup\Scripts\UserOnce.ps1"> +$scripts = @( + { + Get-AppxPackage -Name 'Microsoft.Windows.Ai.Copilot.Provider' | Remove-AppxPackage; + }; + { + Set-ItemProperty -LiteralPath 'Registry::HKCU\AppEvents\Schemes' -Name '(Default)' -Type 'String' -Value '.None'; + }; + { + reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /ve /f; + }; + { + Set-ItemProperty -LiteralPath 'Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects' -Name 'VisualFXSetting' -Type 'DWord' -Value 2 -Force; + }; + { + Get-Process -Name 'explorer' -ErrorAction 'SilentlyContinue' | Where-Object -FilterScript { + $_.SessionId -eq ( Get-Process -Id $PID ).SessionId; + } | Stop-Process -Force; + }; +); + +&amp; { + [float] $complete = 0; + [float] $increment = 100 / $scripts.Count; + foreach( $script in $scripts ) { + Write-Progress -Id 0 -Activity 'Running scripts to configure this user account. Do not close this window.' -PercentComplete $complete; + '*** Will now execute command &#xAB;{0}&#xBB;.' -f $( + $script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;'; + ); + $start = [datetime]::Now; + &amp; $script; + '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds; + "`r`n" * 3; + $complete += $increment; + } +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "$env:TEMP\UserOnce.log"; + </File> + <File path="C:\Windows\Setup\Scripts\DefaultUser.ps1"> +$scripts = @( + { + reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\WindowsCopilot" /v TurnOffWindowsCopilot /t REG_DWORD /d 1 /f; + }; + { + reg.exe add "HKU\DefaultUser\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore" /f; + }; + { + Remove-ItemProperty -LiteralPath 'Registry::HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Run' -Name 'OneDriveSetup' -Force -ErrorAction 'Continue'; + }; + { + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\GameDVR" /v AppCaptureEnabled /t REG_DWORD /d 0 /f; + }; + { + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f; + }; + { + &amp; 'C:\Windows\Setup\Scripts\TurnOffSystemSounds.ps1'; + }; + { + $names = @( + 'ContentDeliveryAllowed'; + 'FeatureManagementEnabled'; + 'OEMPreInstalledAppsEnabled'; + 'PreInstalledAppsEnabled'; + 'PreInstalledAppsEverEnabled'; + 'SilentInstalledAppsEnabled'; + 'SoftLandingEnabled'; + 'SubscribedContentEnabled'; + 'SubscribedContent-310093Enabled'; + 'SubscribedContent-338387Enabled'; + 'SubscribedContent-338388Enabled'; + 'SubscribedContent-338389Enabled'; + 'SubscribedContent-338393Enabled'; + 'SubscribedContent-353694Enabled'; + 'SubscribedContent-353696Enabled'; + 'SubscribedContent-353698Enabled'; + 'SystemPaneSuggestionsEnabled'; + ); + + foreach( $name in $names ) { + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v $name /t REG_DWORD /d 0 /f; + } + }; + { + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "UnattendedSetup" /t REG_SZ /d "powershell.exe -WindowStyle \""Normal\"" -ExecutionPolicy \""Unrestricted\"" -NoProfile -File \""C:\Windows\Setup\Scripts\UserOnce.ps1\""" /f; + }; +); + +&amp; { + [float] $complete = 0; + [float] $increment = 100 / $scripts.Count; + foreach( $script in $scripts ) { + Write-Progress -Id 0 -Activity 'Running scripts to modify the default user&#x2019;&#x2019;s registry hive. Do not close this window.' -PercentComplete $complete; + '*** Will now execute command &#xAB;{0}&#xBB;.' -f $( + $script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;'; + ); + $start = [datetime]::Now; + &amp; $script; + '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds; + "`r`n" * 3; + $complete += $increment; + } +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "C:\Windows\Setup\Scripts\DefaultUser.log"; + </File> + <File path="C:\Windows\Setup\Scripts\FirstLogon.ps1"> +$scripts = @( + { + Set-ItemProperty -LiteralPath 'Registry::HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'AutoLogonCount' -Type 'DWord' -Force -Value 0; + }; + { + Disable-ComputerRestore -Drive 'C:\'; + }; + { + &amp; 'C:\Windows\Setup\Scripts\VirtIoGuestTools.ps1'; + }; + { + Remove-Item -LiteralPath @( + 'C:\Windows\Panther\unattend.xml'; + 'C:\Windows\Panther\unattend-original.xml'; + 'C:\Windows\Setup\Scripts\Wifi.xml'; + ) -Force -ErrorAction 'SilentlyContinue' -Verbose; + }; +); + +&amp; { + [float] $complete = 0; + [float] $increment = 100 / $scripts.Count; + foreach( $script in $scripts ) { + Write-Progress -Id 0 -Activity 'Running scripts to finalize your Windows installation. Do not close this window.' -PercentComplete $complete; + '*** Will now execute command &#xAB;{0}&#xBB;.' -f $( + $script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;'; + ); + $start = [datetime]::Now; + &amp; $script; + '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds; + "`r`n" * 3; + $complete += $increment; + } +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "C:\Windows\Setup\Scripts\FirstLogon.log"; + </File> + </Extensions> +</unattend> diff --git a/builds/windows/desktop/11/data/autounattend.pkrtpl.hcl.old b/builds/windows/desktop/11/data/autounattend.pkrtpl.hcl.old new file mode 100644 index 0000000..26a5260 --- /dev/null +++ b/builds/windows/desktop/11/data/autounattend.pkrtpl.hcl.old @@ -0,0 +1,220 @@ +<?xml version="1.0" encoding="UTF-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend"> + <settings pass="windowsPE"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <SetupUILanguage> + <UILanguage>${vm_inst_os_language}</UILanguage> + </SetupUILanguage> + <InputLocale>${vm_inst_os_keyboard}</InputLocale> + <SystemLocale>${vm_inst_os_language}</SystemLocale> + <UILanguage>${vm_inst_os_language}</UILanguage> + <UILanguageFallback>${vm_inst_os_language}</UILanguageFallback> + <UserLocale>${vm_inst_os_language}</UserLocale> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DriverPaths> + <PathAndCredentials wcm:action="add" wcm:keyValue="3"> + <Path>F:\viostor\w11\amd64\</Path> + </PathAndCredentials> + <PathAndCredentials wcm:action="add" wcm:keyValue="4"> + <Path>F:\NetKVM\w11\amd64\</Path> + </PathAndCredentials> + </DriverPaths> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DiskConfiguration> + <Disk wcm:action="add"> + <DiskID>0</DiskID> + <WillWipeDisk>true</WillWipeDisk> + <CreatePartitions> + <!-- Windows RE Tools partition --> + <CreatePartition wcm:action="add"> + <Order>1</Order> + <Type>Primary</Type> + <Size>550</Size> + </CreatePartition> + <!-- System partition (ESP) --> + <CreatePartition wcm:action="add"> + <Order>2</Order> + <Type>EFI</Type> + <Size>100</Size> + </CreatePartition> + <!-- Microsoft reserved partition (MSR) --> + <CreatePartition wcm:action="add"> + <Order>3</Order> + <Type>MSR</Type> + <Size>128</Size> + </CreatePartition> + <!-- Windows partition --> + <CreatePartition wcm:action="add"> + <Order>4</Order> + <Type>Primary</Type> + <Extend>true</Extend> + </CreatePartition> + </CreatePartitions> + <ModifyPartitions> + <!-- Windows RE Tools partition --> + <ModifyPartition wcm:action="add"> + <Order>1</Order> + <PartitionID>1</PartitionID> + <Label>WINRE</Label> + <Format>NTFS</Format> + <TypeID>DE94BBA4-06D1-4D40-A16A-BFD50179D6AC</TypeID> + </ModifyPartition> + <!-- System partition (ESP) --> + <ModifyPartition wcm:action="add"> + <Order>2</Order> + <PartitionID>2</PartitionID> + <Label>System</Label> + <Format>FAT32</Format> + </ModifyPartition> + <!-- MSR partition does not need to be modified --> + <ModifyPartition wcm:action="add"> + <Order>3</Order> + <PartitionID>3</PartitionID> + </ModifyPartition> + <!-- Windows partition --> + <ModifyPartition wcm:action="add"> + <Order>4</Order> + <PartitionID>4</PartitionID> + <Label>OS</Label> + <Letter>C</Letter> + <Format>NTFS</Format> + </ModifyPartition> + </ModifyPartitions> + </Disk> + </DiskConfiguration> + <ImageInstall> + <OSImage> + <InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>${vm_inst_os_image}</Value> + </MetaData> + </InstallFrom> + <InstallTo> + <DiskID>0</DiskID> + <PartitionID>4</PartitionID> + </InstallTo> + </OSImage> + </ImageInstall> + <RunSynchronous> + <RunSynchronousCommand> + <Order>1</Order> + <!-- Set power scheme to high performance in WinPE for faster imaging. --> + <Path>cmd /c powercfg.exe /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c</Path> + </RunSynchronousCommand> + </RunSynchronous> + <UserData> + <AcceptEula>true</AcceptEula> + <FullName>${build_username}</FullName> + <Organization>${build_username}</Organization> + %{if vm_inst_os_eval != true ~} + <ProductKey> + <Key>${vm_inst_os_key}</Key> + <WillShowUI>OnError</WillShowUI> + </ProductKey> + %{ endif ~} + </UserData> + <EnableFirewall>false</EnableFirewall> + </component> + </settings> + <settings pass="offlineServicing"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <EnableLUA>false</EnableLUA> + </component> + </settings> + <settings pass="generalize"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <SkipRearm>1</SkipRearm> + </component> + </settings> + <settings pass="specialize"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <OEMInformation> + <HelpCustomized>false</HelpCustomized> + </OEMInformation> + <TimeZone>${vm_guest_os_timezone}</TimeZone> + <RegisteredOwner /> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <SkipAutoActivation>true</SkipAutoActivation> + </component> + </settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <InputLocale>${vm_guest_os_keyboard}</InputLocale> + <SystemLocale>${vm_guest_os_language}</SystemLocale> + <UILanguage>${vm_guest_os_language}</UILanguage> + <UILanguageFallback>${vm_guest_os_language}</UILanguageFallback> + <UserLocale>${vm_guest_os_language}</UserLocale> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <AutoLogon> + <Password> + <Value>${build_password}</Value> + <PlainText>true</PlainText> + </Password> + <Enabled>true</Enabled> + <Username>${build_username}</Username> + </AutoLogon> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Work</NetworkLocation> + <ProtectYourPC>2</ProtectYourPC> + </OOBE> + <UserAccounts> + <AdministratorPassword> + <Value>${build_password}</Value> + <PlainText>true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>${build_password}</Value> + <PlainText>true</PlainText> + </Password> + <Group>administrators</Group> + <DisplayName>${build_username}</DisplayName> + <Name>${build_username}</Name> + <Description>Build Account</Description> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 64-Bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 32-Bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -File E:\windows-virtio.ps1</CommandLine> + <Order>3</Order> + <Description>Install VMware Tools</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -File E:\windows-init.ps1</CommandLine> + <Order>4</Order> + <Description>Initial Configuration</Description> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> +</unattend> diff --git a/builds/windows/desktop/11/variables.pkr.hcl b/builds/windows/desktop/11/variables.pkr.hcl index 09f39dc..293fc2e 100644 --- a/builds/windows/desktop/11/variables.pkr.hcl +++ b/builds/windows/desktop/11/variables.pkr.hcl @@ -318,7 +318,7 @@ variable "vm_boot_order" { variable "vm_boot_wait" { type = string description = "The time to wait before boot." - default = "5s" + default = "10s" } variable "vm_boot_command" { diff --git a/builds/windows/desktop/11/windows.pkr.hcl b/builds/windows/desktop/11/windows.pkr.hcl index 25a6691..cf522a0 100644 --- a/builds/windows/desktop/11/windows.pkr.hcl +++ b/builds/windows/desktop/11/windows.pkr.hcl @@ -111,7 +111,7 @@ source "proxmox-iso" "windows-desktop-pro" { // Removable Media Settings additional_iso_files { - iso_file = "${var.common_iso_storage}:iso/virtio-win.iso" + iso_file = "${var.common_iso_storage}:iso/virtio-win-0.1.285.iso" iso_storage_pool = var.common_iso_storage cd_label = "VirtIO" unmount = true @@ -223,7 +223,7 @@ source "proxmox-iso" "windows-desktop-ent" { // Removable Media Settings additional_iso_files { - iso_file = "${var.common_iso_storage}:iso/virtio-win.iso" + iso_file = "${var.common_iso_storage}:iso/virtio-win-0.1.285.iso" iso_storage_pool = var.common_iso_storage cd_label = "VirtIO" unmount = true