/
sarasa-term-sc-nerd.json
70 lines (70 loc) · 4.09 KB
/
sarasa-term-sc-nerd.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
"version": "1.1.0",
"description": "简体中文终端更纱黑体+Nerd图标字体库。中英文宽度完美2:1,图标长宽经过调整,不会出现对齐问题,尤其适合作为终端字体。",
"homepage": "https://github.com/laishulu/Sarasa-Term-SC-Nerd",
"license": "OFL-1.1",
"depends": "",
"url": "https://ghproxy.com/https://github.com/laishulu/Sarasa-Term-SC-Nerd/releases/download/v1.1.0/sarasa-term-sc-nerd.ttf.7z",
"hash": "b459358ccf49cde2344742d8a49482f26b5eb0aed3d39295214c12c25f7f3cfa",
"extract_dir": "",
"extract_to": "",
"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",
"Get-ChildItem $dir -Filter '*.ttf' | ForEach-Object {",
" $value = if ($isFontInstallationForAllUsers) { $_.Name } else { \"$fontInstallDir\\$($_.Name)\" }",
" New-ItemProperty -Path $registryKey -Name $_.Name.Replace($_.Extension, ' (TrueType)') -Value $value -Force | Out-Null",
" Copy-Item $_.FullName -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\"",
"Get-ChildItem $dir -Filter '*.ttf' | ForEach-Object {",
" Get-ChildItem $fontInstallDir -Filter $_.Name | ForEach-Object {",
" try {",
" Rename-Item $_.FullName $_.FullName -ErrorVariable LockError -ErrorAction Stop",
" } catch {",
" error \"'$app' is being used by another process.\"",
" error \"Please close all applications (e.g. vscode) that are using '$app' before uninstall or upgrade.\"",
" exit 1",
" }",
" }",
"}",
"Get-ChildItem $dir -Filter '*.ttf' | ForEach-Object {",
" Remove-ItemProperty -Path $registryKey -Name $_.Name.Replace($_.Extension, ' (TrueType)') -Force -ErrorAction SilentlyContinue",
" Remove-Item \"$fontInstallDir\\$($_.Name)\" -Force -ErrorAction SilentlyContinue",
"}",
"Write-Host \"The '$app' Font family has been uninstalled and will not be present after restarting your computer.\" -Foreground Magenta"
]
},
"checkver": {
"github": "https://github.com/laishulu/Sarasa-Term-SC-Nerd",
"regex": "releases/tag/(?:v|V)?([\\d.-]+)"
},
"autoupdate": {
"url": "https://ghproxy.com/https://github.com/laishulu/Sarasa-Term-SC-Nerd/releases/download/v$version/sarasa-term-sc-nerd.ttf.7z"
}
}