private void cmdUpdate_Click(object sender, EventArgs e)
        {
            String filename = txtFile.Text;

            if (filename != "")
            {
                if (ME7ChecksumUpdater.Checksum_Volvo_ME7(filename, true))
                {
                    MessageBox.Show("Checksums Verified OK!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    if (MessageBox.Show("Checksums Incorrect! Update?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
                    {
                        bool retval = ME7ChecksumUpdater.Checksum_Volvo_ME7(filename, false);
                        if (retval)
                        {
                            MessageBox.Show("Checksums updated successfully!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("Checksums failed to update!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
        }
Beispiel #2
0
 private bool updateChecksums()
 {
     if (Directory.Exists(updateDirectory))
     {
         foreach (string file in Directory.GetFiles(updateDirectory))
         {
             try
             {
                 ME7ChecksumUpdater.updateChecksums(file);
             }
             catch (Exception e)
             {
                 e.ToString();
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }