|
11 | 11 | //
|
12 | 12 | ////////////////////////////////////////////////////////////////////////////
|
13 | 13 |
|
14 |
| -#define ONBOARDING |
15 | 14 | //#define ENABLE_DIGITAL_VERIFICATION
|
16 | 15 |
|
17 | 16 | using ACAT.ACATResources;
|
@@ -54,7 +53,7 @@ public static void Main(String[] args)
|
54 | 53 | Application.EnableVisualStyles();
|
55 | 54 | Application.SetCompatibleTextRenderingDefault(false);
|
56 | 55 |
|
57 |
| - if (!validateACATCoreLibraryCertificates()) |
| 56 | + if (!validateACATCoreLibraryCertificates() || !validateConvAssistCertificate() || !validateACATWatchCertificate()) |
58 | 57 | {
|
59 | 58 | MessageBox.Show("Please reinstall ACAT and retry", "ACAT", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
60 | 59 | return;
|
@@ -110,21 +109,12 @@ public static void Main(String[] args)
|
110 | 109 |
|
111 | 110 | Common.AppPreferences.PreferredPanelConfigNames = String.Empty;
|
112 | 111 |
|
113 |
| - // to enable onboarding, uncomment the #define ONBOARDING at the top of the file |
114 |
| - // to enable BCI, comment out the #define ONBOARDING statement and uncomment #define BCI |
115 |
| -#if ONBOARDING |
116 | 112 |
|
117 | 113 | if (!doOnboarding())
|
118 | 114 | {
|
119 | 115 | return;
|
120 | 116 | }
|
121 | 117 |
|
122 |
| -#elif BCI |
123 |
| - Common.AppPreferences.PreferredPanelConfigNames = "TalkApplicationBCIScannerABC"; |
124 |
| -#else |
125 |
| - Common.AppPreferences.PreferredPanelConfigNames = "TalkApplicationAbc"; |
126 |
| -#endif |
127 |
| - |
128 | 118 | Splash splash = new Splash(2000);
|
129 | 119 | splash.Show();
|
130 | 120 |
|
@@ -289,16 +279,50 @@ private static bool validateACATCoreLibraryCertificates()
|
289 | 279 | #endif
|
290 | 280 | }
|
291 | 281 |
|
| 282 | + private static bool validateConvAssistCertificate() |
| 283 | + { |
| 284 | +#if ENABLE_DIGITAL_VERIFICATION |
| 285 | + |
| 286 | + var appPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); |
| 287 | + var convAssistPath = Path.Combine(appPath, "ConvAssistApp", "ConvAssist.exe"); |
| 288 | + if (!validateCertificate(convAssistPath)) |
| 289 | + { |
| 290 | + return false; |
| 291 | + } |
| 292 | + |
| 293 | + return true; |
| 294 | +#else |
| 295 | + return true; |
| 296 | +#endif |
| 297 | + } |
| 298 | + |
| 299 | + private static bool validateACATWatchCertificate() |
| 300 | + { |
| 301 | +#if ENABLE_DIGITAL_VERIFICATION |
| 302 | + |
| 303 | + var appPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); |
| 304 | + var acatWatchPath = Path.Combine(appPath, "ACATWatch.exe"); |
| 305 | + if (!validateCertificate(acatWatchPath)) |
| 306 | + { |
| 307 | + return false; |
| 308 | + } |
| 309 | + |
| 310 | + return true; |
| 311 | +#else |
| 312 | + return true; |
| 313 | +#endif |
| 314 | + } |
| 315 | + |
292 | 316 | #if ENABLE_DIGITAL_VERIFICATION
|
293 |
| - private static bool validateCertificate(String dllPath) |
| 317 | + private static bool validateCertificate(String filePath) |
294 | 318 | {
|
295 | 319 | try
|
296 | 320 | {
|
297 |
| - Verify(dllPath); |
| 321 | + Verify(filePath); |
298 | 322 | }
|
299 | 323 | catch (Exception ex)
|
300 | 324 | {
|
301 |
| - MessageBox.Show("Digital signature verification failed for the following DLL.\n\n" + dllPath + "\n\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); |
| 325 | + MessageBox.Show("Digital signature verification failed for the following file.\n\n" + filePath + "\n\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); |
302 | 326 | return false;
|
303 | 327 | }
|
304 | 328 |
|
|
0 commit comments