private void DownloadedUnzippedComplete() { if (Application.OptionsSettings.AutoApplyUpdates == true) { BeginUpdateProcess(Application); } else { if (DownloadUnzipComplete != null) { FrostbiteConnection.RaiseEvent(DownloadUnzipComplete.GetInvocationList()); } } }
private void cdfPRoConUpdate_DownloadComplete(CDownloadFile sender) { if (String.Compare(MD5Data(sender.CompleteFileData), (string)sender.AdditionalData, StringComparison.OrdinalIgnoreCase) == 0) { string updatesFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, UpdatesDirectoryName); try { if (Directory.Exists(updatesFolder) == false) { Directory.CreateDirectory(updatesFolder); } using (ZipFile zip = ZipFile.Read(sender.CompleteFileData)) { zip.ExtractAll(updatesFolder, ExtractExistingFileAction.OverwriteSilently); } if (DownloadUnzipComplete != null) { FrostbiteConnection.RaiseEvent(DownloadUnzipComplete.GetInvocationList()); } } catch (Exception e) { if (CustomDownloadError != null) { FrostbiteConnection.RaiseEvent(CustomDownloadError.GetInvocationList(), e.Message); } } } else { if (CustomDownloadError != null) { FrostbiteConnection.RaiseEvent(CustomDownloadError.GetInvocationList(), "Downloaded file failed checksum, please try again or download direct from https://myrcon.com"); } } }