mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-28 19:40:54 +00:00
Check action type before launching new version
This commit is contained in:
parent
68dc00be27
commit
9a857659ce
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user