mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-05 22:28:31 +00:00
Unify $winutildir (#4004)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user