diff ui/mainwindow.cpp @ 555:4cc378f335f5

Use native path to execute software update on windows This still does not work and always returns access denied on execution
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 22 May 2014 08:52:10 +0000
parents d512d8eef8f6
children aee3eb10bbba
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Thu May 22 08:51:12 2014 +0000
+++ b/ui/mainwindow.cpp	Thu May 22 08:52:10 2014 +0000
@@ -183,7 +183,7 @@
 }
 
 void MainWindow::handleNewSW(const QString& fileName, const QDateTime& modDate) {
-    mCurMessage = tr("<h3>An update for %1 is available.</h3>\n"
+    mCurMessage = tr("An update for %1 is available.\n"
             "Click here to download and install the update.").arg(
                 QApplication::applicationName());
     setState(NewSoftwareAvailable);
@@ -203,7 +203,8 @@
     }
 #ifdef WIN32
     SHELLEXECUTEINFOW shExecInfo;
-    shExecInfo.lpFile = reinterpret_cast<LPCWSTR> (fileName.utf16());
+    shExecInfo.lpFile = reinterpret_cast<LPCWSTR> (
+            QDir::toNativeSeparators(instProcInfo.absoluteFilePath()).utf16());
 
     if (!is_admin()) {
         shExecInfo.lpVerb = L"open";
@@ -211,7 +212,8 @@
         shExecInfo.lpVerb = L"runas";
     }
 
-    qDebug() << "Starting process " << fileName;
+    qDebug() << "Admin? " << is_admin();
+    qDebug() << "Starting processs: " << QDir::toNativeSeparators(instProcInfo.absoluteFilePath());
 
     if (!ShellExecuteExW(&shExecInfo)) {
         /* Execution failed, maybe the user aborted the UAC check? */

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