Skip to content

Commit 61e02e9

Browse files
committed
Updates
1 parent 75ca113 commit 61e02e9

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/SignToolGUI/Forms/MainForm.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,10 @@ private void PopulateComboBox()
338338

339339
private void AddTimestampProvider(string displayName, string url)
340340
{
341+
// Check if the item is not already in the ComboBox and add it if it is not
341342
if (comboBoxTimestampProviders.Items.Cast<TimestampProvider>().All(item => item.DisplayName != displayName))
342343
{
344+
// Add the item to the ComboBox
343345
comboBoxTimestampProviders.Items.Add(new TimestampProvider(displayName, url));
344346
}
345347
}
@@ -389,6 +391,7 @@ private void InterfaceCheck()
389391
// Log the interface start message
390392
Message("Interface check for set certificate type started...", EventType.Information, 1016);
391393

394+
// Check the radio buttons for the certificate type
392395
try
393396
{
394397
if (radioButtonWindowsCertificateStore.Checked)
@@ -416,13 +419,13 @@ private void InterfaceCheck()
416419
Message("Set certificate type to Trusted Signing", EventType.Information, 1019);
417420
}
418421

422+
// Enable or disable the group boxes based on the radio button selection
419423
groupBoxWindowsCertificateStore.Enabled = radioButtonWindowsCertificateStore.Checked;
420424
groupBoxPFXCertificate.Enabled = radioButtonPFXCertificate.Checked;
421425
groupBoxTrustedSigningMetadata.Enabled = radioButtonTrustedSigning.Checked;
422426
}
423427
catch (Exception ex)
424428
{
425-
// ignored
426429
// Log the interface check message if error details
427430
Message("Interface check for set certificate type failed: " + ex.Message, EventType.Error, 1017);
428431
}
@@ -442,7 +445,7 @@ private void RadioButtonSelectCertificateLocation_CheckedChanged(object sender,
442445
_previousSignToolPath = textBoxSignToolPath.Text;
443446

444447
// Update SignToolExe and textBoxSignToolPath to the local signtool.exe path
445-
string localSignToolPath = Path.Combine(Application.StartupPath, "Tools", "signtool.exe");
448+
var localSignToolPath = Path.Combine(Application.StartupPath, "Tools", "signtool.exe");
446449

447450
// Log the local signtool.exe path for Trusted Signing
448451
Message("Local signtool.exe path set for Trusted Signing: '" + localSignToolPath + "'", EventType.Information, 1019);
@@ -534,6 +537,10 @@ private void RadioButtonSelectCertificateLocation_CheckedChanged(object sender,
534537
}
535538
catch (Exception ex)
536539
{
540+
// Log the interface check error message
541+
Message("Interface check for certificate type failed: " + ex.Message, EventType.Error, 1053);
542+
543+
// Show an error message if the interface check failed
537544
MessageBox.Show(ex.Message, Globals.MsgBox.Error, MessageBoxButtons.OK, MessageBoxIcon.Hand);
538545
}
539546
}

0 commit comments

Comments
 (0)