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); }