private async void editExplorerIcons_Click(object sender, EventArgs e) { Enabled = false; UseWaitCursor = true; string branch = (string)branchSelect.SelectedItem; ClientVersionInfo info = await RobloxStudioInstaller.GetCurrentVersionInfo(branch); Hide(); await RobloxStudioInstaller.BringUpToDate(branch, info.Guid, "The explorer icons may have received an update."); var editor = new ExplorerIconEditor(branch); editor.ShowDialog(); Show(); BringToFront(); Enabled = true; UseWaitCursor = false; }
public async Task RunInstaller(string branch) { restore(); setStatus("Checking for updates"); echo("Checking build installation..."); string currentBranch = Program.GetString("BuildBranch", "roblox"); string currentVersion = versionRegistry.GetString("VersionGuid"); bool shouldInstall = (forceInstall || currentBranch != branch); string fastVersion = await GetFastVersionGuid(currentBranch); if (branch == "roblox") { buildVersion = fastVersion; } ClientVersionInfo versionInfo = null; if (shouldInstall || fastVersion != currentVersion) { if (currentBranch != "roblox") { echo("Possible update detected, verifying..."); } versionInfo = await GetCurrentVersionInfo(branch, fastVersion); buildVersion = versionInfo.Guid; } else { buildVersion = fastVersion; } if (currentVersion != buildVersion || shouldInstall) { echo("This build needs to be installed!"); bool studioClosed = await shutdownStudioProcesses(); if (studioClosed) { string binaryType = GetStudioBinaryType(); string studioDir = GetStudioDirectory(); string versionId = versionInfo.Version; restore(); setStatus($"Installing Version {versionId} of Roblox Studio..."); var taskQueue = new List <Task>(); echo("Grabbing package manifest..."); List <PackageManifest> pkgManifest = await PackageManifest.Get(branch, buildVersion); echo("Grabbing file manifest..."); fileManifest = await FileManifest.Get(branch, buildVersion); progressBar.Maximum = 1; progressBar.Value = 0; progressBar.Style = ProgressBarStyle.Continuous; progressBar.Refresh(); foreach (PackageManifest package in pkgManifest) { Task installer = Task.Run(() => installPackage(package)); taskQueue.Add(installer); } await Task.WhenAll(taskQueue.ToArray()); echo("Writing AppSettings.xml..."); string appSettings = Path.Combine(studioDir, "AppSettings.xml"); File.WriteAllText(appSettings, appSettingsXml); setStatus("Deleting unused files..."); await deleteUnusedFiles(); progressBar.Style = ProgressBarStyle.Marquee; progressBar.Refresh(); Program.SetValue("BuildBranch", branch); versionRegistry.SetValue("Version", versionId); versionRegistry.SetValue("VersionGuid", buildVersion); } else { progressBar.Style = ProgressBarStyle.Marquee; progressBar.Refresh(); echo("Update cancelled. Launching on current branch and version."); } } else { echo("This version of Roblox Studio has been installed!"); } setStatus("Configuring Roblox Studio..."); echo("Updating registry protocols..."); Program.UpdateStudioRegistryProtocols(); if (exitWhenClosed) { echo("Applying flag configuration..."); FlagEditor.ApplyFlags(); echo("Patching explorer icons..."); await ExplorerIconEditor.PatchExplorerIcons(); } setStatus("Starting Roblox Studio..."); echo("Roblox Studio is up to date!"); await Task.Delay(1000); }