From c85e418afac88c7d455b4be9e64c2b1a18c9f9eb Mon Sep 17 00:00:00 2001 From: Yurun Date: Mon, 23 Aug 2021 08:46:31 +0800 Subject: [PATCH] Fix autorun --- v2rayN/v2rayN/Tool/Utils.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2rayN/v2rayN/Tool/Utils.cs b/v2rayN/v2rayN/Tool/Utils.cs index 522db7c8..79a42f70 100644 --- a/v2rayN/v2rayN/Tool/Utils.cs +++ b/v2rayN/v2rayN/Tool/Utils.cs @@ -536,7 +536,7 @@ namespace v2rayN try { string exePath = GetExePath(); - RegWriteValue(autoRunRegPath, autoRunName, run ? exePath : ""); + RegWriteValue(autoRunRegPath, autoRunName, run ? ("\"" + exePath + "\"") : ""); } catch { @@ -553,7 +553,7 @@ namespace v2rayN { string value = RegReadValue(autoRunRegPath, autoRunName, ""); string exePath = GetExePath(); - if (value?.Equals(exePath) == true) + if (value?.Equals(exePath) == true || value?.Equals("\"" + exePath + "\"") == true) { return true; }