Try to de-elevate after applying an update to not run UI as admin

This commit is contained in:
baldurk
2025-07-31 17:10:14 +01:00
parent e6a7b36cdc
commit 9bfcb76e0b
2 changed files with 122 additions and 4 deletions
+15
View File
@@ -361,6 +361,10 @@ int main(int argc, char *argv[])
hideOption(updateFailed);
parser.addOption(updateFailed);
QCommandLineOption updateDoneAdmin(lit("updatedone_admin"));
hideOption(updateDoneAdmin);
parser.addOption(updateDoneAdmin);
QCommandLineOption updateDone(lit("updatedone"));
hideOption(updateDone);
parser.addOption(updateDone);
@@ -413,11 +417,22 @@ int main(int argc, char *argv[])
if(parser.isSet(updateDone))
{
qInfo() << "Finishing update as user";
updateApplied = true;
// the renderdoccmd updater that runs us is from the old version, so older versions might be
// running us as admin expecting the version number to be updated.
// if we're not running as admin, this will immediately exit
RENDERDOC_UpdateInstalledVersionNumber();
}
if(parser.isSet(updateDoneAdmin))
{
qInfo() << "Finishing update as admin";
RENDERDOC_UpdateInstalledVersionNumber();
return 0;
}
QString remoteHost;
uint remoteIdent = 0;