Mercurial > trustbridge
changeset 127:04dcc0fb1eca
Set cinst process path to be the directory of the executable running
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 24 Mar 2014 10:16:16 +0000 |
parents | 898446d9d23e |
children | 95d35ec93bbe |
files | ui/listupdatedialog.cpp |
diffstat | 1 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ui/listupdatedialog.cpp Mon Mar 24 10:13:55 2014 +0000 +++ b/ui/listupdatedialog.cpp Mon Mar 24 10:16:16 2014 +0000 @@ -1,5 +1,8 @@ #include "listupdatedialog.h" +#include <QCoreApplication> #include <QDebug> +#include <QDir> +#include <QFileInfo> #include <QProcess> #include <QPushButton> #include <QGroupBox> @@ -80,8 +83,15 @@ void ListUpdateDialog::executeUpdate() { /* TODO move this in another dialog and call it async*/ QProcess installerProcess; + QFileInfo fi(QCoreApplication::applicationFilePath()); + QDir myDir = fi.absoluteDir(); + QString instProcName = "cinst"; + if (!fi.suffix().isEmpty()) { + instProcName += "." + fi.suffix(); + } + QString instPath = myDir.absoluteFilePath(instProcName); - installerProcess.setProgram("../cinst/cinst"); + installerProcess.setProgram(instPath); installerProcess.start(); installerProcess.waitForStarted(); if (installerProcess.state() == QProcess::NotRunning) {