generated from Ash258/GenericBucket
-
Notifications
You must be signed in to change notification settings - Fork 2
/
MiSans.json
50 lines (50 loc) · 3.44 KB
/
MiSans.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
{
"version": "2.00",
"description": "Xiaomi produces a wide range of OpenType functions to select different forms of characters according to specific needs, for free commercial use by the whole community.",
"homepage": "https://web.vip.miui.com/page/info/mio/mio/detail?postId=33935854",
"license": "Unknown",
"url": "https://cdn.cnbj1.fds.api.mi-img.com/vipmlmodel/font/MiSans/MiSans.zip",
"hash": "38bdec9525024ee9ce1ee56ebc5a32a37efaecf86b385ec3da71898708dad7f6",
"extract_dir": "MiSans 开发下载字重",
"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 {",
" Remove-ItemProperty -Path $registryKey -Name $_.Name.Replace($_.Extension, ' (TrueType)') -Force -ErrorAction SilentlyContinue",
" Remove-Item \"$fontInstallDir\\$($_.Name)\" -Force -ErrorAction SilentlyContinue",
"}",
"Write-Host \"Font family 'MiSans' has been uninstalled and will not be present after restarting your computer.\" -Foreground Magenta"
]
}
}