From 44c2610d2e611add67b094e5b4bc54e412e002b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 16:42:39 +0000 Subject: [PATCH 1/7] Bump Markdig from 0.35.0 to 0.37.0 Bumps [Markdig](https://github.com/xoofx/markdig) from 0.35.0 to 0.37.0. - [Release notes](https://github.com/xoofx/markdig/releases) - [Changelog](https://github.com/xoofx/markdig/blob/master/changelog.md) - [Commits](https://github.com/xoofx/markdig/compare/0.35.0...0.37.0) --- updated-dependencies: - dependency-name: Markdig dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Bloxstrap/Bloxstrap.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/Bloxstrap.csproj b/Bloxstrap/Bloxstrap.csproj index aa1b921..4056f8a 100644 --- a/Bloxstrap/Bloxstrap.csproj +++ b/Bloxstrap/Bloxstrap.csproj @@ -40,7 +40,7 @@ - + all From c9a23ac4783cdcba764dd9e245ac46e0e0059e72 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sun, 21 Apr 2024 19:46:58 +0100 Subject: [PATCH 2/7] use snackbar for already running warning --- Bloxstrap/App.xaml.cs | 9 ++------- Bloxstrap/Resources/Strings.Designer.cs | 15 ++++++++++++--- Bloxstrap/Resources/Strings.resx | 7 +++++-- Bloxstrap/UI/Elements/Menu/MainWindow.xaml | 8 +++++++- Bloxstrap/UI/Elements/Menu/MainWindow.xaml.cs | 11 ++++++++++- Bloxstrap/UI/Frontend.cs | 2 +- 6 files changed, 37 insertions(+), 15 deletions(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index f6e7072..ddbcc5e 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -175,13 +175,8 @@ namespace Bloxstrap } else { - if (Process.GetProcessesByName(ProjectName).Length > 1 && !LaunchSettings.IsQuiet) - Frontend.ShowMessageBox( - Bloxstrap.Resources.Strings.Menu_AlreadyRunning, - MessageBoxImage.Information - ); - - Frontend.ShowMenu(); + bool showAlreadyRunningWarning = Process.GetProcessesByName(ProjectName).Length > 1 && !LaunchSettings.IsQuiet; + Frontend.ShowMenu(showAlreadyRunningWarning); } StartupFinished(); diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index 4f01855..194e71a 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -1462,11 +1462,20 @@ namespace Bloxstrap.Resources { } /// - /// Looks up a localized string similar to Bloxstrap is currently running, likely as a background Roblox process. Please note that not all your changes will immediately apply until you close all currently open Roblox instances.. + /// Looks up a localized string similar to Please note that not all your changes will immediately apply until you close all currently open Roblox instances.. /// - public static string Menu_AlreadyRunning { + public static string Menu_AlreadyRunning_Caption { get { - return ResourceManager.GetString("Menu.AlreadyRunning", resourceCulture); + return ResourceManager.GetString("Menu.AlreadyRunning.Caption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bloxstrap is already running. + /// + public static string Menu_AlreadyRunning_Title { + get { + return ResourceManager.GetString("Menu.AlreadyRunning.Title", resourceCulture); } } diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index afaea78..39e5524 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -590,8 +590,11 @@ Would you like to upgrade your currently installed version? All files - - Bloxstrap is currently running, likely as a background Roblox process. Please note that not all your changes will immediately apply until you close all currently open Roblox instances. + + Please note that not all your changes will immediately apply until you close all currently open Roblox instances. + + + Bloxstrap is already running You can make it look different, retro, or even just like Roblox. diff --git a/Bloxstrap/UI/Elements/Menu/MainWindow.xaml b/Bloxstrap/UI/Elements/Menu/MainWindow.xaml index ad73178..86a1ce1 100644 --- a/Bloxstrap/UI/Elements/Menu/MainWindow.xaml +++ b/Bloxstrap/UI/Elements/Menu/MainWindow.xaml @@ -1,4 +1,4 @@ - + + diff --git a/Bloxstrap/UI/Elements/Menu/MainWindow.xaml.cs b/Bloxstrap/UI/Elements/Menu/MainWindow.xaml.cs index dfa4e1f..4f317fc 100644 --- a/Bloxstrap/UI/Elements/Menu/MainWindow.xaml.cs +++ b/Bloxstrap/UI/Elements/Menu/MainWindow.xaml.cs @@ -10,7 +10,7 @@ namespace Bloxstrap.UI.Elements.Menu /// public partial class MainWindow : INavigationWindow { - public MainWindow() + public MainWindow(bool showAlreadyRunningWarning) { InitializeComponent(); ApplyTheme(); @@ -22,6 +22,15 @@ namespace Bloxstrap.UI.Elements.Menu #if DEBUG // easier access PreInstallNavItem.Visibility = System.Windows.Visibility.Visible; #endif + + if (showAlreadyRunningWarning) + _ = ShowAlreadyRunningSnackbar(); + } + + private async Task ShowAlreadyRunningSnackbar() + { + await Task.Delay(500); // wait for everything to finish loading + AlreadyRunningSnackbar.Show(); } public void OpenWiki(object? sender, EventArgs e) => Utilities.ShellExecute($"https://github.com/{App.ProjectRepository}/wiki"); diff --git a/Bloxstrap/UI/Frontend.cs b/Bloxstrap/UI/Frontend.cs index 1561f7f..c4ddeef 100644 --- a/Bloxstrap/UI/Frontend.cs +++ b/Bloxstrap/UI/Frontend.cs @@ -8,7 +8,7 @@ namespace Bloxstrap.UI { static class Frontend { - public static void ShowMenu() => new MainWindow().ShowDialog(); + public static void ShowMenu(bool showAlreadyRunningWarning = false) => new MainWindow(showAlreadyRunningWarning).ShowDialog(); public static MessageBoxResult ShowMessageBox(string message, MessageBoxImage icon = MessageBoxImage.None, MessageBoxButton buttons = MessageBoxButton.OK, MessageBoxResult defaultResult = MessageBoxResult.None) { From 3fb331b4596599fc4c674d4482641ee482c63589 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:10:06 +0100 Subject: [PATCH 3/7] disable the ability to install in admin mode --- Bloxstrap/App.xaml.cs | 8 ++++++++ Bloxstrap/Enums/ErrorCode.cs | 1 + Bloxstrap/Utilities.cs | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index ddbcc5e..b3ca337 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -138,6 +138,14 @@ namespace Bloxstrap Paths.Initialize(BaseDirectory); + // disallow running as administrator except for uninstallation + if (Utilities.IsAdministrator && !LaunchSettings.IsUninstall) + { + Frontend.ShowMessageBox("Bloxstrap does not support running in administrator mode. Relaunch or reinstall Bloxstrap with lower privileges.", MessageBoxImage.Error); + Terminate(ErrorCode.ERROR_INVALID_FUNCTION); + return; + } + // we shouldn't save settings on the first run until the first installation is finished, // just in case the user decides to cancel the install if (!IsFirstRun) diff --git a/Bloxstrap/Enums/ErrorCode.cs b/Bloxstrap/Enums/ErrorCode.cs index ba6b65e..f6b6609 100644 --- a/Bloxstrap/Enums/ErrorCode.cs +++ b/Bloxstrap/Enums/ErrorCode.cs @@ -8,6 +8,7 @@ public enum ErrorCode { ERROR_SUCCESS = 0, + ERROR_INVALID_FUNCTION = 1, ERROR_INSTALL_USEREXIT = 1602, ERROR_INSTALL_FAILURE = 1603, ERROR_CANCELLED = 1223, diff --git a/Bloxstrap/Utilities.cs b/Bloxstrap/Utilities.cs index 7f33a19..eaf3816 100644 --- a/Bloxstrap/Utilities.cs +++ b/Bloxstrap/Utilities.cs @@ -1,9 +1,18 @@ using System.ComponentModel; +using System.Security.Principal; namespace Bloxstrap { static class Utilities { + /// + /// Is process running as administrator + /// https://stackoverflow.com/a/11660205 + /// + public static bool IsAdministrator => + new WindowsPrincipal(WindowsIdentity.GetCurrent()) + .IsInRole(WindowsBuiltInRole.Administrator); + public static void ShellExecute(string website) { try From 991c0574a77a2a269bfd5ed2b76889304ce3ece2 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:12:37 +0100 Subject: [PATCH 4/7] add in translation string --- Bloxstrap/App.xaml.cs | 2 +- Bloxstrap/Resources/Strings.Designer.cs | 9 +++++++++ Bloxstrap/Resources/Strings.resx | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index b3ca337..70ee662 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -141,7 +141,7 @@ namespace Bloxstrap // disallow running as administrator except for uninstallation if (Utilities.IsAdministrator && !LaunchSettings.IsUninstall) { - Frontend.ShowMessageBox("Bloxstrap does not support running in administrator mode. Relaunch or reinstall Bloxstrap with lower privileges.", MessageBoxImage.Error); + Frontend.ShowMessageBox(Bloxstrap.Resources.Strings.Bootstrapper_RanInAdminMode, MessageBoxImage.Error); Terminate(ErrorCode.ERROR_INVALID_FUNCTION); return; } diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index 194e71a..408db21 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -153,6 +153,15 @@ namespace Bloxstrap.Resources { } } + /// + /// Looks up a localized string similar to Bloxstrap does not support running in administrator mode. Relaunch or reinstall Bloxstrap with lower privileges.. + /// + public static string Bootstrapper_RanInAdminMode { + get { + return ResourceManager.GetString("Bootstrapper.RanInAdminMode", resourceCulture); + } + } + /// /// Looks up a localized string similar to Applying Roblox modifications.... /// diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index 39e5524..6e07e83 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -150,6 +150,9 @@ Your ReShade configuration files will still be saved, and you can locate them by Bloxstrap does not have enough disk space to download and install Roblox. Please free up some disk space and try again. + + Bloxstrap does not support running in administrator mode. Relaunch or reinstall Bloxstrap with lower privileges. + Applying Roblox modifications... From 83a846f7772d953c0355b4568401487dd14a76c4 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:25:48 +0100 Subject: [PATCH 5/7] disallow uninstall on first run --- Bloxstrap/App.xaml.cs | 7 +++++++ Bloxstrap/Resources/Strings.Designer.cs | 9 +++++++++ Bloxstrap/Resources/Strings.resx | 3 +++ 3 files changed, 19 insertions(+) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 70ee662..4118020 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -146,6 +146,13 @@ namespace Bloxstrap return; } + if (LaunchSettings.IsUninstall && IsFirstRun) + { + Frontend.ShowMessageBox(Bloxstrap.Resources.Strings.Bootstrapper_FirstRunUninstall, MessageBoxImage.Error); + Terminate(ErrorCode.ERROR_INVALID_FUNCTION); + return; + } + // we shouldn't save settings on the first run until the first installation is finished, // just in case the user decides to cancel the install if (!IsFirstRun) diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index 408db21..2a7a0da 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -133,6 +133,15 @@ namespace Bloxstrap.Resources { } } + /// + /// Looks up a localized string similar to You must first install Bloxstrap before uninstalling.. + /// + public static string Bootstrapper_FirstRunUninstall { + get { + return ResourceManager.GetString("Bootstrapper.FirstRunUninstall", resourceCulture); + } + } + /// /// Looks up a localized string similar to Roblox has now finished rolling out the new game client update, featuring 64-bit support and the Hyperion anticheat. ReShade does not work with this update, and so it has now been disabled and removed from Bloxstrap. /// diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index 6e07e83..d24de5b 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -142,6 +142,9 @@ Would you like to switch to the default channel ({1})? Roblox was launched via a deeplink, however the desktop app is required for deeplink launching to work. Because you've opted to disable the desktop app, it will temporarily be re-enabled for this launch only. + + You must first install Bloxstrap before uninstalling. + Roblox has now finished rolling out the new game client update, featuring 64-bit support and the Hyperion anticheat. ReShade does not work with this update, and so it has now been disabled and removed from Bloxstrap. From 50601e4e6e7e4c05c902360ba1e3789f97622ed9 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:45:36 +0100 Subject: [PATCH 6/7] fix custom font already existing on first run --- Bloxstrap/Bootstrapper.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 6214e2e..39f4779 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -1198,6 +1198,10 @@ namespace Bloxstrap if (App.IsFirstRun && App.CustomFontLocation is not null) { Directory.CreateDirectory(Path.GetDirectoryName(Paths.CustomFont)!); + + if (File.Exists(Paths.CustomFont)) + File.Delete(Paths.CustomFont); + File.Copy(App.CustomFontLocation, Paths.CustomFont); } From 9d1e32dfc12eaf799d2800979308a738e7e7afa4 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:29:54 +0100 Subject: [PATCH 7/7] use overwrite parameter instead --- Bloxstrap/Bootstrapper.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 39f4779..909c978 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -1198,11 +1198,7 @@ namespace Bloxstrap if (App.IsFirstRun && App.CustomFontLocation is not null) { Directory.CreateDirectory(Path.GetDirectoryName(Paths.CustomFont)!); - - if (File.Exists(Paths.CustomFont)) - File.Delete(Paths.CustomFont); - - File.Copy(App.CustomFontLocation, Paths.CustomFont); + File.Copy(App.CustomFontLocation, Paths.CustomFont, true); } if (File.Exists(Paths.CustomFont))