generated from ScoopInstaller/BucketTemplate
/
winbtrfs.json
47 lines (47 loc) 路 2.55 KB
/
winbtrfs.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
{
"version": "1.9",
"description": "BTRFS filesystem driver.",
"homepage": "https://github.com/maharmstone/btrfs",
"license": "LGPL-3.0-or-later",
"notes": [
"If you using Windows 10 and have Secure Boot enabled, you may have to make a registry change in order for the driver to be loaded.",
"See https://github.com/maharmstone/btrfs#secureboot."
],
"url": "https://github.com/maharmstone/btrfs/releases/download/v1.9/btrfs-1.9.zip",
"hash": "673b0ecc23634d85213ba46e309bfb788ac83fcc14e4976773b324592401303a",
"pre_install": "if (!$global) { Write-Host -Foreground Red \"$app should be installed globally.\"; break }",
"installer": {
"script": [
"using namespace System.Security.Cryptography.X509Certificates",
"# Add cert first before installing driver",
"$cert = (Get-AuthenticodeSignature \"$dir/btrfs.cat\").SignerCertificate",
"if (!(Get-ChildItem Cert:/CurrentUser/TrustedPublisher -Recurse | Where-Object { $_.Thumbprint -eq $cert.Thumbprint })) {",
" Write-Host 'Cert not found, adding to trusted store...'",
" $store = [X509Store]::new([StoreName]::TrustedPublisher, [StoreLocation]::LocalMachine)",
" $store.Open([OpenFlags]::ReadWrite)",
" $store.Add($cert.Export([X509ContentType]::Cert))",
" $store.Close()",
"}",
"",
"Write-Host 'Installing driver...'",
"$null = Invoke-ExternalCommand pnputil.exe -ArgumentList @('/add-driver', \"$dir/btrfs.inf\", '/install') -RunAs -ContinueExitCodes @{ 3010 = 'A system reboot is required to finalize the installation.' }"
]
},
"post_install": [
"Set-ItemProperty HKLM:/SYSTEM/CurrentControlSet/Services/btrfs Compress 1",
"Set-ItemProperty HKLM:/SYSTEM/CurrentControlSet/Services/btrfs CompressType 3"
],
"uninstaller": {
"script": [
"if ($cmd -ne 'uninstall') { return }",
"$null = Invoke-ExternalCommand pnputil.exe -ArgumentList @('/remove-device', 'ROOT\\btrfs\\0000') -RunAs -ContinueExitCodes @{ 3010 = 'A system reboot is required to finalize the uninstallation.' }",
"$null = pnputil.exe /delete-driver \"$dir\\btrfs.inf\" /uninstall",
"$null = pnputil.exe /delete-driver \"$dir\\btrfs-vol.inf\" /uninstall",
"$null = sc.exe delete btrfs"
]
},
"checkver": "github",
"autoupdate": {
"url": "https://github.com/maharmstone/btrfs/releases/download/v$version/btrfs-$version.zip"
}
}