projects
/
webi-installers
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a3a17a9
)
workaround: open system font book to let user click 'Install'
author
AJ ONeal
<aj@therootcompany.com>
Mon, 26 Apr 2021 07:50:33 +0000
(07:50 +0000)
committer
AJ ONeal
<aj@therootcompany.com>
Mon, 26 Apr 2021 07:50:33 +0000
(07:50 +0000)
nerdfont/install.ps1
patch
|
blob
|
history
diff --git
a/nerdfont/install.ps1
b/nerdfont/install.ps1
index 9157d1f0947804a8469438cb35cafc3f652fc812..cd6aa45d97186946248f6116b97c09592e1cfb9a 100644
(file)
--- a/
nerdfont/install.ps1
+++ b/
nerdfont/install.ps1
@@
-18,7
+18,7
@@
pushd "$my_fontdir"
$regFontPath = "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
$fontRegistryPath = "HKCU:$regFontPath"
$fontFiles = Get-ChildItem -Recurse -Include *.ttf, *.otf
$regFontPath = "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
$fontRegistryPath = "HKCU:$regFontPath"
$fontFiles = Get-ChildItem -Recurse -Include *.ttf, *.otf
-
$null =
foreach($font in $fontFiles) {
+foreach($font in $fontFiles) {
# See https://github.com/PPOSHGROUP/PPoShTools/blob/master/PPoShTools/Public/FileSystem/Add-Font.ps1#L80
Add-Type -AssemblyName System.Drawing
$objFontCollection = New-Object System.Drawing.Text.PrivateFontCollection
# See https://github.com/PPOSHGROUP/PPoShTools/blob/master/PPoShTools/Public/FileSystem/Add-Font.ps1#L80
Add-Type -AssemblyName System.Drawing
$objFontCollection = New-Object System.Drawing.Text.PrivateFontCollection
@@
-27,9
+27,12
@@
$null = foreach($font in $fontFiles) {
$regTest = Get-ItemProperty -Path $fontRegistryPath -Name "*$FontName*" -ErrorAction SilentlyContinue
if (-not ($regTest)) {
$regTest = Get-ItemProperty -Path $fontRegistryPath -Name "*$FontName*" -ErrorAction SilentlyContinue
if (-not ($regTest)) {
- New-ItemProperty -Name $FontName -Path $fontRegistryPath -PropertyType string -Value $font.
Full
Name
- Write-Output "Register
ing font {$($font.Name)} in registry with name
{$FontName}"
+ New-ItemProperty -Name $FontName -Path $fontRegistryPath -PropertyType string -Value $font.Name
+ Write-Output "Register
ed font {$($font.Name)} in Current User registry as
{$FontName}"
}
}
+ echo "Installed $my_nerdfont_otf to $my_fontdir"
+ # because adding to the registry alone doesn't actually take
+ & start $font.FullName
+ echo ""
+ echo "IMPORTANT: Click 'Install' to complete installation"
}
}
-
-echo "Installed $my_nerdfont_otf to $my_fontdir"