Release KSwitcher v0.6.73 with autostart path repair
This commit is contained in:
1 parent
3117b2d9c8
commit
3bcbfeee15
13 files changed
+265
-63
No files matched your search
+12
-1
@@ -15,13 +15,24 @@ bool shouldElevateOnLaunch()
|
||||
try
|
||||
{
|
||||
auto settings = ks::loadSettings(ks::dataDirectory() / L"settings.json", {});
|
||||
return settings.autostart && settings.elevatedAutostart;
|
||||
if (!settings.autostart || !settings.elevatedAutostart)
|
||||
return false;
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
// The normal startup path handles unreadable settings and reports them.
|
||||
return false;
|
||||
}
|
||||
try
|
||||
{
|
||||
// Let the resident explain the stale path before asking to elevate the repair.
|
||||
return ks::staleAutostartPath(true).empty();
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
// The elevated resident can retry reading the task.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user