From a70ed1aead92abb900ce13c28fd21b6d3feddf65 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 10:39:21 +0100 Subject: [PATCH 01/45] create studio guid property --- Bloxstrap/Bootstrapper.cs | 8 ++++---- Bloxstrap/Models/State.cs | 5 ++++- .../UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs | 2 +- Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs | 8 ++++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 5af684d..16c68eb 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -51,7 +51,7 @@ namespace Bloxstrap private readonly CancellationTokenSource _cancelTokenSource = new(); - private static bool FreshInstall => String.IsNullOrEmpty(App.State.Prop.VersionGuid); + private static bool FreshInstall => String.IsNullOrEmpty(App.State.Prop.PlayerVersionGuid); private string _playerLocation => Path.Combine(_versionFolder, "RobloxPlayerBeta.exe"); @@ -183,7 +183,7 @@ namespace Bloxstrap await CheckLatestVersion(); // install/update roblox if we're running for the first time, needs updating, or the player location doesn't exist - if (App.IsFirstRun || _latestVersionGuid != App.State.Prop.VersionGuid || !File.Exists(_playerLocation)) + if (App.IsFirstRun || _latestVersionGuid != App.State.Prop.PlayerVersionGuid || !File.Exists(_playerLocation)) await InstallLatestVersion(); if (App.IsFirstRun) @@ -874,7 +874,7 @@ namespace Bloxstrap } } - string oldVersionFolder = Path.Combine(Paths.Versions, App.State.Prop.VersionGuid); + string oldVersionFolder = Path.Combine(Paths.Versions, App.State.Prop.PlayerVersionGuid); // move old compatibility flags for the old location using (RegistryKey appFlagsKey = Registry.CurrentUser.CreateSubKey($"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers")) @@ -915,7 +915,7 @@ namespace Bloxstrap } } - App.State.Prop.VersionGuid = _latestVersionGuid; + App.State.Prop.PlayerVersionGuid = _latestVersionGuid; // don't register program size until the program is registered, which will be done after this if (!App.IsFirstRun && !FreshInstall) diff --git a/Bloxstrap/Models/State.cs b/Bloxstrap/Models/State.cs index 6f1d650..af607f5 100644 --- a/Bloxstrap/Models/State.cs +++ b/Bloxstrap/Models/State.cs @@ -3,7 +3,10 @@ public class State { public string LastEnrolledChannel { get; set; } = ""; - public string VersionGuid { get; set; } = ""; + [Obsolete("Use PlayerVersionGuid", true)] + public string VersionGuid { set { PlayerVersionGuid = value; } } + public string PlayerVersionGuid { get; set; } = ""; + public string StudioVersionGuid { get; set; } = ""; public List ModManifest { get; set; } = new(); } } diff --git a/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs b/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs index 5f16722..ed04c64 100644 --- a/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs @@ -20,7 +20,7 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper { get { - string playerLocation = Path.Combine(Paths.Versions, App.State.Prop.VersionGuid, "RobloxPlayerBeta.exe"); + string playerLocation = Path.Combine(Paths.Versions, App.State.Prop.PlayerVersionGuid, "RobloxPlayerBeta.exe"); if (!File.Exists(playerLocation)) return ""; diff --git a/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs b/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs index 28c4bc7..4c34052 100644 --- a/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs @@ -108,17 +108,17 @@ public bool ForceRobloxReinstallation { - get => String.IsNullOrEmpty(App.State.Prop.VersionGuid); + get => String.IsNullOrEmpty(App.State.Prop.PlayerVersionGuid); set { if (value) { - _oldVersionGuid = App.State.Prop.VersionGuid; - App.State.Prop.VersionGuid = ""; + _oldVersionGuid = App.State.Prop.PlayerVersionGuid; + App.State.Prop.PlayerVersionGuid = ""; } else { - App.State.Prop.VersionGuid = _oldVersionGuid; + App.State.Prop.PlayerVersionGuid = _oldVersionGuid; } } } From 2c1c2a374f68d595cec5f938df3910c17321c9dc Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:07:32 +0100 Subject: [PATCH 02/45] add studio protocols --- Bloxstrap/Bootstrapper.cs | 25 ++++++++++++++++++++++--- Bloxstrap/ProtocolHandler.cs | 13 +++++++++++-- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 16c68eb..ed0823e 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -502,6 +502,8 @@ namespace Bloxstrap ProtocolHandler.Register("roblox", "Roblox", Paths.Application); ProtocolHandler.Register("roblox-player", "Roblox", Paths.Application); + ProtocolHandler.Register("roblox-studio", "Roblox", Paths.Application, "-studio"); + ProtocolHandler.Register("roblox-studio-auth", "Roblox", Paths.Application, "-studio"); if (Environment.ProcessPath is not null && Environment.ProcessPath != Paths.Application) { @@ -678,13 +680,13 @@ namespace Bloxstrap bool robloxStillInstalled = true; // check if stock bootstrapper is still installed - RegistryKey? bootstrapperKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\roblox-player"); + using RegistryKey? bootstrapperKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\roblox-player"); if (bootstrapperKey is null) { + robloxStillInstalled = false; + ProtocolHandler.Unregister("roblox"); ProtocolHandler.Unregister("roblox-player"); - - robloxStillInstalled = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\roblox-studio") is not null; } else { @@ -696,6 +698,23 @@ namespace Bloxstrap ProtocolHandler.Register("roblox-player", "Roblox", bootstrapperLocation); } + using RegistryKey? studioBootstrapperKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\roblox-studio"); + if (studioBootstrapperKey is null) + { + robloxStillInstalled = false; + + ProtocolHandler.Unregister("roblox-studio"); + ProtocolHandler.Unregister("roblox-studio-auth"); + } + else + { + robloxStillInstalled = true; + + string studioLocation = (string?)studioBootstrapperKey.GetValue("InstallLocation") + "RobloxStudioBeta.exe"; // points to studio exe instead of bootstrapper + ProtocolHandler.Register("roblox-studio", "Roblox", studioLocation); + ProtocolHandler.Register("roblox-studio-auth", "Roblox", studioLocation); + } + // if the folder we're installed to does not end with "Bloxstrap", we're installed to a user-selected folder // in which case, chances are they chose to install to somewhere they didn't really mean to (prior to the added warning in 2.4.0) // if so, we're walking on eggshells and have to ensure we only clean up what we need to clean up diff --git a/Bloxstrap/ProtocolHandler.cs b/Bloxstrap/ProtocolHandler.cs index 44ff873..4b63546 100644 --- a/Bloxstrap/ProtocolHandler.cs +++ b/Bloxstrap/ProtocolHandler.cs @@ -105,9 +105,18 @@ namespace Bloxstrap App.State.Save(); } - public static void Register(string key, string name, string handler) + private static string ConstructHandlerArgs(string handler, string? extraArgs = null) { - string handlerArgs = $"\"{handler}\" %1"; + string handlerArgs = $"\"{handler}\""; + if (!string.IsNullOrEmpty(extraArgs)) + handlerArgs += $" {extraArgs}"; + handlerArgs += " %1"; + return handlerArgs; + } + + public static void Register(string key, string name, string handler, string? extraArgs = null) + { + string handlerArgs = ConstructHandlerArgs(handler, extraArgs); RegistryKey uriKey = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{key}"); RegistryKey uriIconKey = uriKey.CreateSubKey("DefaultIcon"); RegistryKey uriCommandKey = uriKey.CreateSubKey(@"shell\open\command"); From e70dc6df490170a58bfba3e79d62bca84a086c2e Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:10:46 +0100 Subject: [PATCH 03/45] fix still installed check --- Bloxstrap/Bootstrapper.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index ed0823e..918e58c 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -677,13 +677,14 @@ namespace Bloxstrap SetStatus($"Uninstalling {App.ProjectName}..."); App.ShouldSaveConfigs = false; - bool robloxStillInstalled = true; + bool robloxPlayerStillInstalled = true; + bool robloxStudioStillInstalled = true; // check if stock bootstrapper is still installed using RegistryKey? bootstrapperKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\roblox-player"); if (bootstrapperKey is null) { - robloxStillInstalled = false; + robloxPlayerStillInstalled = false; ProtocolHandler.Unregister("roblox"); ProtocolHandler.Unregister("roblox-player"); @@ -701,15 +702,13 @@ namespace Bloxstrap using RegistryKey? studioBootstrapperKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\roblox-studio"); if (studioBootstrapperKey is null) { - robloxStillInstalled = false; + robloxStudioStillInstalled = false; ProtocolHandler.Unregister("roblox-studio"); ProtocolHandler.Unregister("roblox-studio-auth"); } else { - robloxStillInstalled = true; - string studioLocation = (string?)studioBootstrapperKey.GetValue("InstallLocation") + "RobloxStudioBeta.exe"; // points to studio exe instead of bootstrapper ProtocolHandler.Register("roblox-studio", "Roblox", studioLocation); ProtocolHandler.Register("roblox-studio-auth", "Roblox", studioLocation); @@ -745,7 +744,7 @@ namespace Bloxstrap string robloxFolder = Path.Combine(Paths.LocalAppData, "Roblox"); - if (!robloxStillInstalled && Directory.Exists(robloxFolder)) + if (!robloxPlayerStillInstalled && !robloxStudioStillInstalled && Directory.Exists(robloxFolder)) cleanupSequence.Add(() => Directory.Delete(robloxFolder, true)); foreach (var process in cleanupSequence) From bb5b46adf5718f8d0e7111c94c566c7c29c3612a Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:14:18 +0100 Subject: [PATCH 04/45] check for studio arg --- Bloxstrap/App.xaml.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 12b62fa..77e832b 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -30,6 +30,7 @@ namespace Bloxstrap public static bool IsNoLaunch { get; private set; } = false; public static bool IsUpgrade { get; private set; } = false; public static bool IsMenuLaunch { get; private set; } = false; + public static bool IsStudioLaunch { get; private set; } = false; public static string[] LaunchArgs { get; private set; } = null!; public static BuildMetadataAttribute BuildMetadata = Assembly.GetExecutingAssembly().GetCustomAttribute()!; @@ -154,6 +155,12 @@ namespace Bloxstrap Logger.WriteLine(LOG_IDENT, "Bloxstrap started with IsUpgrade flag"); IsUpgrade = true; } + + if (Array.IndexOf(LaunchArgs, "-studio") != -1) + { + Logger.WriteLine(LOG_IDENT, "Bloxstrap started with IsStudioLaunch flag"); + IsStudioLaunch = true; + } } using (var checker = new InstallChecker()) From 1fcd05096a3b7889f89b5cfe5f5b32e40ac02eb2 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:05:53 +0100 Subject: [PATCH 05/45] add studio support --- Bloxstrap/App.xaml.cs | 14 +++-- Bloxstrap/Bootstrapper.cs | 97 ++++++++++++++++------------------- Bloxstrap/PackageMap.cs | 85 ++++++++++++++++++++++++++++++ Bloxstrap/ProtocolHandler.cs | 13 +---- Bloxstrap/RobloxDeployment.cs | 4 +- 5 files changed, 140 insertions(+), 73 deletions(-) create mode 100644 Bloxstrap/PackageMap.cs diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 77e832b..b32bba4 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -30,7 +30,6 @@ namespace Bloxstrap public static bool IsNoLaunch { get; private set; } = false; public static bool IsUpgrade { get; private set; } = false; public static bool IsMenuLaunch { get; private set; } = false; - public static bool IsStudioLaunch { get; private set; } = false; public static string[] LaunchArgs { get; private set; } = null!; public static BuildMetadataAttribute BuildMetadata = Assembly.GetExecutingAssembly().GetCustomAttribute()!; @@ -155,12 +154,6 @@ namespace Bloxstrap Logger.WriteLine(LOG_IDENT, "Bloxstrap started with IsUpgrade flag"); IsUpgrade = true; } - - if (Array.IndexOf(LaunchArgs, "-studio") != -1) - { - Logger.WriteLine(LOG_IDENT, "Bloxstrap started with IsStudioLaunch flag"); - IsStudioLaunch = true; - } } using (var checker = new InstallChecker()) @@ -196,6 +189,7 @@ namespace Bloxstrap #endif string commandLine = ""; + bool isStudioLaunch = false; if (IsMenuLaunch) { @@ -234,6 +228,10 @@ namespace Bloxstrap commandLine = $"--app --deeplink {LaunchArgs[0]}"; } + else if (LaunchArgs[0].StartsWith("roblox-studio:") || LaunchArgs[0].StartsWith("roblox-studio-auth:")) + { + commandLine = LaunchArgs[0]; + } else { commandLine = "--app"; @@ -251,7 +249,7 @@ namespace Bloxstrap // start bootstrapper and show the bootstrapper modal if we're not running silently Logger.WriteLine(LOG_IDENT, "Initializing bootstrapper"); - Bootstrapper bootstrapper = new(commandLine); + Bootstrapper bootstrapper = new(commandLine, isStudioLaunch); IBootstrapperDialog? dialog = null; if (!IsQuiet) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 918e58c..f8df459 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -10,38 +10,6 @@ namespace Bloxstrap public class Bootstrapper { #region Properties - // in case a new package is added, you can find the corresponding directory - // by opening the stock bootstrapper in a hex editor - // TODO - there ideally should be a less static way to do this that's not hardcoded? - private static readonly IReadOnlyDictionary PackageDirectories = new Dictionary() - { - { "RobloxApp.zip", @"" }, - { "shaders.zip", @"shaders\" }, - { "ssl.zip", @"ssl\" }, - - // the runtime installer is only extracted if it needs installing - { "WebView2.zip", @"" }, - { "WebView2RuntimeInstaller.zip", @"WebView2RuntimeInstaller\" }, - - { "content-avatar.zip", @"content\avatar\" }, - { "content-configs.zip", @"content\configs\" }, - { "content-fonts.zip", @"content\fonts\" }, - { "content-sky.zip", @"content\sky\" }, - { "content-sounds.zip", @"content\sounds\" }, - { "content-textures2.zip", @"content\textures\" }, - { "content-models.zip", @"content\models\" }, - - { "content-textures3.zip", @"PlatformContent\pc\textures\" }, - { "content-terrain.zip", @"PlatformContent\pc\terrain\" }, - { "content-platform-fonts.zip", @"PlatformContent\pc\fonts\" }, - - { "extracontent-luapackages.zip", @"ExtraContent\LuaPackages\" }, - { "extracontent-translations.zip", @"ExtraContent\translations\" }, - { "extracontent-models.zip", @"ExtraContent\models\" }, - { "extracontent-textures.zip", @"ExtraContent\textures\" }, - { "extracontent-places.zip", @"ExtraContent\places\" }, - }; - private const string AppSettings = "\r\n" + "\r\n" + @@ -51,11 +19,30 @@ namespace Bloxstrap private readonly CancellationTokenSource _cancelTokenSource = new(); - private static bool FreshInstall => String.IsNullOrEmpty(App.State.Prop.PlayerVersionGuid); + private bool FreshInstall => String.IsNullOrEmpty(_versionGuid); - private string _playerLocation => Path.Combine(_versionFolder, "RobloxPlayerBeta.exe"); + private string _playerFileName => _studioLaunch ? "RobloxStudioBeta.exe" : "RobloxPlayerBeta.exe"; + // TODO: change name + private string _playerLocation => Path.Combine(_versionFolder, _playerFileName); private string _launchCommandLine; + private bool _studioLaunch; + + private string _versionGuid + { + get + { + return _studioLaunch ? App.State.Prop.StudioVersionGuid : App.State.Prop.PlayerVersionGuid; + } + + set + { + if (_studioLaunch) + App.State.Prop.StudioVersionGuid = value; + else + App.State.Prop.PlayerVersionGuid = value; + } + } private string _latestVersionGuid = null!; private PackageManifest _versionPackageManifest = null!; @@ -68,13 +55,16 @@ namespace Bloxstrap private int _packagesExtracted = 0; private bool _cancelFired = false; + private IReadOnlyDictionary _packageDirectories => _studioLaunch ? PackageMap.Studio : PackageMap.Player; + public IBootstrapperDialog? Dialog = null; #endregion #region Core - public Bootstrapper(string launchCommandLine) + public Bootstrapper(string launchCommandLine, bool studioLaunch) { _launchCommandLine = launchCommandLine; + _studioLaunch = studioLaunch; } private void SetStatus(string message) @@ -183,7 +173,7 @@ namespace Bloxstrap await CheckLatestVersion(); // install/update roblox if we're running for the first time, needs updating, or the player location doesn't exist - if (App.IsFirstRun || _latestVersionGuid != App.State.Prop.PlayerVersionGuid || !File.Exists(_playerLocation)) + if (App.IsFirstRun || _latestVersionGuid != _versionGuid || !File.Exists(_playerLocation)) await InstallLatestVersion(); if (App.IsFirstRun) @@ -199,7 +189,7 @@ namespace Bloxstrap if (App.IsFirstRun || FreshInstall) { Register(); - RegisterProgramSize(); + RegisterProgramSize(); // STUDIO TODO } CheckInstall(); @@ -223,18 +213,20 @@ namespace Bloxstrap ClientVersion clientVersion; + string binaryType = _studioLaunch ? "WindowsStudio64" : "WindowsPlayer"; + try { - clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel); + clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel, binaryType: binaryType); } catch (HttpResponseException ex) { if (ex.ResponseMessage.StatusCode != HttpStatusCode.NotFound) throw; - App.Logger.WriteLine(LOG_IDENT, $"Reverting enrolled channel to {RobloxDeployment.DefaultChannel} because a WindowsPlayer build does not exist for {App.Settings.Prop.Channel}"); + App.Logger.WriteLine(LOG_IDENT, $"Reverting enrolled channel to {RobloxDeployment.DefaultChannel} because a {binaryType} build does not exist for {App.Settings.Prop.Channel}"); App.Settings.Prop.Channel = RobloxDeployment.DefaultChannel; - clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel); + clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel, binaryType: binaryType); } if (clientVersion.IsBehindDefaultChannel) @@ -257,7 +249,7 @@ namespace Bloxstrap App.Logger.WriteLine("Bootstrapper::CheckLatestVersion", $"Changed Roblox channel from {App.Settings.Prop.Channel} to {RobloxDeployment.DefaultChannel}"); App.Settings.Prop.Channel = RobloxDeployment.DefaultChannel; - clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel); + clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel, binaryType: binaryType); } } @@ -502,8 +494,8 @@ namespace Bloxstrap ProtocolHandler.Register("roblox", "Roblox", Paths.Application); ProtocolHandler.Register("roblox-player", "Roblox", Paths.Application); - ProtocolHandler.Register("roblox-studio", "Roblox", Paths.Application, "-studio"); - ProtocolHandler.Register("roblox-studio-auth", "Roblox", Paths.Application, "-studio"); + ProtocolHandler.Register("roblox-studio", "Roblox", Paths.Application); + ProtocolHandler.Register("roblox-studio-auth", "Roblox", Paths.Application); if (Environment.ProcessPath is not null && Environment.ProcessPath != Paths.Application) { @@ -798,7 +790,8 @@ namespace Bloxstrap _isInstalling = true; - SetStatus(FreshInstall ? "Installing Roblox..." : "Upgrading Roblox..."); + string extra = _studioLaunch ? " Studio" : ""; + SetStatus(FreshInstall ? $"Installing Roblox{extra}..." : $"Upgrading Roblox{extra}..."); Directory.CreateDirectory(Paths.Base); Directory.CreateDirectory(Paths.Downloads); @@ -892,12 +885,12 @@ namespace Bloxstrap } } - string oldVersionFolder = Path.Combine(Paths.Versions, App.State.Prop.PlayerVersionGuid); + string oldVersionFolder = Path.Combine(Paths.Versions, _versionGuid); // move old compatibility flags for the old location using (RegistryKey appFlagsKey = Registry.CurrentUser.CreateSubKey($"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers")) { - string oldGameClientLocation = Path.Combine(oldVersionFolder, "RobloxPlayerBeta.exe"); + string oldGameClientLocation = Path.Combine(oldVersionFolder, _playerFileName); string? appFlags = (string?)appFlagsKey.GetValue(oldGameClientLocation); if (appFlags is not null) @@ -915,7 +908,7 @@ namespace Bloxstrap { foreach (DirectoryInfo dir in new DirectoryInfo(Paths.Versions).GetDirectories()) { - if (dir.Name == _latestVersionGuid || !dir.Name.StartsWith("version-")) + if (dir.Name == App.State.Prop.PlayerVersionGuid || dir.Name == App.State.Prop.StudioVersionGuid || !dir.Name.StartsWith("version-")) continue; App.Logger.WriteLine(LOG_IDENT, $"Removing old version folder for {dir.Name}"); @@ -933,7 +926,7 @@ namespace Bloxstrap } } - App.State.Prop.PlayerVersionGuid = _latestVersionGuid; + _versionGuid = _latestVersionGuid; // don't register program size until the program is registered, which will be done after this if (!App.IsFirstRun && !FreshInstall) @@ -1228,7 +1221,7 @@ namespace Bloxstrap if (modFolderFiles.Contains(fileLocation)) continue; - var package = PackageDirectories.SingleOrDefault(x => x.Value != "" && fileLocation.StartsWith(x.Value)); + var package = _packageDirectories.SingleOrDefault(x => x.Value != "" && fileLocation.StartsWith(x.Value)); // package doesn't exist, likely mistakenly placed file if (String.IsNullOrEmpty(package.Key)) @@ -1436,7 +1429,7 @@ namespace Bloxstrap return; string packageLocation = Path.Combine(Paths.Downloads, package.Signature); - string packageFolder = Path.Combine(_versionFolder, PackageDirectories[package.Name]); + string packageFolder = Path.Combine(_versionFolder, _packageDirectories[package.Name]); App.Logger.WriteLine(LOG_IDENT, $"Reading {package.Name}..."); @@ -1462,7 +1455,7 @@ namespace Bloxstrap if (directory is not null) Directory.CreateDirectory(directory); - var fileManifest = _versionFileManifest.FirstOrDefault(x => x.Name == Path.Combine(PackageDirectories[package.Name], entry.FullName)); + var fileManifest = _versionFileManifest.FirstOrDefault(x => x.Name == Path.Combine(_packageDirectories[package.Name], entry.FullName)); string? signature = fileManifest?.Signature; if (File.Exists(extractPath)) @@ -1515,7 +1508,7 @@ namespace Bloxstrap if (entry is null) return; - string extractionPath = Path.Combine(_versionFolder, PackageDirectories[package.Name], entry.FullName); + string extractionPath = Path.Combine(_versionFolder, _packageDirectories[package.Name], entry.FullName); entry.ExtractToFile(extractionPath, true); } #endregion diff --git a/Bloxstrap/PackageMap.cs b/Bloxstrap/PackageMap.cs new file mode 100644 index 0000000..532f276 --- /dev/null +++ b/Bloxstrap/PackageMap.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Bloxstrap +{ + internal class PackageMap + { + public static IReadOnlyDictionary Player + { + get { return CombineDictionaries(_common, _playerOnly); } + } + + public static IReadOnlyDictionary Studio + { + get { return CombineDictionaries(_common, _studioOnly); } + } + + // in case a new package is added, you can find the corresponding directory + // by opening the stock bootstrapper in a hex editor + // TODO - there ideally should be a less static way to do this that's not hardcoded? + private static IReadOnlyDictionary _common = new Dictionary() + { + { "shaders.zip", @"shaders\" }, + { "ssl.zip", @"ssl\" }, + + // the runtime installer is only extracted if it needs installing + { "WebView2.zip", @"" }, + { "WebView2RuntimeInstaller.zip", @"WebView2RuntimeInstaller\" }, + + { "content-avatar.zip", @"content\avatar\" }, + { "content-configs.zip", @"content\configs\" }, + { "content-fonts.zip", @"content\fonts\" }, + { "content-sky.zip", @"content\sky\" }, + { "content-sounds.zip", @"content\sounds\" }, + { "content-textures2.zip", @"content\textures\" }, + { "content-models.zip", @"content\models\" }, + + { "content-textures3.zip", @"PlatformContent\pc\textures\" }, + { "content-terrain.zip", @"PlatformContent\pc\terrain\" }, + { "content-platform-fonts.zip", @"PlatformContent\pc\fonts\" }, + + { "extracontent-luapackages.zip", @"ExtraContent\LuaPackages\" }, + { "extracontent-translations.zip", @"ExtraContent\translations\" }, + { "extracontent-models.zip", @"ExtraContent\models\" }, + { "extracontent-textures.zip", @"ExtraContent\textures\" }, + { "extracontent-places.zip", @"ExtraContent\places\" }, + }; + + private static IReadOnlyDictionary _playerOnly = new Dictionary() + { + { "RobloxApp.zip", @"" } + }; + + private static IReadOnlyDictionary _studioOnly = new Dictionary() + { + { "RobloxStudio.zip", @"" }, + { "ApplicationConfig.zip", @"ApplicationConfig\" }, + { "content-studio_svg_textures.zip", @"content\studio_svg_textures\"}, + { "content-qt_translations.zip", @"content\qt_translations\" }, + { "content-api-docs.zip", @"content\api_docs\" }, + { "BuiltInPlugins.zip", @"BuiltInPlugins\" }, + { "BuiltInStandalonePlugins.zip", @"BuiltInStandalonePlugins\" }, + { "LibrariesQt5.zip", @"" }, + { "Plugins.zip", @"Plugins\" }, + { "Qml.zip", @"Qml\" }, + { "StudioFonts.zip", @"StudioFonts\" }, + }; + + private static Dictionary CombineDictionaries(IReadOnlyDictionary d1, IReadOnlyDictionary d2) + { + Dictionary newD = new Dictionary(); + + foreach (var d in d1) + newD[d.Key] = d.Value; + + foreach (var d in d2) + newD[d.Key] = d.Value; + + return newD; + } + } +} diff --git a/Bloxstrap/ProtocolHandler.cs b/Bloxstrap/ProtocolHandler.cs index 4b63546..44ff873 100644 --- a/Bloxstrap/ProtocolHandler.cs +++ b/Bloxstrap/ProtocolHandler.cs @@ -105,18 +105,9 @@ namespace Bloxstrap App.State.Save(); } - private static string ConstructHandlerArgs(string handler, string? extraArgs = null) + public static void Register(string key, string name, string handler) { - string handlerArgs = $"\"{handler}\""; - if (!string.IsNullOrEmpty(extraArgs)) - handlerArgs += $" {extraArgs}"; - handlerArgs += " %1"; - return handlerArgs; - } - - public static void Register(string key, string name, string handler, string? extraArgs = null) - { - string handlerArgs = ConstructHandlerArgs(handler, extraArgs); + string handlerArgs = $"\"{handler}\" %1"; RegistryKey uriKey = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{key}"); RegistryKey uriIconKey = uriKey.CreateSubKey("DefaultIcon"); RegistryKey uriCommandKey = uriKey.CreateSubKey(@"shell\open\command"); diff --git a/Bloxstrap/RobloxDeployment.cs b/Bloxstrap/RobloxDeployment.cs index cdeda88..ecf2c31 100644 --- a/Bloxstrap/RobloxDeployment.cs +++ b/Bloxstrap/RobloxDeployment.cs @@ -69,7 +69,7 @@ return location; } - public static async Task GetInfo(string channel, bool extraInformation = false) + public static async Task GetInfo(string channel, bool extraInformation = false, string binaryType = "WindowsPlayer") { const string LOG_IDENT = "RobloxDeployment::GetInfo"; @@ -84,7 +84,7 @@ } else { - string path = $"/v2/client-version/WindowsPlayer/channel/{channel}"; + string path = $"/v2/client-version/{binaryType}/channel/{channel}"; HttpResponseMessage deployInfoResponse; try From 05c643a860869f2cc404bc019731c7e00e892bf8 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:12:06 +0100 Subject: [PATCH 06/45] forgot to set this --- Bloxstrap/App.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index b32bba4..16fc481 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -231,6 +231,7 @@ namespace Bloxstrap else if (LaunchArgs[0].StartsWith("roblox-studio:") || LaunchArgs[0].StartsWith("roblox-studio-auth:")) { commandLine = LaunchArgs[0]; + isStudioLaunch = true; } else { From c8b6395f9998ba121293896b162c35609e0185d2 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:25:37 +0100 Subject: [PATCH 07/45] fix getinfo cache --- Bloxstrap/RobloxDeployment.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Bloxstrap/RobloxDeployment.cs b/Bloxstrap/RobloxDeployment.cs index ecf2c31..3d6d13b 100644 --- a/Bloxstrap/RobloxDeployment.cs +++ b/Bloxstrap/RobloxDeployment.cs @@ -75,12 +75,13 @@ App.Logger.WriteLine(LOG_IDENT, $"Getting deploy info for channel {channel} (extraInformation={extraInformation})"); + string cacheKey = $"{channel}-{binaryType}"; ClientVersion clientVersion; - if (ClientVersionCache.ContainsKey(channel)) + if (ClientVersionCache.ContainsKey(cacheKey)) { App.Logger.WriteLine(LOG_IDENT, "Deploy information is cached"); - clientVersion = ClientVersionCache[channel]; + clientVersion = ClientVersionCache[cacheKey]; } else { @@ -147,7 +148,7 @@ } } - ClientVersionCache[channel] = clientVersion; + ClientVersionCache[cacheKey] = clientVersion; return clientVersion; } From 8f6c95fed8fe2e4ca2747851c3613f1a08606158 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:25:48 +0100 Subject: [PATCH 08/45] add studio launch to launch settings --- Bloxstrap/Properties/launchSettings.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Bloxstrap/Properties/launchSettings.json b/Bloxstrap/Properties/launchSettings.json index ee3606b..df264b6 100644 --- a/Bloxstrap/Properties/launchSettings.json +++ b/Bloxstrap/Properties/launchSettings.json @@ -22,6 +22,10 @@ "Bloxstrap (Deeplink)": { "commandName": "Project", "commandLineArgs": "roblox://experiences/start?placeId=95206881" + }, + "Bloxstrap (Studio Launch)": { + "commandName": "Project", + "commandLineArgs": "roblox-studio:" } } } \ No newline at end of file From b9d32fc928b0cb0c1c798f0455c315664a9c1697 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:28:04 +0100 Subject: [PATCH 09/45] add libraries to common packages --- Bloxstrap/PackageMap.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Bloxstrap/PackageMap.cs b/Bloxstrap/PackageMap.cs index 532f276..3a35f7c 100644 --- a/Bloxstrap/PackageMap.cs +++ b/Bloxstrap/PackageMap.cs @@ -23,6 +23,7 @@ namespace Bloxstrap // TODO - there ideally should be a less static way to do this that's not hardcoded? private static IReadOnlyDictionary _common = new Dictionary() { + { "Libraries.zip", @"" }, { "shaders.zip", @"shaders\" }, { "ssl.zip", @"ssl\" }, From db33276db66c7358d22976acebf68272c8fe5b29 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:29:23 +0100 Subject: [PATCH 10/45] add extracontent scripts to studio packages --- Bloxstrap/PackageMap.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Bloxstrap/PackageMap.cs b/Bloxstrap/PackageMap.cs index 3a35f7c..b168086 100644 --- a/Bloxstrap/PackageMap.cs +++ b/Bloxstrap/PackageMap.cs @@ -62,6 +62,7 @@ namespace Bloxstrap { "content-studio_svg_textures.zip", @"content\studio_svg_textures\"}, { "content-qt_translations.zip", @"content\qt_translations\" }, { "content-api-docs.zip", @"content\api_docs\" }, + { "extracontent-scripts.zip", @"ExtraContent\scripts\" }, { "BuiltInPlugins.zip", @"BuiltInPlugins\" }, { "BuiltInStandalonePlugins.zip", @"BuiltInStandalonePlugins\" }, { "LibrariesQt5.zip", @"" }, From 6306242a286a3ea99345d8a15af5d94bf45300e3 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:30:40 +0100 Subject: [PATCH 11/45] add redist to studio packages --- Bloxstrap/PackageMap.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Bloxstrap/PackageMap.cs b/Bloxstrap/PackageMap.cs index b168086..6932921 100644 --- a/Bloxstrap/PackageMap.cs +++ b/Bloxstrap/PackageMap.cs @@ -69,6 +69,7 @@ namespace Bloxstrap { "Plugins.zip", @"Plugins\" }, { "Qml.zip", @"Qml\" }, { "StudioFonts.zip", @"StudioFonts\" }, + { "redist.zip", @"" }, }; private static Dictionary CombineDictionaries(IReadOnlyDictionary d1, IReadOnlyDictionary d2) From f407aa6334ae91202f70ea911c47c84cc826a798 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:54:14 +0100 Subject: [PATCH 12/45] add faster zip implementation --- Bloxstrap/Bloxstrap.csproj | 1 + Bloxstrap/Bootstrapper.cs | 66 ++++++-------------------------------- 2 files changed, 10 insertions(+), 57 deletions(-) diff --git a/Bloxstrap/Bloxstrap.csproj b/Bloxstrap/Bloxstrap.csproj index 8ce1388..03f3233 100644 --- a/Bloxstrap/Bloxstrap.csproj +++ b/Bloxstrap/Bloxstrap.csproj @@ -40,6 +40,7 @@ + all diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index f8df459..5de2787 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -836,7 +836,7 @@ namespace Bloxstrap // extract the package immediately after download asynchronously // discard is just used to suppress the warning - _ = ExtractPackage(package).ContinueWith(AsyncHelpers.ExceptionHandler, $"extracting {package.Name}"); + _ = Task.Run(() => ExtractPackage(package).ContinueWith(AsyncHelpers.ExceptionHandler, $"extracting {package.Name}")); } if (_cancelFired) @@ -1421,75 +1421,27 @@ namespace Bloxstrap } } - private async Task ExtractPackage(Package package) + private Task ExtractPackage(Package package) { const string LOG_IDENT = "Bootstrapper::ExtractPackage"; if (_cancelFired) - return; + return Task.CompletedTask; string packageLocation = Path.Combine(Paths.Downloads, package.Signature); string packageFolder = Path.Combine(_versionFolder, _packageDirectories[package.Name]); - App.Logger.WriteLine(LOG_IDENT, $"Reading {package.Name}..."); + App.Logger.WriteLine(LOG_IDENT, $"Extracting {package.Name}..."); - var archive = await Task.Run(() => ZipFile.OpenRead(packageLocation)); - - App.Logger.WriteLine(LOG_IDENT, $"Read {package.Name}. Extracting to {packageFolder}..."); - - // yeah so because roblox is roblox, these packages aren't actually valid zip files - // besides the fact that they use backslashes instead of forward slashes for directories, - // empty folders that *BEGIN* with a backslash in their fullname, but have an empty name are listed here for some reason... - - foreach (var entry in archive.Entries) - { - if (_cancelFired) - return; - - if (String.IsNullOrEmpty(entry.Name)) - continue; - - string extractPath = Path.Combine(packageFolder, entry.FullName); - string? directory = Path.GetDirectoryName(extractPath); - - if (directory is not null) - Directory.CreateDirectory(directory); - - var fileManifest = _versionFileManifest.FirstOrDefault(x => x.Name == Path.Combine(_packageDirectories[package.Name], entry.FullName)); - string? signature = fileManifest?.Signature; - - if (File.Exists(extractPath)) - { - if (signature is not null && MD5Hash.FromFile(extractPath) == signature) - continue; - - File.Delete(extractPath); - } - - bool retry = false; - - do - { - using var entryStream = entry.Open(); - using var fileStream = new FileStream(extractPath, FileMode.Create, FileAccess.ReadWrite, FileShare.None, bufferSize: 0x1000); - await entryStream.CopyToAsync(fileStream); - - if (signature is not null && MD5Hash.FromStream(fileStream) != signature) - { - if (retry) - throw new AssertionException($"Checksum of {entry.FullName} post-extraction did not match manifest"); - - retry = true; - } - } - while (retry); - - File.SetLastWriteTime(extractPath, entry.LastWriteTime.DateTime); - } + // not async but faster than previous implementation + using Ionic.Zip.ZipFile zip = Ionic.Zip.ZipFile.Read(packageLocation); + zip.ExtractAll(packageFolder); App.Logger.WriteLine(LOG_IDENT, $"Finished extracting {package.Name}"); _packagesExtracted += 1; + + return Task.CompletedTask; } private async Task ExtractFileFromPackage(string packageName, string fileName) From 9b1f4eef89778177c2b8847722d4c257519758e2 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:55:46 +0100 Subject: [PATCH 13/45] disable activity tracking if studio --- Bloxstrap/Bootstrapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 5de2787..4effc87 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -328,7 +328,7 @@ namespace Bloxstrap return; } - if (App.Settings.Prop.EnableActivityTracking) + if (App.Settings.Prop.EnableActivityTracking && !_studioLaunch) { activityWatcher = new(); shouldWait = true; From cc4e5d1c8401d1c3b07a05983d6bc6d4ab166e5f Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:16:39 +0100 Subject: [PATCH 14/45] update event name --- Bloxstrap/Bootstrapper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 4effc87..8b3af02 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -318,7 +318,8 @@ namespace Bloxstrap App.Logger.WriteLine(LOG_IDENT, $"Started Roblox (PID {gameClientPid})"); - using (SystemEvent startEvent = new("www.roblox.com/robloxStartedEvent")) + string eventName = _studioLaunch ? "www.roblox.com/robloxQTStudioStartedEvent" : "www.roblox.com/robloxStartedEvent"; + using (SystemEvent startEvent = new(eventName)) { bool startEventFired = await startEvent.WaitForEvent(); From 529262527c6eaecffb309ed39b205b09fd084e14 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:19:44 +0100 Subject: [PATCH 15/45] add task to uri map --- Bloxstrap/App.xaml.cs | 2 +- Bloxstrap/ProtocolHandler.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 16fc481..ee14cfc 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -230,7 +230,7 @@ namespace Bloxstrap } else if (LaunchArgs[0].StartsWith("roblox-studio:") || LaunchArgs[0].StartsWith("roblox-studio-auth:")) { - commandLine = LaunchArgs[0]; + commandLine = ProtocolHandler.ParseUri(LaunchArgs[0]); isStudioLaunch = true; } else diff --git a/Bloxstrap/ProtocolHandler.cs b/Bloxstrap/ProtocolHandler.cs index 44ff873..2edb25b 100644 --- a/Bloxstrap/ProtocolHandler.cs +++ b/Bloxstrap/ProtocolHandler.cs @@ -18,7 +18,9 @@ namespace Bloxstrap { "browsertrackerid", "-b " }, { "robloxLocale", "--rloc " }, { "gameLocale", "--gloc " }, - { "channel", "-channel " } + { "channel", "-channel " }, + // studio + { "task", "-task " }, }; public static string ParseUri(string protocol) From 35c1a3617600e0a6373abf0aea423589aed9ef9d Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:24:53 +0100 Subject: [PATCH 16/45] add other uri args --- Bloxstrap/ProtocolHandler.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Bloxstrap/ProtocolHandler.cs b/Bloxstrap/ProtocolHandler.cs index 2edb25b..2fe49f2 100644 --- a/Bloxstrap/ProtocolHandler.cs +++ b/Bloxstrap/ProtocolHandler.cs @@ -21,6 +21,10 @@ namespace Bloxstrap { "channel", "-channel " }, // studio { "task", "-task " }, + { "placeId", "-placeId " }, + { "universeId", "-universeId " }, + { "userId", "-userId " } + // TODO: -protocolString }; public static string ParseUri(string protocol) From c0b972eec7c4cb7cbb4e6f65d69cf7bf9f333e22 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:35:32 +0100 Subject: [PATCH 17/45] log arguments for debug builds --- Bloxstrap/App.xaml.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index ee14cfc..6d5d0d5 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -120,6 +120,10 @@ namespace Bloxstrap LaunchArgs = e.Args; +#if DEBUG + Logger.WriteLine(LOG_IDENT, $"Arguments: {string.Join(' ', LaunchArgs)}"); +#endif + HttpClient.Timeout = TimeSpan.FromSeconds(30); HttpClient.DefaultRequestHeaders.Add("User-Agent", ProjectRepository); From f426e6d2b2f3e41761d29a27f1ca07d00fd07606 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:43:23 +0100 Subject: [PATCH 18/45] fix studio auth handling --- Bloxstrap/App.xaml.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 6d5d0d5..d0ac99e 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -232,11 +232,16 @@ namespace Bloxstrap commandLine = $"--app --deeplink {LaunchArgs[0]}"; } - else if (LaunchArgs[0].StartsWith("roblox-studio:") || LaunchArgs[0].StartsWith("roblox-studio-auth:")) + else if (LaunchArgs[0].StartsWith("roblox-studio:")) { commandLine = ProtocolHandler.ParseUri(LaunchArgs[0]); isStudioLaunch = true; } + else if (LaunchArgs[0].StartsWith("roblox-studio-auth:")) + { + commandLine = LaunchArgs[0]; + isStudioLaunch = true; + } else { commandLine = "--app"; From c5c5ff96f337b8d37e586b774aeb84ca3c45019a Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 14:18:16 +0100 Subject: [PATCH 19/45] fix studio auth --- Bloxstrap/App.xaml.cs | 9 +++++++-- Bloxstrap/Bootstrapper.cs | 26 +++++++++++++++++++------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index d0ac99e..86ae915 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -1,4 +1,5 @@ using System.Reflection; +using System.Web; using System.Windows; using System.Windows.Threading; @@ -194,6 +195,7 @@ namespace Bloxstrap string commandLine = ""; bool isStudioLaunch = false; + bool isStudioAuth = false; if (IsMenuLaunch) { @@ -235,12 +237,15 @@ namespace Bloxstrap else if (LaunchArgs[0].StartsWith("roblox-studio:")) { commandLine = ProtocolHandler.ParseUri(LaunchArgs[0]); + if (!commandLine.Contains("-startEvent")) + commandLine += " -startEvent www.roblox.com/robloxQTStudioStartedEvent"; isStudioLaunch = true; } else if (LaunchArgs[0].StartsWith("roblox-studio-auth:")) { - commandLine = LaunchArgs[0]; + commandLine = HttpUtility.UrlDecode(LaunchArgs[0]); isStudioLaunch = true; + isStudioAuth = true; } else { @@ -259,7 +264,7 @@ namespace Bloxstrap // start bootstrapper and show the bootstrapper modal if we're not running silently Logger.WriteLine(LOG_IDENT, "Initializing bootstrapper"); - Bootstrapper bootstrapper = new(commandLine, isStudioLaunch); + Bootstrapper bootstrapper = new(commandLine, isStudioLaunch, isStudioAuth); IBootstrapperDialog? dialog = null; if (!IsQuiet) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 8b3af02..a5c73a9 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -27,6 +27,7 @@ namespace Bloxstrap private string _launchCommandLine; private bool _studioLaunch; + private bool _studioAuth; private string _versionGuid { @@ -61,10 +62,11 @@ namespace Bloxstrap #endregion #region Core - public Bootstrapper(string launchCommandLine, bool studioLaunch) + public Bootstrapper(string launchCommandLine, bool studioLaunch, bool studioAuth) { _launchCommandLine = launchCommandLine; _studioLaunch = studioLaunch; + _studioAuth = studioAuth; } private void SetStatus(string message) @@ -286,14 +288,17 @@ namespace Bloxstrap return; } - _launchCommandLine = _launchCommandLine.Replace("LAUNCHTIMEPLACEHOLDER", DateTimeOffset.Now.ToUnixTimeMilliseconds().ToString()); + if (!_studioAuth) + { + _launchCommandLine = _launchCommandLine.Replace("LAUNCHTIMEPLACEHOLDER", DateTimeOffset.Now.ToUnixTimeMilliseconds().ToString()); - _launchCommandLine += " -channel "; + _launchCommandLine += " -channel "; - if (App.Settings.Prop.Channel.ToLowerInvariant() == RobloxDeployment.DefaultChannel.ToLowerInvariant()) - _launchCommandLine += "production"; - else - _launchCommandLine += App.Settings.Prop.Channel.ToLowerInvariant(); + if (App.Settings.Prop.Channel.ToLowerInvariant() == RobloxDeployment.DefaultChannel.ToLowerInvariant()) + _launchCommandLine += "production"; + else + _launchCommandLine += App.Settings.Prop.Channel.ToLowerInvariant(); + } // whether we should wait for roblox to exit to handle stuff in the background or clean up after roblox closes bool shouldWait = false; @@ -305,6 +310,13 @@ namespace Bloxstrap WorkingDirectory = _versionFolder }; + if (_studioAuth) + { + Process.Start(startInfo); + Dialog?.CloseBootstrapper(); + return; + } + // v2.2.0 - byfron will trip if we keep a process handle open for over a minute, so we're doing this now int gameClientPid; using (Process gameClient = Process.Start(startInfo)!) From dc65f628d8e333ef57c96f84de7cc3eb04fe239b Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 14:47:26 +0100 Subject: [PATCH 20/45] register rbxl and rbxlx extensions --- Bloxstrap/Bootstrapper.cs | 10 ++++++++++ Bloxstrap/ProtocolHandler.cs | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index a5c73a9..c7174e5 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -510,6 +510,10 @@ namespace Bloxstrap ProtocolHandler.Register("roblox-studio", "Roblox", Paths.Application); ProtocolHandler.Register("roblox-studio-auth", "Roblox", Paths.Application); + ProtocolHandler.RegisterRobloxPlace(Paths.Application); + ProtocolHandler.RegisterExtension(".rbxl"); + ProtocolHandler.RegisterExtension(".rbxlx"); + if (Environment.ProcessPath is not null && Environment.ProcessPath != Paths.Application) { // in case the user is reinstalling @@ -711,12 +715,18 @@ namespace Bloxstrap ProtocolHandler.Unregister("roblox-studio"); ProtocolHandler.Unregister("roblox-studio-auth"); + + ProtocolHandler.Unregister("Roblox.Place"); + ProtocolHandler.Unregister(".rbxl"); + ProtocolHandler.Unregister(".rbxlx"); } else { string studioLocation = (string?)studioBootstrapperKey.GetValue("InstallLocation") + "RobloxStudioBeta.exe"; // points to studio exe instead of bootstrapper ProtocolHandler.Register("roblox-studio", "Roblox", studioLocation); ProtocolHandler.Register("roblox-studio-auth", "Roblox", studioLocation); + + ProtocolHandler.RegisterRobloxPlace(studioLocation); } // if the folder we're installed to does not end with "Bloxstrap", we're installed to a user-selected folder diff --git a/Bloxstrap/ProtocolHandler.cs b/Bloxstrap/ProtocolHandler.cs index 2fe49f2..3b9695a 100644 --- a/Bloxstrap/ProtocolHandler.cs +++ b/Bloxstrap/ProtocolHandler.cs @@ -7,6 +7,8 @@ namespace Bloxstrap { static class ProtocolHandler { + private const string RobloxPlaceKey = "Roblox.Place"; + // map uri keys to command line args private static readonly IReadOnlyDictionary UriKeyArgMap = new Dictionary() { @@ -135,6 +137,39 @@ namespace Bloxstrap uriCommandKey.Close(); } + public static void RegisterRobloxPlace(string handler) + { + const string keyValue = "Roblox Place"; + string handlerArgs = $"\"{handler}\" -ide \"%1\""; + string iconValue = $"{handler},0"; + + using RegistryKey uriKey = Registry.CurrentUser.CreateSubKey(@"Software\Classes\" + RobloxPlaceKey); + using RegistryKey uriIconKey = uriKey.CreateSubKey("DefaultIcon"); + using RegistryKey uriOpenKey = uriKey.CreateSubKey(@"shell\Open"); + using RegistryKey uriCommandKey = uriOpenKey.CreateSubKey(@"command"); + + if (uriKey.GetValue("") as string != keyValue) + uriKey.SetValue("", keyValue); + + if (uriCommandKey.GetValue("") as string != handlerArgs) + uriCommandKey.SetValue("", handlerArgs); + + if (uriOpenKey.GetValue("") as string != "Open") + uriOpenKey.SetValue("", "Open"); + + if (uriIconKey.GetValue("") as string != iconValue) + uriIconKey.SetValue("", iconValue); + } + + public static void RegisterExtension(string key) + { + using RegistryKey uriKey = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{key}"); + uriKey.CreateSubKey(RobloxPlaceKey + @"\ShellNew"); + + if (uriKey.GetValue("") as string != RobloxPlaceKey) + uriKey.SetValue("", RobloxPlaceKey); + } + public static void Unregister(string key) { try From 92bcd049908446fe6ef81b9afaa6151323e7fabb Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 14:54:46 +0100 Subject: [PATCH 21/45] add product format to setstatus --- Bloxstrap/Bootstrapper.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index c7174e5..d1bb887 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -73,6 +73,12 @@ namespace Bloxstrap { App.Logger.WriteLine("Bootstrapper::SetStatus", message); + string productName = "Roblox"; + if (_studioLaunch) + productName += " Studio"; + + message = message.Replace("{product}", productName); + // yea idk if (App.Settings.Prop.BootstrapperStyle == BootstrapperStyle.ByfronDialog) message = message.Replace("...", ""); @@ -265,7 +271,7 @@ namespace Bloxstrap { const string LOG_IDENT = "Bootstrapper::StartRoblox"; - SetStatus("Starting Roblox..."); + SetStatus("Starting {product}..."); if (_launchCommandLine == "--app" && App.Settings.Prop.UseDisableAppPatch) { @@ -813,8 +819,7 @@ namespace Bloxstrap _isInstalling = true; - string extra = _studioLaunch ? " Studio" : ""; - SetStatus(FreshInstall ? $"Installing Roblox{extra}..." : $"Upgrading Roblox{extra}..."); + SetStatus(FreshInstall ? "Installing {product}..." : "Upgrading {product}..."); Directory.CreateDirectory(Paths.Base); Directory.CreateDirectory(Paths.Downloads); @@ -871,7 +876,7 @@ namespace Bloxstrap if (Dialog is not null) { Dialog.ProgressStyle = ProgressBarStyle.Marquee; - SetStatus("Configuring Roblox..."); + SetStatus("Configuring {product}..."); } // wait for all packages to finish extracting, with an exception for the webview2 runtime installer From 1ae9578247196ac15f7c8708138dac72f3cfca11 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 14:55:53 +0100 Subject: [PATCH 22/45] fix roblox running check --- Bloxstrap/Bootstrapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index d1bb887..8c1b51f 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -1042,7 +1042,7 @@ namespace Bloxstrap { const string LOG_IDENT = "Bootstrapper::ApplyModifications"; - if (Process.GetProcessesByName("RobloxPlayerBeta").Any()) + if (Process.GetProcessesByName(_playerFileName[..^4]).Any()) { App.Logger.WriteLine(LOG_IDENT, "Roblox is running, aborting mod check"); return; From dce26a19d458f034a05ed1cce053a63d79ec4539 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 14:56:47 +0100 Subject: [PATCH 23/45] fix rbxl opening --- Bloxstrap/App.xaml.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 86ae915..4f3a520 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -247,6 +247,11 @@ namespace Bloxstrap isStudioLaunch = true; isStudioAuth = true; } + else if (LaunchArgs[0] == "-ide" && LaunchArgs.Length >= 2) + { + commandLine = $"-task EditFile -localPlaceFile {LaunchArgs[1]}"; + isStudioLaunch = true; + } else { commandLine = "--app"; From f971be3f624fe5047789503aad75d000ed4f4ae2 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:06:35 +0100 Subject: [PATCH 24/45] disable multi instance launching for studio --- Bloxstrap/App.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 4f3a520..1fcd9f7 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -286,7 +286,7 @@ namespace Bloxstrap Mutex? singletonMutex = null; - if (Settings.Prop.MultiInstanceLaunching) + if (Settings.Prop.MultiInstanceLaunching && !isStudioLaunch) { Logger.WriteLine(LOG_IDENT, "Creating singleton mutex"); From 63ba2608a7bfcdde5830e2c354099cf3878336e3 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:06:45 +0100 Subject: [PATCH 25/45] close studios on uninstall --- Bloxstrap/Bootstrapper.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 8c1b51f..f2c4e1e 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -680,6 +680,12 @@ namespace Bloxstrap process.CloseMainWindow(); process.Close(); } + + foreach (Process process in Process.GetProcessesByName("RobloxStudioBeta")) + { + process.CloseMainWindow(); + process.Close(); + } } catch (Exception ex) { From 2040dde2fac5c2247cc4a281f894d9dea0d2ca06 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:09:32 +0100 Subject: [PATCH 26/45] add studio constant and update process checks --- Bloxstrap/App.xaml.cs | 3 ++- Bloxstrap/Bootstrapper.cs | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 1fcd9f7..f29f968 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -15,7 +15,8 @@ namespace Bloxstrap { public const string ProjectName = "Bloxstrap"; public const string ProjectRepository = "pizzaboxer/bloxstrap"; - public const string RobloxAppName = "RobloxPlayerBeta"; + public const string RobloxPlayerAppName = "RobloxPlayerBeta"; + public const string RobloxStudioAppName = "RobloxStudioBeta"; // used only for communicating between app and menu - use Directories.Base for anything else public static string BaseDirectory = null!; diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index f2c4e1e..d489696 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -660,7 +660,7 @@ namespace Bloxstrap const string LOG_IDENT = "Bootstrapper::Uninstall"; // prompt to shutdown roblox if its currently running - if (Process.GetProcessesByName(App.RobloxAppName).Any()) + if (Process.GetProcessesByName(App.RobloxPlayerAppName).Any() || Process.GetProcessesByName(App.RobloxStudioAppName).Any()) { App.Logger.WriteLine(LOG_IDENT, $"Prompting to shut down all open Roblox instances"); @@ -675,13 +675,13 @@ namespace Bloxstrap try { - foreach (Process process in Process.GetProcessesByName("RobloxPlayerBeta")) + foreach (Process process in Process.GetProcessesByName(App.RobloxPlayerAppName)) { process.CloseMainWindow(); process.Close(); } - foreach (Process process in Process.GetProcessesByName("RobloxStudioBeta")) + foreach (Process process in Process.GetProcessesByName(App.RobloxStudioAppName)) { process.CloseMainWindow(); process.Close(); @@ -938,7 +938,7 @@ namespace Bloxstrap // delete any old version folders // we only do this if roblox isnt running just in case an update happened // while they were launching a second instance or something idk - if (!Process.GetProcessesByName(App.RobloxAppName).Any()) + if (!Process.GetProcessesByName(App.RobloxPlayerAppName).Any() && !Process.GetProcessesByName(App.RobloxStudioAppName).Any()) { foreach (DirectoryInfo dir in new DirectoryInfo(Paths.Versions).GetDirectories()) { From ba031a645e535116b4896a720fa6cf2a737cc671 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:17:14 +0100 Subject: [PATCH 27/45] update byfron dialog player location --- Bloxstrap/Bootstrapper.cs | 1 + .../UI/Elements/Bootstrapper/ByfronDialog.xaml.cs | 2 +- .../ViewModels/Bootstrapper/ByfronDialogViewModel.cs | 10 ++++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index d489696..8af91f9 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -59,6 +59,7 @@ namespace Bloxstrap private IReadOnlyDictionary _packageDirectories => _studioLaunch ? PackageMap.Studio : PackageMap.Player; public IBootstrapperDialog? Dialog = null; + public bool IsStudioLaunch => _studioLaunch; #endregion #region Core diff --git a/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs b/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs index b01d083..e90245a 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs @@ -69,7 +69,7 @@ namespace Bloxstrap.UI.Elements.Bootstrapper public ByfronDialog() { - _viewModel = new ByfronDialogViewModel(this); + _viewModel = new ByfronDialogViewModel(this, Bootstrapper?.IsStudioLaunch ?? false); DataContext = _viewModel; Title = App.Settings.Prop.BootstrapperTitle; Icon = App.Settings.Prop.BootstrapperIcon.GetIcon().GetImageSource(); diff --git a/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs b/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs index ed04c64..46d1e0b 100644 --- a/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs @@ -6,6 +6,8 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper { public class ByfronDialogViewModel : BootstrapperDialogViewModel { + private bool _studioLaunch; + // Using dark theme for default values. public ImageSource ByfronLogoLocation { get; set; } = new BitmapImage(new Uri("pack://application:,,,/Resources/BootstrapperStyles/ByfronDialog/ByfronLogoDark.jpg")); public Thickness DialogBorder { get; set; } = new Thickness(0); @@ -20,7 +22,10 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper { get { - string playerLocation = Path.Combine(Paths.Versions, App.State.Prop.PlayerVersionGuid, "RobloxPlayerBeta.exe"); + string versionGuid = _studioLaunch ? App.State.Prop.StudioVersionGuid : App.State.Prop.PlayerVersionGuid; + string fileName = _studioLaunch ? "RobloxStudioBeta.exe" : "RobloxPlayerBeta.exe"; + + string playerLocation = Path.Combine(Paths.Versions, versionGuid, fileName); if (!File.Exists(playerLocation)) return ""; @@ -34,8 +39,9 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper } } - public ByfronDialogViewModel(IBootstrapperDialog dialog) : base(dialog) + public ByfronDialogViewModel(IBootstrapperDialog dialog, bool isStudioLaunch) : base(dialog) { + _studioLaunch = isStudioLaunch; } } } From 9dc836f8f3b5a5414a97f6c876c76f00d08c67c7 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:22:41 +0100 Subject: [PATCH 28/45] make register function cleaner --- Bloxstrap/ProtocolHandler.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Bloxstrap/ProtocolHandler.cs b/Bloxstrap/ProtocolHandler.cs index 3b9695a..d07b4d0 100644 --- a/Bloxstrap/ProtocolHandler.cs +++ b/Bloxstrap/ProtocolHandler.cs @@ -116,9 +116,10 @@ namespace Bloxstrap public static void Register(string key, string name, string handler) { string handlerArgs = $"\"{handler}\" %1"; - RegistryKey uriKey = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{key}"); - RegistryKey uriIconKey = uriKey.CreateSubKey("DefaultIcon"); - RegistryKey uriCommandKey = uriKey.CreateSubKey(@"shell\open\command"); + + using RegistryKey uriKey = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{key}"); + using RegistryKey uriIconKey = uriKey.CreateSubKey("DefaultIcon"); + using RegistryKey uriCommandKey = uriKey.CreateSubKey(@"shell\open\command"); if (uriKey.GetValue("") is null) { @@ -126,15 +127,11 @@ namespace Bloxstrap uriKey.SetValue("URL Protocol", ""); } - if ((string?)uriCommandKey.GetValue("") != handlerArgs) + if (uriCommandKey.GetValue("") as string != handlerArgs) { uriIconKey.SetValue("", handler); uriCommandKey.SetValue("", handlerArgs); } - - uriKey.Close(); - uriIconKey.Close(); - uriCommandKey.Close(); } public static void RegisterRobloxPlace(string handler) From 0b25566a7d8838f71d3399f0d2a85b4fec5ce758 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 16:32:46 +0100 Subject: [PATCH 29/45] use sharpziplib instead --- Bloxstrap/Bloxstrap.csproj | 2 +- Bloxstrap/Bootstrapper.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Bloxstrap/Bloxstrap.csproj b/Bloxstrap/Bloxstrap.csproj index 03f3233..36a6796 100644 --- a/Bloxstrap/Bloxstrap.csproj +++ b/Bloxstrap/Bloxstrap.csproj @@ -40,12 +40,12 @@ - all + diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 8af91f9..3d6c97d 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -1468,9 +1468,8 @@ namespace Bloxstrap App.Logger.WriteLine(LOG_IDENT, $"Extracting {package.Name}..."); - // not async but faster than previous implementation - using Ionic.Zip.ZipFile zip = Ionic.Zip.ZipFile.Read(packageLocation); - zip.ExtractAll(packageFolder); + var fastZip = new ICSharpCode.SharpZipLib.Zip.FastZip(); + fastZip.ExtractZip(packageLocation, packageFolder, "(.*?)"); App.Logger.WriteLine(LOG_IDENT, $"Finished extracting {package.Name}"); From 78d345fd8f68f3d1109ccd76d7314bb9f9905543 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 16:41:57 +0100 Subject: [PATCH 30/45] fix RegisterProgramSize --- Bloxstrap/Bootstrapper.cs | 21 ++++++++++++++++++++- Bloxstrap/Models/State.cs | 7 ++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 3d6c97d..2b479c3 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -45,6 +45,22 @@ namespace Bloxstrap } } + private long _distributionSize + { + get + { + return _studioLaunch ? App.State.Prop.StudioSize : App.State.Prop.PlayerSize; + } + + set + { + if (_studioLaunch) + App.State.Prop.StudioSize = value; + else + App.State.Prop.PlayerSize = value; + } + } + private string _latestVersionGuid = null!; private PackageManifest _versionPackageManifest = null!; private FileManifest _versionFileManifest = null!; @@ -495,7 +511,10 @@ namespace Bloxstrap using RegistryKey uninstallKey = Registry.CurrentUser.CreateSubKey($"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{App.ProjectName}"); // sum compressed and uncompressed package sizes and convert to kilobytes - int totalSize = (_versionPackageManifest.Sum(x => x.Size) + _versionPackageManifest.Sum(x => x.PackedSize)) / 1000; + long distributionSize = (_versionPackageManifest.Sum(x => x.Size) + _versionPackageManifest.Sum(x => x.PackedSize)) / 1000; + _distributionSize = distributionSize; + + long totalSize = App.State.Prop.PlayerSize + App.State.Prop.StudioSize; uninstallKey.SetValue("EstimatedSize", totalSize); diff --git a/Bloxstrap/Models/State.cs b/Bloxstrap/Models/State.cs index af607f5..4d758c0 100644 --- a/Bloxstrap/Models/State.cs +++ b/Bloxstrap/Models/State.cs @@ -3,10 +3,15 @@ public class State { public string LastEnrolledChannel { get; set; } = ""; - [Obsolete("Use PlayerVersionGuid", true)] + + [Obsolete("Use PlayerVersionGuid instead", true)] public string VersionGuid { set { PlayerVersionGuid = value; } } public string PlayerVersionGuid { get; set; } = ""; public string StudioVersionGuid { get; set; } = ""; + + public long PlayerSize { get; set; } = 0; + public long StudioSize { get; set; } = 0; + public List ModManifest { get; set; } = new(); } } From 6dafc220b3b59af7b7d3a6966138b08ef3057f86 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:05:15 +0100 Subject: [PATCH 31/45] fix version being deleted after install --- Bloxstrap/Bootstrapper.cs | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 2b479c3..3982fd9 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -954,34 +954,34 @@ namespace Bloxstrap appFlagsKey.DeleteValue(oldGameClientLocation); } } - - // delete any old version folders - // we only do this if roblox isnt running just in case an update happened - // while they were launching a second instance or something idk - if (!Process.GetProcessesByName(App.RobloxPlayerAppName).Any() && !Process.GetProcessesByName(App.RobloxStudioAppName).Any()) - { - foreach (DirectoryInfo dir in new DirectoryInfo(Paths.Versions).GetDirectories()) - { - if (dir.Name == App.State.Prop.PlayerVersionGuid || dir.Name == App.State.Prop.StudioVersionGuid || !dir.Name.StartsWith("version-")) - continue; - - App.Logger.WriteLine(LOG_IDENT, $"Removing old version folder for {dir.Name}"); - - try - { - dir.Delete(true); - } - catch (Exception ex) - { - App.Logger.WriteLine(LOG_IDENT, "Failed to delete version folder!"); - App.Logger.WriteException(LOG_IDENT, ex); - } - } - } } _versionGuid = _latestVersionGuid; + // delete any old version folders + // we only do this if roblox isnt running just in case an update happened + // while they were launching a second instance or something idk + if (!Process.GetProcessesByName(App.RobloxPlayerAppName).Any() && !Process.GetProcessesByName(App.RobloxStudioAppName).Any()) + { + foreach (DirectoryInfo dir in new DirectoryInfo(Paths.Versions).GetDirectories()) + { + if (dir.Name == App.State.Prop.PlayerVersionGuid || dir.Name == App.State.Prop.StudioVersionGuid || !dir.Name.StartsWith("version-")) + continue; + + App.Logger.WriteLine(LOG_IDENT, $"Removing old version folder for {dir.Name}"); + + try + { + dir.Delete(true); + } + catch (Exception ex) + { + App.Logger.WriteLine(LOG_IDENT, "Failed to delete version folder!"); + App.Logger.WriteException(LOG_IDENT, ex); + } + } + } + // don't register program size until the program is registered, which will be done after this if (!App.IsFirstRun && !FreshInstall) RegisterProgramSize(); From 8f6f6874d1a24cc78fdf4441aae51cbfea1d0885 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:07:20 +0100 Subject: [PATCH 32/45] change player & studio sizes to int --- Bloxstrap/Bootstrapper.cs | 6 +++--- Bloxstrap/Models/State.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 3982fd9..b543958 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -214,7 +214,7 @@ namespace Bloxstrap if (App.IsFirstRun || FreshInstall) { Register(); - RegisterProgramSize(); // STUDIO TODO + RegisterProgramSize(); } CheckInstall(); @@ -511,10 +511,10 @@ namespace Bloxstrap using RegistryKey uninstallKey = Registry.CurrentUser.CreateSubKey($"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{App.ProjectName}"); // sum compressed and uncompressed package sizes and convert to kilobytes - long distributionSize = (_versionPackageManifest.Sum(x => x.Size) + _versionPackageManifest.Sum(x => x.PackedSize)) / 1000; + int distributionSize = (_versionPackageManifest.Sum(x => x.Size) + _versionPackageManifest.Sum(x => x.PackedSize)) / 1000; _distributionSize = distributionSize; - long totalSize = App.State.Prop.PlayerSize + App.State.Prop.StudioSize; + int totalSize = App.State.Prop.PlayerSize + App.State.Prop.StudioSize; uninstallKey.SetValue("EstimatedSize", totalSize); diff --git a/Bloxstrap/Models/State.cs b/Bloxstrap/Models/State.cs index 4d758c0..5c22be6 100644 --- a/Bloxstrap/Models/State.cs +++ b/Bloxstrap/Models/State.cs @@ -9,8 +9,8 @@ public string PlayerVersionGuid { get; set; } = ""; public string StudioVersionGuid { get; set; } = ""; - public long PlayerSize { get; set; } = 0; - public long StudioSize { get; set; } = 0; + public int PlayerSize { get; set; } = 0; + public int StudioSize { get; set; } = 0; public List ModManifest { get; set; } = new(); } From ed62491827f82fe85a3041a25052430fdcd56591 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:07:49 +0100 Subject: [PATCH 33/45] forgot --- Bloxstrap/Bootstrapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index b543958..1cdd7fd 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -45,7 +45,7 @@ namespace Bloxstrap } } - private long _distributionSize + private int _distributionSize { get { From 47e8618dcc691774052e49ef797aec55b468a249 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:23:41 +0100 Subject: [PATCH 34/45] add studio to start menu --- Bloxstrap/App.xaml.cs | 3 ++- Bloxstrap/Bootstrapper.cs | 1 + Bloxstrap/Properties/launchSettings.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index f29f968..1d8b23c 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -250,8 +250,9 @@ namespace Bloxstrap } else if (LaunchArgs[0] == "-ide" && LaunchArgs.Length >= 2) { - commandLine = $"-task EditFile -localPlaceFile {LaunchArgs[1]}"; isStudioLaunch = true; + if (LaunchArgs.Length >= 2) + commandLine = $"-task EditFile -localPlaceFile \"{LaunchArgs[1]}\""; } else { diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 1cdd7fd..d73cce1 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -572,6 +572,7 @@ namespace Bloxstrap Utility.Shortcut.Create(Paths.Application, "", Path.Combine(Paths.StartMenu, "Play Roblox.lnk")); Utility.Shortcut.Create(Paths.Application, "-menu", Path.Combine(Paths.StartMenu, $"{App.ProjectName} Menu.lnk")); + Utility.Shortcut.Create(Paths.Application, "-ide", Path.Combine(Paths.StartMenu, "Roblox Studio (Bloxstrap).lnk")); if (App.Settings.Prop.CreateDesktopIcon) { diff --git a/Bloxstrap/Properties/launchSettings.json b/Bloxstrap/Properties/launchSettings.json index df264b6..2cf74a5 100644 --- a/Bloxstrap/Properties/launchSettings.json +++ b/Bloxstrap/Properties/launchSettings.json @@ -25,7 +25,7 @@ }, "Bloxstrap (Studio Launch)": { "commandName": "Project", - "commandLineArgs": "roblox-studio:" + "commandLineArgs": "-ide" } } } \ No newline at end of file From 276ea26d5ca28e64103d38ee7c2f8e0bc0e43bb2 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:24:43 +0100 Subject: [PATCH 35/45] make shortcut name use project name --- Bloxstrap/Bootstrapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index d73cce1..7270a29 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -572,7 +572,7 @@ namespace Bloxstrap Utility.Shortcut.Create(Paths.Application, "", Path.Combine(Paths.StartMenu, "Play Roblox.lnk")); Utility.Shortcut.Create(Paths.Application, "-menu", Path.Combine(Paths.StartMenu, $"{App.ProjectName} Menu.lnk")); - Utility.Shortcut.Create(Paths.Application, "-ide", Path.Combine(Paths.StartMenu, "Roblox Studio (Bloxstrap).lnk")); + Utility.Shortcut.Create(Paths.Application, "-ide", Path.Combine(Paths.StartMenu, $"Roblox Studio ({App.ProjectName}).lnk")); if (App.Settings.Prop.CreateDesktopIcon) { From ae1051cb0b04266b1c09d5e1e367fee6314de44c Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Thu, 5 Oct 2023 07:47:39 +0100 Subject: [PATCH 36/45] add studio to force roblox reinstall --- Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs b/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs index 4c34052..122c28b 100644 --- a/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs @@ -2,7 +2,8 @@ { public class BehaviourViewModel : NotifyPropertyChangedViewModel { - private string _oldVersionGuid = ""; + private string _oldPlayerVersionGuid = ""; + private string _oldStudioVersionGuid = ""; public BehaviourViewModel() { @@ -113,12 +114,15 @@ { if (value) { - _oldVersionGuid = App.State.Prop.PlayerVersionGuid; + _oldPlayerVersionGuid = App.State.Prop.PlayerVersionGuid; + _oldStudioVersionGuid = App.State.Prop.StudioVersionGuid; App.State.Prop.PlayerVersionGuid = ""; + App.State.Prop.StudioVersionGuid = ""; } else { - App.State.Prop.PlayerVersionGuid = _oldVersionGuid; + App.State.Prop.PlayerVersionGuid = _oldPlayerVersionGuid; + App.State.Prop.StudioVersionGuid = _oldStudioVersionGuid; } } } From c46a4ec022ada0d61d262b2959d10e568e5b08e7 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Thu, 5 Oct 2023 07:49:17 +0100 Subject: [PATCH 37/45] forgot to add studio to get --- Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs b/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs index 122c28b..de074b9 100644 --- a/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs @@ -109,7 +109,9 @@ public bool ForceRobloxReinstallation { - get => String.IsNullOrEmpty(App.State.Prop.PlayerVersionGuid); + // wouldnt it be better to check old version guids? + // what about fresh installs? + get => String.IsNullOrEmpty(App.State.Prop.PlayerVersionGuid) && String.IsNullOrEmpty(App.State.Prop.StudioVersionGuid); set { if (value) From cf963c4bdabc21a8460d4675b269f1a75bb6bb80 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:23:20 +0100 Subject: [PATCH 38/45] use a function for byfron dialog version text --- .../Bootstrapper/ByfronDialog.xaml.cs | 3 +- .../Bootstrapper/ByfronDialogViewModel.cs | 29 +++---------------- Bloxstrap/Utilities.cs | 18 ++++++++++++ 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs b/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs index e90245a..c94bf59 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs @@ -69,7 +69,8 @@ namespace Bloxstrap.UI.Elements.Bootstrapper public ByfronDialog() { - _viewModel = new ByfronDialogViewModel(this, Bootstrapper?.IsStudioLaunch ?? false); + string version = Utilities.GetRobloxVersion(Bootstrapper?.IsStudioLaunch ?? false); + _viewModel = new ByfronDialogViewModel(this, version); DataContext = _viewModel; Title = App.Settings.Prop.BootstrapperTitle; Icon = App.Settings.Prop.BootstrapperIcon.GetIcon().GetImageSource(); diff --git a/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs b/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs index 46d1e0b..f652499 100644 --- a/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs @@ -6,8 +6,6 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper { public class ByfronDialogViewModel : BootstrapperDialogViewModel { - private bool _studioLaunch; - // Using dark theme for default values. public ImageSource ByfronLogoLocation { get; set; } = new BitmapImage(new Uri("pack://application:,,,/Resources/BootstrapperStyles/ByfronDialog/ByfronLogoDark.jpg")); public Thickness DialogBorder { get; set; } = new Thickness(0); @@ -18,30 +16,11 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper public Visibility VersionTextVisibility => CancelEnabled ? Visibility.Collapsed : Visibility.Visible; - public string VersionText + public string VersionText { get; init; } + + public ByfronDialogViewModel(IBootstrapperDialog dialog, string version) : base(dialog) { - get - { - string versionGuid = _studioLaunch ? App.State.Prop.StudioVersionGuid : App.State.Prop.PlayerVersionGuid; - string fileName = _studioLaunch ? "RobloxStudioBeta.exe" : "RobloxPlayerBeta.exe"; - - string playerLocation = Path.Combine(Paths.Versions, versionGuid, fileName); - - if (!File.Exists(playerLocation)) - return ""; - - FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(playerLocation); - - if (versionInfo.ProductVersion is null) - return ""; - - return versionInfo.ProductVersion.Replace(", ", "."); - } - } - - public ByfronDialogViewModel(IBootstrapperDialog dialog, bool isStudioLaunch) : base(dialog) - { - _studioLaunch = isStudioLaunch; + VersionText = version; } } } diff --git a/Bloxstrap/Utilities.cs b/Bloxstrap/Utilities.cs index 565dc79..7f33a19 100644 --- a/Bloxstrap/Utilities.cs +++ b/Bloxstrap/Utilities.cs @@ -47,5 +47,23 @@ namespace Bloxstrap return version1.CompareTo(version2); } + + public static string GetRobloxVersion(bool studio) + { + string versionGuid = studio ? App.State.Prop.StudioVersionGuid : App.State.Prop.PlayerVersionGuid; + string fileName = studio ? "RobloxStudioBeta.exe" : "RobloxPlayerBeta.exe"; + + string playerLocation = Path.Combine(Paths.Versions, versionGuid, fileName); + + if (!File.Exists(playerLocation)) + return ""; + + FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(playerLocation); + + if (versionInfo.ProductVersion is null) + return ""; + + return versionInfo.ProductVersion.Replace(", ", "."); + } } } From 1dc52d21b3dcc96158e723445d450764ed9ab84b Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:45:39 +0100 Subject: [PATCH 39/45] add sharpziplib to licenses --- Bloxstrap/UI/Elements/Menu/Pages/AboutPage.xaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Bloxstrap/UI/Elements/Menu/Pages/AboutPage.xaml b/Bloxstrap/UI/Elements/Menu/Pages/AboutPage.xaml index df04fad..ce75096 100644 --- a/Bloxstrap/UI/Elements/Menu/Pages/AboutPage.xaml +++ b/Bloxstrap/UI/Elements/Menu/Pages/AboutPage.xaml @@ -221,9 +221,15 @@ - + - + + + + + + + From c20685862222d1792268a50f832911f2b26c898c Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:46:05 +0100 Subject: [PATCH 40/45] make the 3rd argument null --- Bloxstrap/Bootstrapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 7270a29..d627dda 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -1489,7 +1489,7 @@ namespace Bloxstrap App.Logger.WriteLine(LOG_IDENT, $"Extracting {package.Name}..."); var fastZip = new ICSharpCode.SharpZipLib.Zip.FastZip(); - fastZip.ExtractZip(packageLocation, packageFolder, "(.*?)"); + fastZip.ExtractZip(packageLocation, packageFolder, null); App.Logger.WriteLine(LOG_IDENT, $"Finished extracting {package.Name}"); From fba342b84018a9634ac04906284366783915df2b Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:47:58 +0100 Subject: [PATCH 41/45] fix debug build warning --- Bloxstrap/App.xaml.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 1d8b23c..7641a05 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -51,7 +51,9 @@ namespace Bloxstrap ) ); +#if RELEASE private static bool _showingExceptionDialog = false; +#endif public static void Terminate(ErrorCode exitCode = ErrorCode.ERROR_SUCCESS) { From 12faf50c408041ca775d426f2d60d13d97bab678 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:40:12 +0100 Subject: [PATCH 42/45] fix ide check --- Bloxstrap/App.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 7641a05..fddcc1a 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -250,7 +250,7 @@ namespace Bloxstrap isStudioLaunch = true; isStudioAuth = true; } - else if (LaunchArgs[0] == "-ide" && LaunchArgs.Length >= 2) + else if (LaunchArgs[0] == "-ide") { isStudioLaunch = true; if (LaunchArgs.Length >= 2) From 50c5cf05f5b6413038f367d30d119a77d4cf2340 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:44:36 +0100 Subject: [PATCH 43/45] set package directories in constructor --- Bloxstrap/Bootstrapper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index d627dda..3e00191 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -72,7 +72,7 @@ namespace Bloxstrap private int _packagesExtracted = 0; private bool _cancelFired = false; - private IReadOnlyDictionary _packageDirectories => _studioLaunch ? PackageMap.Studio : PackageMap.Player; + private IReadOnlyDictionary _packageDirectories; public IBootstrapperDialog? Dialog = null; public bool IsStudioLaunch => _studioLaunch; @@ -84,6 +84,8 @@ namespace Bloxstrap _launchCommandLine = launchCommandLine; _studioLaunch = studioLaunch; _studioAuth = studioAuth; + + _packageDirectories = _studioLaunch ? PackageMap.Studio : PackageMap.Player; } private void SetStatus(string message) From e1d2d8432a9c1d16dd7a4662316d04f690782c69 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:45:31 +0100 Subject: [PATCH 44/45] remove version file manifest --- Bloxstrap/Bootstrapper.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 3e00191..a4dd414 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -63,7 +63,6 @@ namespace Bloxstrap private string _latestVersionGuid = null!; private PackageManifest _versionPackageManifest = null!; - private FileManifest _versionFileManifest = null!; private string _versionFolder = null!; private bool _isInstalling = false; @@ -283,7 +282,6 @@ namespace Bloxstrap _latestVersionGuid = clientVersion.VersionGuid; _versionFolder = Path.Combine(Paths.Versions, _latestVersionGuid); _versionPackageManifest = await PackageManifest.Get(_latestVersionGuid); - _versionFileManifest = await FileManifest.Get(_latestVersionGuid); } private async Task StartRoblox() From 4a0df1e6d8c99a78b9e9d9087afba29e8f3655a2 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:47:51 +0100 Subject: [PATCH 45/45] remove protocolstring todo not required for studio to launch --- Bloxstrap/ProtocolHandler.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Bloxstrap/ProtocolHandler.cs b/Bloxstrap/ProtocolHandler.cs index d07b4d0..3193d63 100644 --- a/Bloxstrap/ProtocolHandler.cs +++ b/Bloxstrap/ProtocolHandler.cs @@ -26,7 +26,6 @@ namespace Bloxstrap { "placeId", "-placeId " }, { "universeId", "-universeId " }, { "userId", "-userId " } - // TODO: -protocolString }; public static string ParseUri(string protocol)