-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathClashforWindows.json
More file actions
110 lines (110 loc) · 5.38 KB
/
Copy pathClashforWindows.json
File metadata and controls
110 lines (110 loc) · 5.38 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
"version": "0.20.2",
"description": "A cross-platform GUI based on Clash and Electron.",
"homepage": "https://github.com/Fndroid/clash_for_windows_pkg",
"license": "MIT",
"notes": [
"This manifest uses a script, which needs admin privilege, to modify Windows firewall rules for system stack in TUN mode.",
"If it failed in installation, you can manually run:",
"sudo \"$dir\\update-firewall-rules.ps1\""
],
"depends": "main/gsudo",
"architecture": {
"64bit": {
"url": "https://github.com/Fndroid/clash_for_windows_pkg/releases/download/0.20.2/Clash.for.Windows.Setup.0.20.2.exe#/dl.7z",
"hash": "69d64ec55259bfab1abf9458e2c7ba5c39ffd73a613274a62e5bd853db82a360",
"pre_install": [
"Expand-7zipArchive \"$dir\\`$PLUGINSDIR\\app-64.7z\" \"$dir\"",
"Remove-Item \"$dir\\`$PLUGINSDIR\", \"$dir\\`$R0\" -Force -Recurse"
]
},
"32bit": {
"url": "https://github.com/Fndroid/clash_for_windows_pkg/releases/download/0.20.2/Clash.for.Windows.Setup.0.20.2.ia32.exe#/dl.7z",
"hash": "bbc440e2905ebf2ac81d060bddde9a764f96451b73d1bc00200df95a6cd578ca",
"pre_install": [
"Expand-7zipArchive \"$dir\\`$PLUGINSDIR\\app-32.7z\" \"$dir\"",
"Remove-Item \"$dir\\`$PLUGINSDIR\", \"$dir\\`$R0\" -Force -Recurse"
]
}
},
"installer": {
"script": [
"if (!(Test-Path \"$persist_dir\\data\")) {",
" New-Item \"$persist_dir\\data\" -Type Directory -Force | Out-Null",
" if (Test-Path \"$env:USERPROFILE\\.config\\clash\") {",
" Copy-Item -Path \"$env:USERPROFILE\\.config\\clash\\*\" -Destination \"$persist_dir\\data\" -Recurse -Container",
" }",
"}",
"$S4UtilsPath = Find-BucketDirectory -Root -Name Scoop4kariiin | Join-Path -ChildPath \"scripts\\S4Utils.psm1\"",
"if (Test-Path $S4UtilsPath) {",
" Unblock-File $S4UtilsPath",
" Import-Module $S4UtilsPath",
" Mount-ExternalRuntimeData -Persist \"$persist_dir\\clash_win\" -AppData",
" Remove-Module -Name S4Utils",
"} else {",
" Write-Host 'Missing files, please readd Scoop4kariiin bucket and reinstall this app.' -ForegroundColor Red",
"}"
]
},
"post_install": [
"$ScriptsDir = Find-BucketDirectory -Root -Name Scoop4kariiin | Join-Path -ChildPath \"scripts\\ClashforWindows\"",
"$CFWPath = Get-ChildItem -Path \"$dir\" -Filter \"Clash for Windows.exe\" | Select-Object -ExpandProperty Target",
"$CorePath = Get-ChildItem -Path \"$dir\" -Filter \"clash-win*.exe\" -Recurse | Select-Object -ExpandProperty Target",
"if (Test-Path \"$ScriptsDir\\update-firewall-rules.ps1\") {",
" $Content = Get-Content \"$ScriptsDir\\update-firewall-rules.ps1\"",
" $Content = $Content.Replace('$CFWPath', \"$CFWPath\")",
" $Content = $Content.Replace('$CorePath', \"$CorePath\")",
" $Content | Set-Content -Path \"$dir\\update-firewall-rules.ps1\"",
" Write-Host \"Updating Windows firewall rules ...\" -ForegroundColor Yellow",
" Write-Host \"Please approve permission request if UAC prompt pops up.\" -ForegroundColor Yellow",
" Start-Sleep -Seconds 1",
" sudo \"$dir\\update-firewall-rules.ps1\"",
" if ($?) {",
" Write-Host 'Successfully updated Windows firewall rules!' -ForegroundColor Green",
" } else {",
" Write-Host '[ERROR] Failed updating Windows firewall rules!' -ForegroundColor Red",
" }",
"} else {",
" Write-Host 'Missing files, please readd Scoop4kariiin bucket and reinstall this app' -ForegroundColor Red",
"}"
],
"shortcuts": [
[
"Clash for Windows.exe",
"Clash for Windows"
]
],
"persist": "data",
"uninstaller": {
"script": [
"$S4UtilsPath = Find-BucketDirectory -Root -Name Scoop4kariiin | Join-Path -ChildPath \"scripts\\S4Utils.psm1\"",
"if (Test-Path $S4UtilsPath) {",
" Unblock-File $S4UtilsPath",
" Import-Module $S4UtilsPath",
" Dismount-ExternalRuntimeData -Name \"clash_win\" -AppData",
" Remove-Module -Name S4Utils",
"}"
]
},
"checkver": "github",
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://github.com/Fndroid/clash_for_windows_pkg/releases/download/$version/Clash.for.Windows.Setup.$version.exe#/dl.7z",
"hash": {
"url": "https://github.com/Fndroid/clash_for_windows_pkg/releases/download/$version/sha256sum",
"mode": "extract",
"regex": "(?m)^exe: $sha256"
}
},
"32bit": {
"url": "https://github.com/Fndroid/clash_for_windows_pkg/releases/download/$version/Clash.for.Windows.Setup.$version.ia32.exe#/dl.7z",
"hash": {
"url": "https://github.com/Fndroid/clash_for_windows_pkg/releases/download/$version/sha256sum",
"mode": "extract",
"regex": "(?m)^ia32-exe: $sha256"
}
}
}
}
}