private void DownloadAllComponents() { if (!Directory.Exists(InstallerSettings.DownloadDirectory)) { Directory.CreateDirectory(InstallerSettings.DownloadDirectory); } Downloader = new ComponentDownloader(); Downloader.OnDownloadProgressChanged += OnDownloadProgressChanged; string project64FileName = Path.Combine(InstallerSettings.DownloadDirectory, "Project64.zip"); // we *sadly* need to do something special for Project64 Log("Downloading Project64..."); Downloader.Project64(project64FileName); if (Downloader.Failed) { Log("Downloading Project64 Failed"); Log(Downloader.Exception.Message); Log(Downloader.Exception.StackTrace); return; } foreach (InstallerComponent component in InstallerComponents.Components) { // if it's disabled, // skip it if (!component.Enabled) { continue; } ChangeProgressBarValue(0); Log($"Downloading {component.Name}..."); Downloader.DownloadComponent(component, InstallerSettings.DownloadDirectory); if (Downloader.Failed) { Log($"Downloading {component.Name} Failed"); // log Exception aswell, if it exists if (Downloader.Exception != null) { Log(Downloader.Exception.Message); Log(Downloader.Exception.StackTrace); } return; } } Log("Downloading completed"); LaunchInstallComponents(); }