From 31f595529d7c0c395edf1b23d9bf9dc93751c491 Mon Sep 17 00:00:00 2001 From: Ana Maria Martinez Gomez Date: Tue, 10 Oct 2023 14:41:13 +0200 Subject: [PATCH] installer.vm: set lock screen image Set lock screen image to the background image used already as a wallpaper. Use the setting fit (6) for the background image to be able to use the same image. --- packages/installer.vm/tools/chocolateyinstall.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/installer.vm/tools/chocolateyinstall.ps1 b/packages/installer.vm/tools/chocolateyinstall.ps1 index 4046f535a..3436b17b8 100644 --- a/packages/installer.vm/tools/chocolateyinstall.ps1 +++ b/packages/installer.vm/tools/chocolateyinstall.ps1 @@ -122,13 +122,18 @@ try { Write-Host "`t[-] %LOCALAPPDATA%\Boxstarter\boxstarter.log" -ForegroundColor Yellow } - # Let users know installation is complete by setting background, playing win sound, and display message box + # Let users know installation is complete by setting lock screen & wallpaper background, playing win sound, and display message box # Set background Set-ItemProperty 'HKCU:\Control Panel\Colors' -Name Background -Value "0 0 0" -Force | Out-Null $backgroundImage = "${Env:VM_COMMON_DIR}\background.png" if ((Test-Path $backgroundImage)) { + # Set lock screen image + New-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP" -Force | Out-Null + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP" -Name LockScreenImagePath -PropertyType String -Value "C:\ProgramData\_VM\background.png" -Force | Out-Null + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP" -Name LockScreenImageStatus -PropertyType DWord -Value 1 -Force | Out-Null + # Set desktop wallpaper image # Center: 0, Stretch: 2, Fit:6, Fill: 10, Span: 22 - New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name WallpaperStyle -PropertyType String -Value 0 -Force | Out-Null + New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name WallpaperStyle -PropertyType String -Value 6 -Force | Out-Null New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name TileWallpaper -PropertyType String -Value 0 -Force | Out-Null Add-Type -TypeDefinition @" using System;