Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Mar 30, 2024
1 parent edbc850 commit 13bc2d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions v2rayN/v2rayN/Common/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1029,14 +1029,14 @@ public static void SetAutoRun(string AutoRunRegPath, string AutoRunName, bool ru

if (run)
{
string exePath = $"\"{GetExePath()}\"";
string exePath = GetExePath();
if (IsAdministrator())
{
AutoStart(autoRunName, exePath, "");
}
else
{
RegWriteValue(AutoRunRegPath, autoRunName, exePath);
RegWriteValue(AutoRunRegPath, autoRunName, exePath.AppendQuotes());
}
}
}
Expand Down Expand Up @@ -1136,7 +1136,7 @@ public static void AutoStart(string taskName, string fileName, string descriptio
task.Settings.ExecutionTimeLimit = TimeSpan.Zero;
task.Triggers.Add(new LogonTrigger { UserId = logonUser, Delay = TimeSpan.FromSeconds(10) });
task.Principal.RunLevel = TaskRunLevel.Highest;
task.Actions.Add(new ExecAction(deamonFileName, null, Path.GetDirectoryName(deamonFileName)));
task.Actions.Add(new ExecAction(deamonFileName.AppendQuotes(), null, Path.GetDirectoryName(deamonFileName)));

taskService.RootFolder.RegisterTaskDefinition(TaskName, task);
}
Expand Down

0 comments on commit 13bc2d0

Please sign in to comment.