Skip to content

Commit

Permalink
installer.vm: set lock screen image
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ana06 committed Oct 10, 2023
1 parent 497279c commit 31f5955
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/installer.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 31f5955

Please sign in to comment.