From af19a353ff0b0c32b47ee9bcdd5805056bccdf02 Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Wed, 9 Oct 2024 16:20:17 +0100 Subject: [PATCH] Add QA build identification --- Bloxstrap/App.xaml.cs | 4 ++++ Bloxstrap/Bootstrapper.cs | 2 +- Bloxstrap/Installer.cs | 7 +++---- Bloxstrap/LaunchHandler.cs | 4 ++++ Bloxstrap/Locale.cs | 7 +++++-- Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml | 1 - Bloxstrap/UI/Elements/Base/WpfUiWindow.cs | 5 +++++ Bloxstrap/UI/ViewModels/Settings/ShortcutsViewModel.cs | 4 ++-- 8 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 74c86ac..5c0ee3a 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -14,7 +14,11 @@ namespace Bloxstrap /// public partial class App : Application { +#if QA_BUILD + public const string ProjectName = "Bloxstrap-QA"; +#else public const string ProjectName = "Bloxstrap"; +#endif public const string ProjectOwner = "Bloxstrap"; public const string ProjectRepository = "bloxstraplabs/bloxstrap"; public const string ProjectDownloadLink = "https://bloxstraplabs.com"; diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index ebf8434..7137721 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -158,7 +158,7 @@ namespace Bloxstrap if (connectionResult is not null) HandleConnectionError(connectionResult); -#if !DEBUG || DEBUG_UPDATER +#if (!DEBUG || DEBUG_UPDATER) && !QA_BUILD if (App.Settings.Prop.CheckForUpdates && !App.LaunchSettings.UpgradeFlag.Active) { bool updatePresent = await CheckForUpdates(); diff --git a/Bloxstrap/Installer.cs b/Bloxstrap/Installer.cs index ce5d56e..05100bc 100644 --- a/Bloxstrap/Installer.cs +++ b/Bloxstrap/Installer.cs @@ -5,11 +5,11 @@ namespace Bloxstrap { internal class Installer { - private static string DesktopShortcut => Path.Combine(Paths.Desktop, "Bloxstrap.lnk"); + private static string DesktopShortcut => Path.Combine(Paths.Desktop, $"{App.ProjectName}.lnk"); - private static string StartMenuShortcut => Path.Combine(Paths.WindowsStartMenu, "Bloxstrap.lnk"); + private static string StartMenuShortcut => Path.Combine(Paths.WindowsStartMenu, $"{App.ProjectName}.lnk"); - public string InstallLocation = Path.Combine(Paths.LocalAppData, "Bloxstrap"); + public string InstallLocation = Path.Combine(Paths.LocalAppData, App.ProjectName); public bool ExistingDataPresent => File.Exists(Path.Combine(InstallLocation, "Settings.json")); @@ -52,7 +52,6 @@ namespace Bloxstrap } } - // TODO: registry access checks, i'll need to look back on issues to see what the error looks like using (var uninstallKey = Registry.CurrentUser.CreateSubKey(App.UninstallKey)) { uninstallKey.SetValueSafe("DisplayIcon", $"{Paths.Application},0"); diff --git a/Bloxstrap/LaunchHandler.cs b/Bloxstrap/LaunchHandler.cs index 090bd03..82957ad 100644 --- a/Bloxstrap/LaunchHandler.cs +++ b/Bloxstrap/LaunchHandler.cs @@ -78,6 +78,10 @@ namespace Bloxstrap } else { +#if QA_BUILD + Frontend.ShowMessageBox("You are running a QA build of Bloxstrap. The red window border indicates that this is a QA build.", MessageBoxImage.Information); +#endif + new LanguageSelectorDialog().ShowDialog(); var installer = new UI.Elements.Installer.MainWindow(); diff --git a/Bloxstrap/Locale.cs b/Bloxstrap/Locale.cs index a818412..7a87edd 100644 --- a/Bloxstrap/Locale.cs +++ b/Bloxstrap/Locale.cs @@ -1,7 +1,5 @@ using System.Windows; -using Bloxstrap.Resources; - namespace Bloxstrap { internal static class Locale @@ -104,6 +102,11 @@ namespace Bloxstrap { window.FontFamily = new System.Windows.Media.FontFamily(new Uri("pack://application:,,,/Resources/Fonts/"), "./#Noto Sans Thai"); } + +#if QA_BUILD + window.BorderBrush = System.Windows.Media.Brushes.Red; + window.BorderThickness = new Thickness(4); +#endif })); } } diff --git a/Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml b/Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml index 57f2c9b..a414499 100644 --- a/Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml +++ b/Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml @@ -48,7 +48,6 @@ - diff --git a/Bloxstrap/UI/Elements/Base/WpfUiWindow.cs b/Bloxstrap/UI/Elements/Base/WpfUiWindow.cs index ad2135f..db06e7f 100644 --- a/Bloxstrap/UI/Elements/Base/WpfUiWindow.cs +++ b/Bloxstrap/UI/Elements/Base/WpfUiWindow.cs @@ -20,6 +20,11 @@ namespace Bloxstrap.UI.Elements.Base { _themeService.SetTheme(App.Settings.Prop.Theme.GetFinal() == Enums.Theme.Dark ? ThemeType.Dark : ThemeType.Light); _themeService.SetSystemAccent(); + +#if QA_BUILD + this.BorderBrush = System.Windows.Media.Brushes.Red; + this.BorderThickness = new Thickness(4); +#endif } protected override void OnSourceInitialized(EventArgs e) diff --git a/Bloxstrap/UI/ViewModels/Settings/ShortcutsViewModel.cs b/Bloxstrap/UI/ViewModels/Settings/ShortcutsViewModel.cs index cb4cc54..413bb13 100644 --- a/Bloxstrap/UI/ViewModels/Settings/ShortcutsViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Settings/ShortcutsViewModel.cs @@ -5,9 +5,9 @@ namespace Bloxstrap.UI.ViewModels.Settings { public class ShortcutsViewModel : NotifyPropertyChangedViewModel { - public ShortcutTask DesktopIconTask { get; } = new("Desktop", Paths.Desktop, "Bloxstrap.lnk"); + public ShortcutTask DesktopIconTask { get; } = new("Desktop", Paths.Desktop, $"{App.ProjectName}.lnk"); - public ShortcutTask StartMenuIconTask { get; } = new("StartMenu", Paths.WindowsStartMenu, "Bloxstrap.lnk"); + public ShortcutTask StartMenuIconTask { get; } = new("StartMenu", Paths.WindowsStartMenu, $"{App.ProjectName}.lnk"); public ShortcutTask PlayerIconTask { get; } = new("RobloxPlayer", Paths.Desktop, $"{Strings.LaunchMenu_LaunchRoblox}.lnk", "-player");