summaryrefslogtreecommitdiffstats
path: root/MultiMC.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-28 22:32:45 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-28 22:32:45 +0100
commitc816a26647ca0537709f0d15cdd550feea4de109 (patch)
tree53a8f0715a60c7f0e4ca64b85b3ccf8eb1016297 /MultiMC.cpp
parent595e4b697e911e2ed036446dd624dca77e234944 (diff)
downloadMultiMC-c816a26647ca0537709f0d15cdd550feea4de109.tar
MultiMC-c816a26647ca0537709f0d15cdd550feea4de109.tar.gz
MultiMC-c816a26647ca0537709f0d15cdd550feea4de109.tar.lz
MultiMC-c816a26647ca0537709f0d15cdd550feea4de109.tar.xz
MultiMC-c816a26647ca0537709f0d15cdd550feea4de109.zip
Set permissions for the updater binary after updating it.
Diffstat (limited to 'MultiMC.cpp')
-rw-r--r--MultiMC.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp
index 110accc2..cf626fc7 100644
--- a/MultiMC.cpp
+++ b/MultiMC.cpp
@@ -528,7 +528,12 @@ void MultiMC::installUpdates(const QString &updateFilesDir, bool restartOnFinish
QLOG_INFO() << "Running updater with command" << updaterBinary << args.join(" ");
- QProcess::startDetached(updaterBinary, args);
+ QFile::setPermissions(updaterBinary, (QFileDevice::Permission) 0755);
+ if(!QProcess::startDetached(updaterBinary, args))
+ {
+ QLOG_ERROR() << "Failed to start the updater process!";
+ return;
+ }
// Now that we've started the updater, quit MultiMC.
MMC->quit();