From b2eecef8b2e8d156bd24400787614e8a215af0ae Mon Sep 17 00:00:00 2001 From: OxO Date: Tue, 10 Dec 2024 02:04:23 +0800 Subject: [PATCH 1/2] clash-verge-rev: Fix config dir --- bucket/clash-verge-rev.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bucket/clash-verge-rev.json b/bucket/clash-verge-rev.json index 06b7da88e0d7d2..9b1c325fad14f0 100644 --- a/bucket/clash-verge-rev.json +++ b/bucket/clash-verge-rev.json @@ -17,7 +17,7 @@ "installer": { "script": [ "ensure \"$persist_dir\" | Out-Null", - "New-Item \"$env:USERPROFILE\\.config\\clash-verge\" -ItemType Junction -Target \"$persist_dir\" | Out-Null" + "New-Item \"$env:APPDATA\\io.github.clash-verge-rev.clash-verge-rev\" -ItemType Junction -Target \"$persist_dir\" | Out-Null" ] }, "pre_uninstall": [ @@ -25,7 +25,7 @@ "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": [ [ From 9d018c71fdbc7a61fb51dc3acb4f5937a0b19f05 Mon Sep 17 00:00:00 2001 From: OxO Date: Fri, 13 Dec 2024 21:40:38 +0800 Subject: [PATCH 2/2] clash-verge-rev: improve directory handling during installation --- bucket/clash-verge-rev.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bucket/clash-verge-rev.json b/bucket/clash-verge-rev.json index 9b1c325fad14f0..0b03129aedcd47 100644 --- a/bucket/clash-verge-rev.json +++ b/bucket/clash-verge-rev.json @@ -17,6 +17,16 @@ "installer": { "script": [ "ensure \"$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" ] },