Re-Add Choco Preference

This commit is contained in:
Marterich
2024-10-13 20:45:26 +02:00
parent cf664bd1d3
commit f05fece2e5
6 changed files with 12 additions and 12 deletions

View File

@ -149,12 +149,12 @@ $sync.SortbyAlphabet.Add_Checked({
$xaml.SelectNodes("//*[@Name]") | ForEach-Object {$sync["$("$($psitem.Name)")"] = $sync["Form"].FindName($psitem.Name)}
#Persist the Chocolatey preference across winutil restarts
#$ChocoPreferencePath = "$env:LOCALAPPDATA\winutil\preferChocolatey.ini"
#$sync.WPFpreferChocolatey.Add_Checked({New-Item -Path $ChocoPreferencePath -Force })
#$sync.WPFpreferChocolatey.Add_Unchecked({Remove-Item $ChocoPreferencePath -Force})
#if (Test-Path $ChocoPreferencePath) {
# $sync.WPFpreferChocolatey.IsChecked = $true
#}
$ChocoPreferencePath = "$env:LOCALAPPDATA\winutil\preferChocolatey.ini"
$sync.ChocoRadioButton.Add_Checked({New-Item -Path $ChocoPreferencePath -Force })
$sync.ChocoRadioButton.Add_Unchecked({Remove-Item $ChocoPreferencePath -Force})
if (Test-Path $ChocoPreferencePath) {
$sync.ChocoRadioButton.IsChecked = $true
}
$sync.keys | ForEach-Object {
if($sync.$psitem) {