Exemple #1
0
        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);
        }
Exemple #2
0
        public void CheckVersion(string path)
        {
            var md5 = MiscUtils.ComputeMd5(path);

            SelectedVersion = KnownVersions.FirstOrDefault(x => x.Md5 == md5);
        }