comparison ui/mainwindow.cpp @ 592:778f74d0706f

Verify the binary directly without relying on settings (which might differ)
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 28 May 2014 08:36:05 +0000
parents 26a18e3c3db4
children c944de9900de
comparison
equal deleted inserted replaced
591:26a18e3c3db4 592:778f74d0706f
231 showMessage(); 231 showMessage();
232 } 232 }
233 233
234 void MainWindow::installNewSW(const QString& fileName, const QDateTime& modDate) { 234 void MainWindow::installNewSW(const QString& fileName, const QDateTime& modDate) {
235 QFileInfo instProcInfo = QFileInfo(fileName); 235 QFileInfo instProcInfo = QFileInfo(fileName);
236 verifySWData();
237 QString filePath = QDir::toNativeSeparators(instProcInfo.absoluteFilePath()); 236 QString filePath = QDir::toNativeSeparators(instProcInfo.absoluteFilePath());
237
238 if (verify_binary(filePath.toUtf8().constData(),
239 filePath.toUtf8().size()) != VerifyValid) {
240 qDebug() << "Invalid software. Not installing";
241 return;
242 }
243 QFileInfo fi(QCoreApplication::applicationFilePath());
244 QDir installDir = fi.absoluteDir();
245
238 #ifdef WIN32 246 #ifdef WIN32
239 SHELLEXECUTEINFOW shExecInfo; 247 SHELLEXECUTEINFOW shExecInfo;
240 memset (&shExecInfo, 0, sizeof(SHELLEXECUTEINFOW)); 248 memset (&shExecInfo, 0, sizeof(SHELLEXECUTEINFOW));
241 shExecInfo.cbSize = sizeof(SHELLEXECUTEINFOW); 249 shExecInfo.cbSize = sizeof(SHELLEXECUTEINFOW);
242 250

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