# HG changeset patch # User Andre Heinecke # Date 1397576886 -7200 # Node ID 72487438a18017978dbce6b43fc9140383c7faa6 # Parent 638db75f0fdf2dca051170b146ee156cf1c0d776 More user visible errors. Correct parameters for installation. diff -r 638db75f0fdf -r 72487438a180 ui/installwrapper.cpp --- a/ui/installwrapper.cpp Tue Apr 15 17:47:33 2014 +0200 +++ b/ui/installwrapper.cpp Tue Apr 15 17:48:06 2014 +0200 @@ -69,9 +69,6 @@ return; } - QString parameters = "\"list=" + mCertListFile + - "\" \"choices=" + choicesFile.fileName() + "\""; - #ifdef WIN32 /* QProcess on Windows uses CreateProcess but we have to * use the runas shell command to get the UAC prompt if necessary. @@ -85,6 +82,10 @@ memset (&shExecInfo, 0, sizeof(SHELLEXECUTEINFOW)); + /* Windows needs each parameter packed in " */ + QString parameters = "\"list=" + mCertListFile + + "\" \"choices=" + choicesFile.fileName() + "\""; + shExecInfo.cbSize = sizeof(SHELLEXECUTEINFOW); shExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; shExecInfo.lpVerb = L"runas"; @@ -136,8 +137,17 @@ #else /* WIN32 */ QProcess installerProcess; installerProcess.setProgram(cinstProcInfo.absoluteFilePath()); - installerProcess.waitForStarted(); - if (installerProcess.state() == QProcess::NotRunning) { + QStringList parameters; + + choicesFile.setAutoRemove(false); + parameters << "list=" + mCertListFile << "choices=" + choicesFile.fileName(); + installerProcess.setArguments(parameters); + + + qDebug() << "Starting process " << cinstFileName <<" params: " << parameters; + installerProcess.start(); + if (!installerProcess.waitForStarted() || + installerProcess.state() == QProcess::NotRunning) { emit error (tr("Failed to start installer process.")); return; } @@ -146,11 +156,12 @@ if (installerProcess.exitStatus() == QProcess::CrashExit) { /* Woops */ - qWarning() << "Installer process crashed"; + emit error (tr("Failed to complete installation.")); + return; } else if (installerProcess.exitStatus() != QProcess::NormalExit) { /* Can not Happen. there are only those two values but maybe * qt changed.. */ - qWarning() << "Exit status neither normal nor crash."; + emit error (tr("Failed to complete installation.")); return; }