/// <summary> /// Performs the complete installation of SCT based on the user's options and reports back progress when needed. /// </summary> /// <param name="progressDisplay"></param> public static void InstallSCT(InstallationPage progressDisplay) { if (SelectedTaskbarType == TaskbarType.SimpleClassicThemeTaskbar && !ExtraFunctions.IsDotNetRuntimeInstalled()) { progressDisplay.progressWorker.ReportProgress(5); progressDisplay.Invoke(new Action(() => { progressDisplay.SetProgressBarColor(2); MessageBox.Show(progressDisplay.ParentForm, "Simple Classic Theme Taskbar requires the .NET Desktop Runtime. Install the .NET Desktop Runtime and run this wizard again.", "Cannot install SCT Taskbar"); Process.Start("https://dotnet.microsoft.com/download/dotnet/5.0/runtime"); ErrorWizard(progressDisplay); })); return; } // Move any existing SCT stuff to Configuration.InstallPath if (Configuration.InstallPath != InstallPath) { progressDisplay.progressText = "Moving SCT files to installation directory..."; progressDisplay.progressWorker.ReportProgress(0); ExtraFunctions.DirectoryCopy(Configuration.InstallPath, InstallPath, true); Directory.Delete(Configuration.InstallPath, true); Configuration.InstallPath = InstallPath; } // Install SCT to Configuration.InstallPath // Create a task for SCT progressDisplay.progressText = "Installing Simple Classic Theme..."; progressDisplay.progressWorker.ReportProgress(0); ExtraFunctions.UpdateStartupExecutable(true); // Go through all extra utilities and install them float temp = 10; foreach (InstallableUtility utility in UtilitiesToBeInstalled) { if (utility.Name != "Open-Shell" && utility.Name != "StartIsBack++") { progressDisplay.progressText = "Installing " + utility.Name + "..."; progressDisplay.progressWorker.ReportProgress((int)temp); temp += 10F / UtilitiesToBeInstalled.Count; int returnCode = utility.Install(); if (returnCode != 0) { progressDisplay.Invoke(new Action(() => { progressDisplay.SetProgressBarColor(2); MessageBox.Show(progressDisplay.ParentForm, $"Could not install {utility.Name}. Installer returned code {returnCode}.", "Installation failed"); ErrorWizard(progressDisplay); })); return; } } } // Configure StartIsBack++ if OS+SiB if (ConfigureSiB) { progressDisplay.progressText = "Configuring StartIsBack++ before installing..."; progressDisplay.progressWorker.ReportProgress(20); ExtraFunctions.ReConfigureOS(false, false, true); } // Configure Open-Shell Start Menu if OS+SiB or for manual selection if (ConfigureOSSM) { progressDisplay.progressText = "Configuring Open-Shell Menu's Start Menu before installing..."; progressDisplay.progressWorker.ReportProgress(30); ExtraFunctions.ReConfigureOS(true, false, false); } // Configure Open-Shell Taskbar if OS+SiB or for manual selection if (ConfigureOSTB) { progressDisplay.progressText = "Configuring Open-Shell Menu's Taskbar before installing..."; progressDisplay.progressWorker.ReportProgress(40); ExtraFunctions.ReConfigureOS(false, true, false); } // Install StartIsBack++ if OS+SiB or for manual selection if (UtilitiesToBeInstalled.Where((a) => a.Name == "StartIsBack++").Count() > 0) { progressDisplay.progressText = "Installing StartIsBack++..."; progressDisplay.progressWorker.ReportProgress(50); int returnCode = InstallableUtility.StartIsBackPlusPlus.Install(); if (returnCode != 0) { progressDisplay.Invoke(new Action(() => { progressDisplay.SetProgressBarColor(2); MessageBox.Show(progressDisplay.ParentForm, $"Could not install StartIsBack++. Installer returned code {returnCode}.", "Installation failed"); ErrorWizard(progressDisplay); })); return; } } // Install Open-Shell if OS+SiB or for manual selection if (UtilitiesToBeInstalled.Where((a) => a.Name == "Open-Shell").Count() > 0) { progressDisplay.progressText = "Installing Open-Shell..."; progressDisplay.progressWorker.ReportProgress(60); int returnCode = InstallableUtility.OpenShell.Install(); if (returnCode != 0) { progressDisplay.Invoke(new Action(() => { progressDisplay.SetProgressBarColor(2); MessageBox.Show(progressDisplay.ParentForm, $"Could not install Open-Shell. Installer returned code {returnCode}.", "Installation failed"); ErrorWizard(progressDisplay); })); return; } } // Install SCT Taskbar if (SelectedTaskbarType == TaskbarType.SimpleClassicThemeTaskbar) { progressDisplay.progressText = "Installing Simple Classic Theme Taskbar..."; progressDisplay.progressWorker.ReportProgress(70); progressDisplay.Invoke(new Action(() => new GithubDownloader(GithubDownloader.DownloadableGithubProject.SimpleClassicThemeTaskbar).ShowDialog())); } // Install RetroBar else if (SelectedTaskbarType == TaskbarType.RetroBar) { progressDisplay.progressText = "Installing RetroBar..."; progressDisplay.progressWorker.ReportProgress(70); progressDisplay.Invoke(new Action(() => new GithubDownloader(GithubDownloader.DownloadableGithubProject.RetroBar).ShowDialog())); } // Configure SCT progressDisplay.progressText = "Configuring Simple Classic Theme..."; progressDisplay.progressWorker.ReportProgress(80); Configuration.EnableTaskbar = SelectedTaskbarType != TaskbarType.None; Configuration.TaskbarType = SelectedTaskbarType != TaskbarType.None ? SelectedTaskbarType : TaskbarType.SimpleClassicThemeTaskbar; Configuration.UpdateMode = "Automatic"; // Finalize installation and record data for uninstall progressDisplay.progressText = "Finalizing installation and enabling Classic Theme..."; progressDisplay.progressWorker.ReportProgress(90); // Sleep for dramatic installation effect ClassicTheme.MasterEnable(SelectedTaskbarType != TaskbarType.None); System.Threading.Thread.Sleep(1200); progressDisplay.progressWorker.ReportProgress(100); }