Mercurial > trustbridge > trustbridge
diff ui/main.cpp @ 1365:3d7ddf698480
(issue177) Only install updates with a newer signature on windows
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 21 Nov 2014 18:33:58 +0100 |
parents | 12ed0b72e9f5 |
children | 23df332b2a4c |
line wrap: on
line diff
--- a/ui/main.cpp Fri Nov 21 18:33:31 2014 +0100 +++ b/ui/main.cpp Fri Nov 21 18:33:58 2014 +0100 @@ -74,6 +74,7 @@ int main(int argc, char **argv) { + time_t signed_time = 0; #ifdef WIN32 /* First verify integrity even before calling QApplication. * We only do this on Windows as we have a PKCS#7 embedded @@ -82,7 +83,7 @@ * On GNU/Linux platforms you should use an IDS system to * monitor executable corruptions. */ - if (!selftest()) { + if (!selftest(&signed_time)) { syslog_error_printf("Integrity check failed."); MessageBoxW(NULL, L"TrustBridge wurde nach der Installation modifizert.\n" @@ -188,6 +189,12 @@ app.setFont(font); } + if (signed_time != 0 && signed_time != -1) { + QDateTime sigTime = QDateTime::fromTime_t(signed_time); + QSettings settigs; + settings.setValue("Software/currentSigDt", sigTime); + } + MainWindow mainWin(trayMode); return app.exec();