Unify $winutildir (#4004)

This commit is contained in:
KamaleiZestri
2026-02-10 14:14:20 -06:00
committed by GitHub
parent 681f0ec3b9
commit 8a8fed517c
4 changed files with 9 additions and 11 deletions

View File

@@ -129,8 +129,8 @@ function Invoke-WinutilThemeChange {
}
}
$LightPreferencePath = "$env:LOCALAPPDATA\winutil\LightTheme.ini"
$DarkPreferencePath = "$env:LOCALAPPDATA\winutil\DarkTheme.ini"
$LightPreferencePath = "$winutildir\LightTheme.ini"
$DarkPreferencePath = "$winutildir\DarkTheme.ini"
if ($init) {
Set-WinutilTheme -currentTheme "shared"

View File

@@ -14,8 +14,8 @@ function Set-PackageManagerPreference {
[PackageManagers]$preferredPackageManager
)
$preferencePath = "$env:LOCALAPPDATA\winutil\preferences.ini"
$oldChocoPath = "$env:LOCALAPPDATA\winutil\preferChocolatey.ini"
$preferencePath = "$winutildir\preferences.ini"
$oldChocoPath = "$winutildir\preferChocolatey.ini"
#Try loading from file if no argument given.
if ($null -eq $preferredPackageManager) {

View File

@@ -425,12 +425,6 @@ $sync["Form"].Add_Loaded({
$NavLogoPanel = $sync["Form"].FindName("NavLogoPanel")
$NavLogoPanel.Children.Add((Invoke-WinUtilAssets -Type "logo" -Size 25)) | Out-Null
# Initialize the hashtable
$winutildir = @{}
# Set the path for the winutil directory
$winutildir = "$env:LocalAppData\winutil\"
New-Item $winutildir -ItemType Directory -Force | Out-Null
if (Test-Path "$winutildir\logo.ico") {
$sync["logorender"] = "$winutildir\logo.ico"

View File

@@ -79,7 +79,11 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
$dateTime = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"
$logdir = "$env:localappdata\winutil\logs"
# Set the path for the winutil directory
$winutildir = "$env:LocalAppData\winutil"
New-Item $winutildir -ItemType Directory -Force | Out-Null
$logdir = "$winutildir\logs"
New-Item $logdir -ItemType Directory -Force | Out-Null
Start-Transcript -Path "$logdir\winutil_$dateTime.log" -Append -NoClobber | Out-Null