Files
oxmc d38cd32b82 Fix registry ownership/ACL and hang bugs in tiny11maker.ps1, plus build/setup script updates
Fixes several offline-hive build failures: TrustedInstaller-owned keys
(WindowsRuntime\ActivatableClassId, Explorer\Advanced, System\GameConfigStore, Search
SystemIndex) denying writes even to admin-owned processes, a PowerShell 5.1 quirk that drops
empty-string reg.exe arguments and can hang the build on a silent overwrite prompt, a
registry-handle leak that left hives locked and cascaded into DISM cleanup failures, and
relaxed the post-ResetBase health gate to accept 'Repairable' (only abort on
'NonRepairable') since ResetBase makes full repair impossible anyway - documented that
repairing the installed OS needs the original stock ISO, not the tweaked output. Also
rolls in in-progress updates to the other maker scripts and OEM setup/first-boot scripts.
2026-07-31 06:09:58 -07:00

100 lines
4.5 KiB
PowerShell

# Check PowerShell version for use in path
if ($PSVersionTable.PSVersion.Major -ge 3) {
# Use new variable syntax in PowerShell 3 and above
$currentDir = $PSScriptRoot
}
else {
# Use old variable syntax in Windows PowerShell 3 and below
$currentDir = (Get-Item .).FullName
}
# Import script-helper.ps1
. "$currentDir\..\..\scripts\script-helper.ps1"
# Get system information
$systemInfo = Get-SystemInfo
#$windowsInfo = Get-WindowsVersionDetails
# If the device windows is running on is a Mac, Prompt to install Mac-specific software
if ($systemInfo.deviceIsMac) {
Write-Output "Mac hardware detected - Running Mac-specific setup..."
#Start-Process -FilePath "$windowsDrive\Windows\OEM\setup\scripts\tweaks\setup-mac.ps1" -ArgumentList "" -Wait
}
#### If there are any specific scripts to run for certain Windows versions (25H2, Pro, 21600, etc), add them here ####
#if ($windowsInfo.CodeRelease -eq "21H2") {
# Write-Output "Running Windows 10 21H2 specific setup..."
# Start-Process -FilePath "$windowsDrive\Windows\OEM\setup\scripts\tweaks\setup-21H2.ps1" -ArgumentList "" -Wait
#}
#if ($windowsInfo.Edition -eq "Education") {
# Write-Output "Running Windows 10/11 Education specific setup..."
# Start-Process -FilePath "$windowsDrive\Windows\OEM\setup\scripts\tweaks\setup-education.ps1" -ArgumentList "" -Wait
#}
#### Set lock screen image (system-wide, applies before first login) ####
$lockScreenPath = "$windowsDrive\Windows\Web\Wallpaper\Windows\flooded-city.jpg"
if (Test-Path $lockScreenPath) {
$policyPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization"
if (-not (Test-Path $policyPath)) { New-Item -Path $policyPath -Force | Out-Null }
Set-ItemProperty -Path $policyPath -Name "LockScreenImagePath" -Value $lockScreenPath -Type String
Set-ItemProperty -Path $policyPath -Name "LockScreenImageUrl" -Value $lockScreenPath -Type String
Set-ItemProperty -Path $policyPath -Name "LockScreenImageStatus" -Value 1 -Type DWord
Write-Output "Lock screen image set to $lockScreenPath"
# just in case, also disable spotlight
Set-ItemProperty -Path $policyPath -Name "NoLockScreenSlideshow" -Value 1 -Type DWord
} else {
Write-Warning "Lock screen image not found at $lockScreenPath - skipping."
}
# Install cursors to registry
Install-CursorScheme -SchemeName "Posy's Cursor" -CursorDir "$windowsDrive\Windows\Cursors\Posys Cursor" -Files @{
pointer = "Posy cursor.cur"
help = "Posy help.cur"
working = "Posy background max 96.ani"
busy = "Posy wait max 96.ani"
precision = "Posy precise.cur"
text = "Posy beam.cur"
hand = "Posy pen.cur"
unavailable = "Posy forbidden.cur"
vert = "Posy size NS.cur"
horz = "Posy size EW.cur"
dgn1 = "Posy size NwSe.cur"
dgn2 = "Posy size NeSw.cur"
move = "Posy move.cur"
alternate = "Posy alt.cur"
link = "Posy hand.cur"
person = "Posy cursor.cur" # fallback
pin = "Posy cursor.cur" # fallback
}
Install-CursorScheme -SchemeName "nikocursor" -CursorDir "$windowsDrive\Windows\Cursors\niko1X" -Files @{
pointer = "normal.ani"
help = "help.ani"
working = "working.ani"
busy = "busy.ani"
precision = "precision.ani"
text = "text.ani"
hand = "handwriting.ani"
unavailable = "unavailable.ani"
vert = "vertical.ani"
horz = "horizontal.ani"
dgn1 = "diagonal1.ani"
dgn2 = "diagonal2.ani"
move = "move.ani"
alternate = "alternate.ani"
link = "link.ani"
person = "person.ani"
pin = "pin.ani"
}
#### Install UWP UI Components for all users ####
Write-Output "Installing UWP UI Components for all users..."
& "$windowsDrive\Windows\OEM\setup\scripts\UWP-Components.ps1"
#### Install Normal Apps (Machine wide) ####
Start-Process -FilePath "$windowsDrive\Windows\OEM\MultiStaller.exe" -ArgumentList "--config", "$windowsDrive\Windows\OEM\setup\apps-machine-wide.yml" -WindowStyle Maximized -Wait
Start-Process -FilePath "$windowsDrive\Windows\OEM\ChromeMassInstaller.exe" -ArgumentList "--no_pref" -Wait
# Install other miscellaneous applications (mostly for user convenience)
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i `"$windowsDrive\Windows\OEM\apps\other\Monitarian-4.14.0.msi`" /quiet /norestart" -Wait -PassThru
Start-Process -FilePath "$windowsDrive\Windows\OEM\apps\other\ShareX-19.0.2-setup.exe" -ArgumentList "/S" -Wait