mirror of
https://github.com/Baipyrus/dotfiles.git
synced 2024-12-25 10:51:46 +00:00
bugfix: create local user fonts directory if not exists
This commit is contained in:
parent
80a34d44c3
commit
107b83ced4
@ -168,6 +168,11 @@ function UnzipAndInstall
|
||||
{ New-Item -ItemType Directory -Path $tmpApp | Out-Null
|
||||
}
|
||||
|
||||
$destination = "$env:LOCALAPPDATA\Microsoft\Windows\Fonts\"
|
||||
if (-not (Test-Path $destination))
|
||||
{ New-Item -ItemType Directory -Path $destination | Out-Null
|
||||
}
|
||||
|
||||
# Find all .url files in the source directory
|
||||
$urlFiles = Get-ChildItem -Path $source -Filter '*.url'
|
||||
|
||||
@ -178,6 +183,6 @@ function UnzipAndInstall
|
||||
Expand-Archive "$tmpApp\$fileName.zip" -DestinationPath "$tmpApp\$fileName" | Out-Null
|
||||
|
||||
Write-Host "Installing fonts from $tmpApp\$fileName\ for current user..." -ForegroundColor Cyan
|
||||
Copy-Item -Path "$tmpApp\$fileName\*" -Destination "$env:LOCALAPPDATA\Microsoft\Windows\Fonts\" -Force -ErrorAction SilentlyContinue
|
||||
Copy-Item -Path "$tmpApp\$fileName\*" -Destination $destination -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user