2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Check action type before launching new version

This commit is contained in:
Ilya Fedin
2021-05-03 15:48:31 +04:00
committed by John Preston
parent 68dc00be27
commit 9a857659ce

View File

@@ -83,7 +83,7 @@ bool Launcher::launchUpdater(UpdaterLaunch action) {
: (cExeDir() + qsl("Updater")));
auto argumentsList = Arguments();
if (action != UpdaterLaunch::JustRelaunch && cWriteProtected()) {
if (action == UpdaterLaunch::PerformUpdate && cWriteProtected()) {
argumentsList.push("pkexec");
}
argumentsList.push(QFile::encodeName(binaryPath));
@@ -141,7 +141,7 @@ bool Launcher::launchUpdater(UpdaterLaunch action) {
}
// pkexec needs an alive parent
if (cWriteProtected()) {
if (action == UpdaterLaunch::PerformUpdate && cWriteProtected()) {
waitpid(pid, nullptr, 0);
// launch new version in the same environment
return launchUpdater(UpdaterLaunch::JustRelaunch);