summaryrefslogtreecommitdiff
path: root/src/selfupdater.cpp
diff options
context:
space:
mode:
authorSilarn <jrim@rimpo.org>2019-07-22 01:00:42 -0500
committerSilarn <jrim@rimpo.org>2019-07-22 01:00:42 -0500
commitdcd6d624672019727d7effd17aac86f72bff438b (patch)
tree1e8d3856f657d898c5992631599cf272d785f973 /src/selfupdater.cpp
parent179a73857125ee604f42b0d5c2d765183c86d2c7 (diff)
parente73c309f08eff98f0dbd2590f594a83b67431eac (diff)
Merge branch 'Develop'
Diffstat (limited to 'src/selfupdater.cpp')
-rw-r--r--src/selfupdater.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/selfupdater.cpp b/src/selfupdater.cpp
index 4c0f9a8d..271c621b 100644
--- a/src/selfupdater.cpp
+++ b/src/selfupdater.cpp
@@ -31,6 +31,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "settings.h"
#include "bbcode.h"
#include "plugincontainer.h"
+#include "organizercore.h"
#include <versioninfo.h>
#include <report.h>
#include <util.h>
@@ -178,7 +179,7 @@ void SelfUpdater::startUpdate()
tr("New update available (%1)")
.arg(m_UpdateCandidate["tag_name"].toString()), tr("Do you want to install update? All your mods and setup will be left untouched.\nSelect Show Details option to see the full change-log."),
QMessageBox::Yes | QMessageBox::Cancel, m_Parent);
-
+
query.setDetailedText(m_UpdateCandidate["body"].toString());
query.button(QMessageBox::Yes)->setText(tr("Install"));
@@ -329,22 +330,14 @@ void SelfUpdater::downloadCancel()
void SelfUpdater::installUpdate()
{
- const QString mopath
- = QDir::fromNativeSeparators(qApp->property("dataPath").toString());
-
- std::wstring parameters = ToWString("/DIR=\"" + qApp->applicationDirPath() + "\" ");
+ const QString parameters = "/DIR=\"" + qApp->applicationDirPath() + "\" ";
- HINSTANCE res = ::ShellExecuteW(
- nullptr, L"open", m_UpdateFile.fileName().toStdWString().c_str(), parameters.c_str(),
- nullptr, SW_SHOW);
-
- if (res > (HINSTANCE)32) {
+ if (shell::Execute(m_UpdateFile.fileName(), parameters)) {
QCoreApplication::quit();
} else {
- reportError(tr("Failed to start %1: %2")
- .arg(m_UpdateFile.fileName())
- .arg((INT_PTR)res));
+ reportError(tr("Failed to start %1").arg(m_UpdateFile.fileName()));
}
+
m_UpdateFile.remove();
}