fix(backinfo): set desktop background color in all profiles (no black border)
All checks were successful
release / build-and-release (push) Successful in 32s

BackInfo paints a centered bitmap; when it is smaller than the screen the area
around it shows HKCU\Control Panel\Colors\Background, which was black in profiles
step 04 had not touched. Set the solid background (#223B47) in HKU\.DEFAULT and in
every existing user profile (loading each hive as needed), on top of the Default
hive and current user, so the border around the bitmap blends into the background.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
X9 Dev 2026-06-02 14:35:22 +02:00
parent e0206f7e1e
commit d20b0b439e
5 changed files with 57 additions and 2 deletions

View file

@ -12,6 +12,11 @@ Builds are continuous: every push to `main` produces a signed `xetup.exe` publis
- **BackInfo background color**: use the COLORREF value `4668194` for #223B47. BackInfo uses a - **BackInfo background color**: use the COLORREF value `4668194` for #223B47. BackInfo uses a
COLORREF (`0x00BBGGRR` / BGR), so the 0.7 value `2243399` (`0x223B47`) was read with red/blue COLORREF (`0x00BBGGRR` / BGR), so the 0.7 value `2243399` (`0x223B47`) was read with red/blue
swapped and rendered olive-brown (#473B22). Reverts the 0.7 change. swapped and rendered olive-brown (#473B22). Reverts the 0.7 change.
- **BackInfo black border in some profiles** (04): BackInfo paints a centered bitmap; when it is
smaller than the screen, the surrounding desktop showed black in profiles whose
`Control Panel\Colors\Background` was not set. The solid desktop background color (#223B47) is
now written to HKU\.DEFAULT and to every existing user profile (loading each hive as needed),
in addition to the Default hive and current user, so the area around the bitmap blends in.
## [0.7] - 2026-06-02 ## [0.7] - 2026-06-02

View file

@ -134,6 +134,9 @@ registry. Creates startup shortcut for all users. BackInfo renders system info B
desktop wallpaper on every logon. Background is solid #223B47 (BackInfo.ini desktop wallpaper on every logon. Background is solid #223B47 (BackInfo.ini
BackgroundColor = 4668194; BackInfo uses a COLORREF / 0x00BBGGRR / BGR value, so BackgroundColor = 4668194; BackInfo uses a COLORREF / 0x00BBGGRR / BGR value, so
#223B47 = 71*65536 + 59*256 + 34 = 4668194. The RGB value 2243399 rendered olive-brown). #223B47 = 71*65536 + 59*256 + 34 = 4668194. The RGB value 2243399 rendered olive-brown).
Because BackInfo paints a centered bitmap, step 04 also sets the solid desktop background color
(#223B47) in the Default hive, the current user, HKU\.DEFAULT and every existing profile - otherwise
a sub-screen bitmap shows a black border around it.
--- ---

View file

@ -387,7 +387,8 @@ $pinList
@{ Key="Software\Microsoft\Windows\DWM"; Name="ColorPrevalence"; Val=1; Type="DWord" }, @{ Key="Software\Microsoft\Windows\DWM"; Name="ColorPrevalence"; Val=1; Type="DWord" },
@{ Key="Software\Microsoft\Windows\CurrentVersion\Explorer\Accent"; Name="AccentColorMenu"; Val=$AccentColorABGR; Type="DWord" }, @{ Key="Software\Microsoft\Windows\CurrentVersion\Explorer\Accent"; Name="AccentColorMenu"; Val=$AccentColorABGR; Type="DWord" },
@{ Key="Software\Microsoft\Windows\CurrentVersion\Explorer\Accent"; Name="StartColorMenu"; Val=$AccentColorABGR; Type="DWord" }, @{ Key="Software\Microsoft\Windows\CurrentVersion\Explorer\Accent"; Name="StartColorMenu"; Val=$AccentColorABGR; Type="DWord" },
@{ Key="Software\Microsoft\Windows\CurrentVersion\Explorer\Accent"; Name="AccentPalette"; Val=$AccentPalette; Type="Binary" } @{ Key="Software\Microsoft\Windows\CurrentVersion\Explorer\Accent"; Name="AccentPalette"; Val=$AccentPalette; Type="Binary" },
@{ Key="Control Panel\Colors"; Name="Background"; Val="34 59 71"; Type="String" }
) )
foreach ($c in $defaultColors) { foreach ($c in $defaultColors) {
$cp = "Registry::HKU\.DEFAULT\$($c.Key)" $cp = "Registry::HKU\.DEFAULT\$($c.Key)"
@ -401,6 +402,51 @@ $pinList
} }
Write-Log " Theme/accent mirrored to HKU\.DEFAULT" -Level OK Write-Log " Theme/accent mirrored to HKU\.DEFAULT" -Level OK
# -------------------------------------------------------------------
# Desktop background color in EVERY existing user profile
# -------------------------------------------------------------------
# BackInfo paints a centered bitmap; if it is smaller than the screen, the
# area around it shows HKCU\Control Panel\Colors\Background. New users get
# #223B47 from the Default hive and the current user from HKCU above, but
# pre-existing profiles would show the default black border. Set the color
# in each real user profile (loading its hive if it is not already mounted).
Write-Log "Applying desktop background color to existing user profiles" -Level STEP
$profileList = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
foreach ($pl in (Get-ChildItem $profileList -ErrorAction SilentlyContinue)) {
$sid = Split-Path $pl.Name -Leaf
if ($sid -notmatch '^S-1-5-21-') { continue } # real interactive users only
$img = (Get-ItemProperty $pl.PSPath -Name ProfileImagePath -ErrorAction SilentlyContinue).ProfileImagePath
if (-not $img) { continue }
$hiveKeyPath = "Registry::HKU\$sid"
$tempLoaded = $false
if (-not (Test-Path $hiveKeyPath)) {
$ntuser = Join-Path $img "NTUSER.DAT"
if (-not (Test-Path $ntuser)) { continue }
& reg load "HKU\$sid" $ntuser 2>&1 | Out-Null
if ($LASTEXITCODE -ne 0) {
Write-Log " Could not load hive for $sid (in use?) - skipped" -Level WARN
continue
}
$tempLoaded = $true
}
try {
$colorsKey = "$hiveKeyPath\Control Panel\Colors"
if (-not (Test-Path $colorsKey)) { New-Item -Path $colorsKey -Force -ErrorAction Stop | Out-Null }
Set-ItemProperty -Path $colorsKey -Name "Background" -Value "34 59 71" -Type String -Force -ErrorAction Stop
Write-Log " Background color set for $sid ($(Split-Path $img -Leaf))" -Level OK
}
catch {
Write-Log " Failed background color for $sid - $_" -Level WARN
}
finally {
if ($tempLoaded) {
[GC]::Collect(); [GC]::WaitForPendingFinalizers(); Start-Sleep -Milliseconds 300
& reg unload "HKU\$sid" 2>&1 | Out-Null
}
}
}
# =================================================================== # ===================================================================
# KEYBOARD LAYOUTS - Czech primary, US secondary # KEYBOARD LAYOUTS - Czech primary, US secondary
# =================================================================== # ===================================================================

View file

@ -83,7 +83,7 @@
"registry-osname-hklm-software-backinfo": "Detects Windows build number and edition, writes OSName string to HKLM\\SOFTWARE\\BackInfo\\OSName (and WOW6432Node). BackInfo.ini references %OSName% to display the correct OS on the wallpaper.", "registry-osname-hklm-software-backinfo": "Detects Windows build number and edition, writes OSName string to HKLM\\SOFTWARE\\BackInfo\\OSName (and WOW6432Node). BackInfo.ini references %OSName% to display the correct OS on the wallpaper.",
"startup-shortcut-backinfo-exe": "Creates a shortcut at C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\BackInfo.lnk pointing to C:\\Program Files\\Backinfo\\BackInfo.exe. Ensures BackInfo starts for every user on logon.", "startup-shortcut-backinfo-exe": "Creates a shortcut at C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\BackInfo.lnk pointing to C:\\Program Files\\Backinfo\\BackInfo.exe. Ensures BackInfo starts for every user on logon.",
"07-desktop-info-ps1-smazat-nahrazeno": "07-desktop-info.ps1 is superseded by this script. BackInfo.exe is the preferred approach - stable on Win10 and Win11, configurable via INI, already present in assets.", "07-desktop-info-ps1-smazat-nahrazeno": "07-desktop-info.ps1 is superseded by this script. BackInfo.exe is the preferred approach - stable on Win10 and Win11, configurable via INI, already present in assets.",
"backinfo-pozadi-223b47": "BackInfo.ini sets a solid #223B47 background via BackgroundColor = 4668194. BackInfo uses a Windows COLORREF (0x00BBGGRR, i.e. BGR), so #223B47 = B*65536 + G*256 + R = 71*65536 + 59*256 + 34 = 4668194. The RGB value 2243399 (0x223B47) was read as a COLORREF, swapping red/blue, and rendered olive-brown (#473B22)." "backinfo-pozadi-223b47": "BackInfo.ini sets a solid #223B47 background via BackgroundColor = 4668194. BackInfo uses a Windows COLORREF (0x00BBGGRR, i.e. BGR), so #223B47 = B*65536 + G*256 + R = 71*65536 + 59*256 + 34 = 4668194. The RGB value 2243399 (0x223B47) was read as a COLORREF, swapping red/blue, and rendered olive-brown (#473B22). BackInfo paints a centered bitmap, so the solid desktop background color (#223B47) is set in the Default hive, current user, HKU\\.DEFAULT and every existing profile - otherwise the area around a sub-screen bitmap shows a black border."
} }
}, },
"07-desktop-info": { "07-desktop-info": {

View file

@ -709,6 +709,7 @@
<tr class="flag-done"><td>BackInfo.exe v assets/Backinfo/ k dispozici</td><td>Hotovo</td></tr> <tr class="flag-done"><td>BackInfo.exe v assets/Backinfo/ k dispozici</td><td>Hotovo</td></tr>
<tr class="flag-done"><td>BackInfo auto-start pri kazdem logonu via Startup shortcut</td><td>Shortcut do ProgramData\StartUp vytvori 07-backinfo.ps1</td></tr> <tr class="flag-done"><td>BackInfo auto-start pri kazdem logonu via Startup shortcut</td><td>Shortcut do ProgramData\StartUp vytvori 07-backinfo.ps1</td></tr>
<tr class="flag-done"><td>Pozadi #223B47 (<code>BackgroundColor = 4668194</code>)</td><td>BackInfo bere hodnotu jako COLORREF (<code>0x00BBGGRR</code>, BGR): B=71 G=59 R=34 = 4668194. Hodnota 2243399 (RGB) se cetla jako COLORREF, prohodila R/B a renderovala olivove hnedou (#473B22).</td></tr> <tr class="flag-done"><td>Pozadi #223B47 (<code>BackgroundColor = 4668194</code>)</td><td>BackInfo bere hodnotu jako COLORREF (<code>0x00BBGGRR</code>, BGR): B=71 G=59 R=34 = 4668194. Hodnota 2243399 (RGB) se cetla jako COLORREF, prohodila R/B a renderovala olivove hnedou (#473B22).</td></tr>
<tr class="flag-done"><td>Desktopova barva pozadi #223B47 ve vsech profilech</td><td>BackInfo dela vystredenou bitmapu; kdyz je mensi nez obrazovka, okolo prosvita <code>Control Panel\Colors\Background</code>. Nastavuje se v Default hive, aktualnim HKCU, <code>HKU\.DEFAULT</code> i v kazdem existujicim profilu &ndash; jinak byl okraj cerny.</td></tr>
</table> </table>
<div class="note"> <div class="note">
<strong>BackInfo.ini konfiguruje:</strong> hostname (velky, centrovan), uzivatelske jmeno, <strong>BackInfo.ini konfiguruje:</strong> hostname (velky, centrovan), uzivatelske jmeno,