private void PerformStart() { if (SafeFile.Exists(firmwareVersionModel.ExistingFirmwarePath) && MiscUtils.ComputeMD5(firmwareVersionModel.ExistingFirmwarePath) == firmwareVersionModel.CorrectFirmwareMD5) { LogUtil.LogEvent("Original firmware found on disk"); SafeFile.Copy(firmwareVersionModel.ExistingFirmwarePath, Path.Combine(MiscUtils.WORKING_FOLDER, MiscUtils.DOWNLOADED_FILE_PATH), true); if (DownloadCompleted != null) { DownloadCompleted(this, EventArgs.Empty); } return; } LogUtil.LogEvent("Starting download"); webClient.DownloadFileAsync(new Uri(firmwareVersionModel.DownloadUri), fileName); }
public void CheckVersion(string path) { var md5 = MiscUtils.ComputeMD5(path); SelectedVersion = KnownVersions.FirstOrDefault(x => x.MD5 == md5); }