mirror of https://github.com/2dust/v2rayN
Fix startup issues
parent
fd6fa1c622
commit
1c95c5861c
|
@ -597,13 +597,21 @@ namespace v2rayN
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string exePath = GetExePath();
|
var autoRunName = $"{Global.AutoRunName}_{GetMD5(StartupPath())}";
|
||||||
RegWriteValue(Global.AutoRunRegPath, Global.AutoRunName, run ? $"\"{exePath}\"" : "");
|
|
||||||
|
//delete first
|
||||||
|
RegWriteValue(Global.AutoRunRegPath, autoRunName, "");
|
||||||
|
|
||||||
|
if (run)
|
||||||
|
{
|
||||||
|
string exePath = $"\"{GetExePath()}\"";
|
||||||
|
RegWriteValue(Global.AutoRunRegPath, autoRunName, exePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
SaveLog(ex.Message, ex);
|
SaveLog(ex.Message, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -125,7 +125,7 @@ namespace v2rayN.ViewModels
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region UI
|
#region UI
|
||||||
AutoRun = Utils.IsAutoRun();
|
AutoRun = _config.autoRun;
|
||||||
EnableStatistics = _config.enableStatistics;
|
EnableStatistics = _config.enableStatistics;
|
||||||
StatisticsFreshRate = _config.statisticsFreshRate;
|
StatisticsFreshRate = _config.statisticsFreshRate;
|
||||||
KeepOlderDedupl = _config.keepOlderDedupl;
|
KeepOlderDedupl = _config.keepOlderDedupl;
|
||||||
|
@ -282,6 +282,7 @@ namespace v2rayN.ViewModels
|
||||||
|
|
||||||
//UI
|
//UI
|
||||||
Utils.SetAutoRun(AutoRun);
|
Utils.SetAutoRun(AutoRun);
|
||||||
|
_config.autoRun = AutoRun;
|
||||||
_config.enableStatistics = EnableStatistics;
|
_config.enableStatistics = EnableStatistics;
|
||||||
_config.statisticsFreshRate = StatisticsFreshRate;
|
_config.statisticsFreshRate = StatisticsFreshRate;
|
||||||
if (_config.statisticsFreshRate > 100 || _config.statisticsFreshRate < 1)
|
if (_config.statisticsFreshRate > 100 || _config.statisticsFreshRate < 1)
|
||||||
|
|
Loading…
Reference in New Issue