From 16238bef2ec090e88151557ae649c93be919f568 Mon Sep 17 00:00:00 2001 From: Issac Lin Date: Mon, 13 Dec 2021 23:19:38 +0800 Subject: [PATCH] v2ray: Fix issue in 'path with space' (#3079) * v2ray: Fix issue in 'path with space' * update comment --- bucket/v2ray.json | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bucket/v2ray.json b/bucket/v2ray.json index 9050b3f350..cd3c2b8646 100644 --- a/bucket/v2ray.json +++ b/bucket/v2ray.json @@ -15,13 +15,16 @@ }, "installer": { "script": [ + "#v2ctl.exe cannot recognize signature file when there are spaces in path. This is a workaround to eliminate spaces.", "Write-Host 'Verifying V2Ray binary...' -f Yellow", - "$sig = \"$dir\\Release\"", - "Invoke-WebRequest \"https://github.com/v2fly/v2ray-core/releases/download/v$version/Release\" -OutFile $sig", - "if (!(Invoke-Expression \"$dir\\v2ctl.exe verify --sig=$sig $dir\\v2ray.exe\" | Select-String 'OK')) {", + "$sig_dir = \"$Env:SystemRoot\\Temp\\v2ray\"", + "ensure $sig_dir | Out-Null", + "Invoke-WebRequest \"https://github.com/v2fly/v2ray-core/releases/download/v$version/Release\" -OutFile $sig_dir\\Release", + "if (!(Invoke-Expression \"&`\"$dir\\v2ctl.exe`\" verify --sig=$sig_dir\\Release `\"$dir\\v2ray.exe`\"\" | Select-String 'OK')) {", " Write-Host 'V2Ray binary is corrupted!' -f Red", - " exit 1", - "}" + " break", + "}", + "Remove-Item $sig_dir -Force -Recurse | Out-Null" ] }, "bin": [