-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecursive.json
52 lines (52 loc) · 3.44 KB
/
recursive.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
{
"version": "1.085",
"license": "MIT",
"homepage": "https://github.com/arrowtype/recursive",
"url": "https://github.com/arrowtype/recursive/releases/download/v1.085/ArrowType-Recursive-1.085.zip",
"hash": "cbcbdf7a0e181d284a9235e09ed5f3873e527bc5dd1d977df71cdc1ff937da02",
"checkver": "github",
"autoupdate": {
"url": "https://github.com/arrowtype/recursive/releases/download/v$version/ArrowType-Recursive-$version.zip"
},
"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 '*Complete Windows Compatible.*' | 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 '*Complete Windows Compatible.*' | 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.Replace('-NF', ''))' Font family has been uninstalled and will not be present after restarting your computer.\" -Foreground Magenta"
]
}
}