comparison ui/listupdatedialog.cpp @ 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 6090e673c707
children 95d35ec93bbe
comparison
equal deleted inserted replaced
126:898446d9d23e 127:04dcc0fb1eca
1 #include "listupdatedialog.h" 1 #include "listupdatedialog.h"
2 #include <QCoreApplication>
2 #include <QDebug> 3 #include <QDebug>
4 #include <QDir>
5 #include <QFileInfo>
3 #include <QProcess> 6 #include <QProcess>
4 #include <QPushButton> 7 #include <QPushButton>
5 #include <QGroupBox> 8 #include <QGroupBox>
6 #include <QHBoxLayout> 9 #include <QHBoxLayout>
7 #include <QListWidget> 10 #include <QListWidget>
78 } 81 }
79 82
80 void ListUpdateDialog::executeUpdate() { 83 void ListUpdateDialog::executeUpdate() {
81 /* TODO move this in another dialog and call it async*/ 84 /* TODO move this in another dialog and call it async*/
82 QProcess installerProcess; 85 QProcess installerProcess;
86 QFileInfo fi(QCoreApplication::applicationFilePath());
87 QDir myDir = fi.absoluteDir();
88 QString instProcName = "cinst";
89 if (!fi.suffix().isEmpty()) {
90 instProcName += "." + fi.suffix();
91 }
92 QString instPath = myDir.absoluteFilePath(instProcName);
83 93
84 installerProcess.setProgram("../cinst/cinst"); 94 installerProcess.setProgram(instPath);
85 installerProcess.start(); 95 installerProcess.start();
86 installerProcess.waitForStarted(); 96 installerProcess.waitForStarted();
87 if (installerProcess.state() == QProcess::NotRunning) { 97 if (installerProcess.state() == QProcess::NotRunning) {
88 qWarning() << "Failed to start installer Process."; 98 qWarning() << "Failed to start installer Process.";
89 /* TODO ERROR message for the user */ 99 /* TODO ERROR message for the user */

http://wald.intevation.org/projects/trustbridge/