diff --git a/bucket/Clash4Windows.json b/bucket/Clash4Windows.json deleted file mode 100644 index 59db662..0000000 --- a/bucket/Clash4Windows.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Clash for Windows", - "homepage": "https://github.com/Fndroid/clash_for_windows_pkg", - "version": "0.14.1", - "architecture": { - "64bit": { - "url": "https://github.com/Fndroid/clash_for_windows_pkg/releases/download/0.14.1/Clash.for.Windows-0.14.1-win.7z", - "hash": "38da00cdd9aa61404708b66a0fdb6dac7bcc2774e1e39126552e682a4c5d23e3", - "bin": "clash4windows\\Clash for Windows.exe", - "shortcuts": [ - [ - "clash4windows\\Clash for Windows.exe", - "Clash for Window" - ] - ] - } - }, - "extract_to": "clash4windows" -} diff --git a/bucket/clash4windows.json b/bucket/clash4windows.json new file mode 100644 index 0000000..1e15750 --- /dev/null +++ b/bucket/clash4windows.json @@ -0,0 +1,85 @@ +{ + "homepage": "https://github.com/Fndroid/clash_for_windows_pkg", + "description": "A Windows GUI based on Clash", + "version": "0.18.10", + "license": "MIT", + "architecture": { + "64bit": { + "url": "https://scoop-bucket.oss-cn-hangzhou.aliyuncs.com/Clash.for.Windows.Setup.0.18.10.exe#/dl.7z", + "hash": "21ac8e540c0cec89fb932457beca26ca793edc546dbb8a7693f1a2f76b3f15d4", + "pre_install": [ + "Expand-7zipArchive \"$dir\\`$PLUGINSDIR\\app-64.7z\" \"$dir\"", + "Remove-Item \"$dir\\`$PLUGINSDIR\", \"$dir\\Uninst*\" -Force -Recurse" + ] + }, + "32bit": { + "url": "https://scoop-bucket.oss-cn-hangzhou.aliyuncs.com/Clash.for.Windows.Setup.0.18.10.ia32.exe#/dl.7z", + "hash": "951497f57e468bc06cb4c34e47723f2cefc76e032858ff6fa404104815fad9c0", + "pre_install": [ + "Expand-7zipArchive \"$dir\\`$PLUGINSDIR\\app-32.7z\" \"$dir\"", + "Remove-Item \"$dir\\`$PLUGINSDIR\", \"$dir\\Uninst*\" -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", + " }", + "}", + "$runtimeCache = \"$env:APPDATA\\clash_win\"", + "$runtimeCachePersist = \"$persist_dir\\clash_win\"", + "if (Test-Path $runtimeCachePersist) {", + " Remove-Item $runtimeCache -Force -Recurse -ErrorAction SilentlyContinue", + " New-Item -Type Junction -Path $runtimeCache -Target $runtimeCachePersist | Out-Null", + "} else {", + " if (Test-Path $runtimeCache) {", + " Move-Item $runtimeCache $runtimeCachePersist -Force", + " New-Item -Type Junction -Path $runtimeCache -Target $runtimeCachePersist | Out-Null", + " }", + "}" + ] + }, + "uninstaller": { + "script": [ + "$runtimeCache = \"$env:APPDATA\\clash_win\"", + "$runtimeCachePersist = \"$persist_dir\\clash_win\"", + "if (!(Test-Path $runtimeCachePersist)) {", + " Move-Item $runtimeCache $runtimeCachePersist -Force", + "} else {", + " Remove-Item $runtimeCache -Force -Recurse -ErrorAction SilentlyContinue", + "}" + ] + }, + "shortcuts": [ + [ + "Clash for Windows.exe", + "Clash for Windows" + ] + ], + "persist": "data", + "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": "^ia32-exe: $sha256" + } + } + } + }, + "notes": "Clash for Windows data are now saved into '$persist_dir' and persisted by Scoop." +}