Skip to content

Commit

Permalink
clash-verge-rev: Fix config dir (#14543)
Browse files Browse the repository at this point in the history
* clash-verge-rev: Fix config dir

* clash-verge-rev: improve directory handling during installation
  • Loading branch information
Izumiko authored Dec 29, 2024
1 parent 920a721 commit 09be3ac
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bucket/clash-verge-rev.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,25 @@
"installer": {
"script": [
"ensure \"$persist_dir\" | Out-Null",
"New-Item \"$env:USERPROFILE\\.config\\clash-verge\" -ItemType Junction -Target \"$persist_dir\" | Out-Null"
"$targetPath = \"$env:APPDATA\\io.github.clash-verge-rev.clash-verge-rev\"",
"$linkType = (Get-Item -Path $targetPath -ErrorAction SilentlyContinue).LinkType",
"if (Test-Path $targetPath) {",
" if ($linkType -eq 'Junction') {",
" Remove-Item -Path $targetPath -Force",
" } else {",
" Get-ChildItem -Path $targetPath -Force | Move-Item -Destination $persist_dir -Force",
" Remove-Item -Path $targetPath -Force -Recurse",
" }",
"}",
"New-Item \"$env:APPDATA\\io.github.clash-verge-rev.clash-verge-rev\" -ItemType Junction -Target \"$persist_dir\" | Out-Null"
]
},
"pre_uninstall": [
"if (!(is_admin)) { error \"$app requires admin rights to $cmd\"; break }",
"Start-Process \"$dir\\resources\\uninstall-service.exe\" -Wait -Verb 'RunAs' -WindowStyle 'Hidden'; Start-Sleep -Seconds 3"
],
"uninstaller": {
"script": "Remove-Item \"$env:USERPROFILE\\.config\\clash-verge\" -Recurse -Force -ErrorAction 'SilentlyContinue'"
"script": "Remove-Item \"$env:APPDATA\\io.github.clash-verge-rev.clash-verge-rev\" -Recurse -Force -ErrorAction 'SilentlyContinue'"
},
"shortcuts": [
[
Expand Down

0 comments on commit 09be3ac

Please sign in to comment.