public void Install() { DoneLabel.Hide(); var opts = OptionOffline.Pressed ? InstallerFrontend.InstallerOptions.Offline : InstallerFrontend.InstallerOptions.None; if (OptionForceBackup.Pressed) { opts |= InstallerFrontend.InstallerOptions.ForceBackup; } if (OptionForceHTTP.Pressed) { opts |= InstallerFrontend.InstallerOptions.HTTP; } if (OptionLeavePatchDLLs.Pressed) { opts |= InstallerFrontend.InstallerOptions.LeavePatchDLLs; } if (OptionSkipVersionCheck.Pressed) { opts |= InstallerFrontend.InstallerOptions.SkipVersionChecks; } var inst = new InstallerFrontend(opts); if (inst.HasETGModInstalled(GungeonPath.Text)) { ETGModWarningDialog.Popup_(); return; } if (OptionShowLog.Pressed) { LargeImage.Hide(); InstallLog.Show(); } InstallButton.Disabled = true; SettingsButton.Disabled = true; ExeFileButton.Disabled = true; var data = new InstallThreadUserdata { Component = OptionComponent.Text, ExePath = GungeonPath.Text, Frontend = inst }; InstallationDone = false; InstallException = null; InstallErrorLabel.Hide(); InstallErrorButtons.Hide(); var thread = new Thread(new ThreadStart(() => InstallThread(data))); thread.Start(); }
public void InstallThread(InstallThreadUserdata userdata) { var inst = userdata.Frontend; var components = new List <ComponentInfo>(); components.Add(new ComponentInfo(userdata.Component, null)); try { inst.Install(components, userdata.ExePath); } catch (Exception e) { InstallException = e; } InstallationDone = true; }