Merge branch 'master' into develop

This commit is contained in:
Jeffrey
2026-06-07 22:53:29 +02:00
13 changed files with 229 additions and 132 deletions

View File

@@ -1,7 +1,14 @@
# Checks if the system is set to use dark mode for apps
function GetSystemUsesDarkMode {
try {
return (Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize' -Name 'AppsUseLightTheme').AppsUseLightTheme -eq 0
$personalizeKey = Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize'
if ($null -eq $personalizeKey) {
Write-Host "WARNING: Unable to retrieve personalization settings." -ForegroundColor Yellow
return $false
}
return $personalizeKey.AppsUseLightTheme -eq 0
}
catch {
return $false

View File

@@ -831,6 +831,18 @@
}
}
# When running as SYSTEM, the "Current User" option is not meaningful.
# Hide it from the dropdown and default to "Other User".
$isSystem = ([Security.Principal.WindowsIdentity]::GetCurrent().User.Value -eq 'S-1-5-18')
if ($isSystem -and $userSelectionCombo.Items.Count -gt 0) {
$currentUserItem = $userSelectionCombo.Items[0]
if ($currentUserItem -is [System.Windows.Controls.ComboBoxItem]) {
$currentUserItem.Visibility = 'Collapsed'
$currentUserItem.IsEnabled = $false
}
$userSelectionCombo.SelectedIndex = 1
}
$restartExplorerCheckBox = $window.FindName('RestartExplorerCheckBox')
if ($restartExplorerCheckBox -and $script:Params.ContainsKey("NoRestartExplorer")) {
$restartExplorerCheckBox.IsChecked = $false