generated from ScoopInstaller/BucketTemplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
yahei-fira-icon-hybrid.json
45 lines (45 loc) · 3.24 KB
/
yahei-fira-icon-hybrid.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
"version": "1.002",
"description": "适用于 Vim 及终端图标的中英文混合字体",
"license": "Apache-2.0",
"homepage": "https://github.com/HanleyLee/Yahei-Fira-Icon-Hybrid-Font",
"url": "https://raw.githubusercontent.com/hanleylee/yahei-fira-icon-hybrid-font/master/YaHeiFiraIconHybrid-Regular.ttf",
"hash": "e07bdbb4ff178c84af21202c9ecf4bd8b105d0ef34c46f33f25d83cc62005d19",
"installer": {
"script": [
"$currentBuildNumber = [int] (Get-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\").CurrentBuildNumber",
"$windows1809BuildNumber = 17763",
"$isPerUserFontInstallationSupported = $currentBuildNumber -ge $windows1809BuildNumber",
"$isFontInstallationForAllUsers = $global -or !$isPerUserFontInstallationSupported",
"if ($isFontInstallationForAllUsers -and !(is_admin)) {",
" error \"Administrator rights are required to install $app.\"",
" exit 1",
"}",
"$fontInstallDir = if ($isFontInstallationForAllUsers) { \"$env:windir\\Fonts\" } else { \"$env:LOCALAPPDATA\\Microsoft\\Windows\\Fonts\" }",
"$registryRoot = if ($isFontInstallationForAllUsers) { \"HKLM\" } else { \"HKCU\" }",
"$registryKey = \"${registryRoot}:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\"",
"New-Item $fontInstallDir -ItemType Directory -ErrorAction SilentlyContinue | Out-Null",
"$value = if ($isFontInstallationForAllUsers) { \"YaHeiFiraIconHybrid-Regular.ttf\" } else { \"$fontInstallDir\\YaHeiFiraIconHybrid-Regular.ttf\" }",
"New-ItemProperty -Path $registryKey -Name \"YaHei Fira Icon Hybrid Regular (TrueType)\" -Value $value -Force | Out-Null",
"Copy-Item \"$dir\\YaHeiFiraIconHybrid-Regular.ttf\" -Destination $fontInstallDir"
]
},
"uninstaller": {
"script": [
"$currentBuildNumber = [int] (Get-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\").CurrentBuildNumber",
"$windows1809BuildNumber = 17763",
"$isPerUserFontInstallationSupported = $currentBuildNumber -ge $windows1809BuildNumber",
"$isFontInstallationForAllUsers = $global -or !$isPerUserFontInstallationSupported",
"if ($isFontInstallationForAllUsers -and !(is_admin)) {",
" error \"Administrator rights are required to uninstall $app.\"",
" exit 1",
"}",
"$fontInstallDir = if ($isFontInstallationForAllUsers) { \"$env:windir\\Fonts\" } else { \"$env:LOCALAPPDATA\\Microsoft\\Windows\\Fonts\" }",
"$registryRoot = if ($isFontInstallationForAllUsers) { \"HKLM\" } else { \"HKCU\" }",
"$registryKey = \"${registryRoot}:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\"",
"Remove-ItemProperty -Path $registryKey -Name \"YaHei Fira Icon Hybrid Regular (TrueType)\" -Force -ErrorAction SilentlyContinue",
"Remove-Item \"$fontInstallDir\\YaHeiFiraIconHybrid-Regular.ttf\" -Force -ErrorAction SilentlyContinue",
"Write-Host \"The 'YaHei Fira Icon Hybrid' Font has been uninstalled and will not be present after restarting your computer.\" -Foreground Magenta"
]
}
}