Mercurial > trustbridge
comparison 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 |
comparison
equal
deleted
inserted
replaced
1364:28885e8c891f | 1365:3d7ddf698480 |
---|---|
72 } | 72 } |
73 | 73 |
74 | 74 |
75 int main(int argc, char **argv) | 75 int main(int argc, char **argv) |
76 { | 76 { |
77 time_t signed_time = 0; | |
77 #ifdef WIN32 | 78 #ifdef WIN32 |
78 /* First verify integrity even before calling QApplication. | 79 /* First verify integrity even before calling QApplication. |
79 * We only do this on Windows as we have a PKCS#7 embedded | 80 * We only do this on Windows as we have a PKCS#7 embedded |
80 * signature there which we check with OS methods. | 81 * signature there which we check with OS methods. |
81 * | 82 * |
82 * On GNU/Linux platforms you should use an IDS system to | 83 * On GNU/Linux platforms you should use an IDS system to |
83 * monitor executable corruptions. | 84 * monitor executable corruptions. |
84 */ | 85 */ |
85 if (!selftest()) { | 86 if (!selftest(&signed_time)) { |
86 syslog_error_printf("Integrity check failed."); | 87 syslog_error_printf("Integrity check failed."); |
87 MessageBoxW(NULL, | 88 MessageBoxW(NULL, |
88 L"TrustBridge wurde nach der Installation modifizert.\n" | 89 L"TrustBridge wurde nach der Installation modifizert.\n" |
89 L"Um ihr System zu schützen wurde das Starten der Anwendung abgebrochen.\n" | 90 L"Um ihr System zu schützen wurde das Starten der Anwendung abgebrochen.\n" |
90 L"Bitte installieren Sie TrustBridge erneut.\n\n" | 91 L"Bitte installieren Sie TrustBridge erneut.\n\n" |
186 QFont font("DejaVuSans"); | 187 QFont font("DejaVuSans"); |
187 font.setPointSize(9); | 188 font.setPointSize(9); |
188 app.setFont(font); | 189 app.setFont(font); |
189 } | 190 } |
190 | 191 |
192 if (signed_time != 0 && signed_time != -1) { | |
193 QDateTime sigTime = QDateTime::fromTime_t(signed_time); | |
194 QSettings settigs; | |
195 settings.setValue("Software/currentSigDt", sigTime); | |
196 } | |
197 | |
191 MainWindow mainWin(trayMode); | 198 MainWindow mainWin(trayMode); |
192 | 199 |
193 return app.exec(); | 200 return app.exec(); |
194 } | 201 } |