Skip to content

Commit efeea11

Browse files
committed
2 parents 7e8c967 + aa28a62 commit efeea11

File tree

70 files changed

+5901
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+5901
-180
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ body:
4545
description: Provide a comprehensive description of the problem you're facing. Don't forget to attach any additional resources you may have, such as log files and screenshots.
4646
validations:
4747
required: true
48+
- type: textarea
49+
id: repro-steps
50+
attributes:
51+
label: How do you reproduce the problem?
52+
description: Include the steps to reproduce the problem from start to finish. Include details such as FastFlags you added and settings you changed.
53+
placeholder: |
54+
1. Go to '...'
55+
2. Click on '...'
56+
3. Scroll down to '...'
57+
4. See error
4858
- type: textarea
4959
id: log
5060
attributes:

Bloxstrap/App.xaml

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
<ResourceDictionary.MergedDictionaries>
1212
<ui:ThemesDictionary Theme="Dark" />
1313
<ui:ControlsDictionary />
14+
<ResourceDictionary x:Name="CustomTheme" Source="UI/Style/Dark.xaml" /> <!-- NOTE: WpfUiWindow::ApplyTheme relies on this order. If you plan to change the order, please update the index in the function. -->
15+
<ResourceDictionary x:Name="Default" Source="UI/Style/Default.xaml" />
1416
</ResourceDictionary.MergedDictionaries>
1517

1618
<FontFamily x:Key="Rubik">pack://application:,,,/Resources/Fonts/#Rubik Light</FontFamily>

Bloxstrap/App.xaml.cs

+62-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public partial class App : Application
4242

4343
public static bool IsProductionBuild => IsActionBuild && BuildMetadata.CommitRef.StartsWith("tag", StringComparison.Ordinal);
4444

45-
public static bool IsStudioVisible => !String.IsNullOrEmpty(App.State.Prop.Studio.VersionGuid);
45+
public static bool IsStudioVisible => !String.IsNullOrEmpty(App.RobloxState.Prop.Studio.VersionGuid);
4646

4747
public static readonly MD5 MD5Provider = MD5.Create();
4848

@@ -54,6 +54,8 @@ public partial class App : Application
5454

5555
public static readonly JsonManager<State> State = new();
5656

57+
public static readonly JsonManager<RobloxState> RobloxState = new();
58+
5759
public static readonly FastFlagManager FastFlags = new();
5860

5961
public static readonly HttpClient HttpClient = new(
@@ -63,6 +65,20 @@ public partial class App : Application
6365
);
6466

6567
private static bool _showingExceptionDialog = false;
68+
69+
private static string? _webUrl = null;
70+
public static string WebUrl
71+
{
72+
get {
73+
if (_webUrl != null)
74+
return _webUrl;
75+
76+
string url = ConstructBloxstrapWebUrl();
77+
if (Settings.Loaded) // only cache if settings are done loading
78+
_webUrl = url;
79+
return url;
80+
}
81+
}
6682

6783
public static void Terminate(ErrorCode exitCode = ErrorCode.ERROR_SUCCESS)
6884
{
@@ -124,6 +140,25 @@ public static void FinalizeExceptionHandling(Exception ex, bool log = true)
124140
Terminate(ErrorCode.ERROR_INSTALL_FAILURE);
125141
}
126142

143+
public static string ConstructBloxstrapWebUrl()
144+
{
145+
// dont let user switch web environment if debug mode is not on
146+
if (Settings.Prop.WebEnvironment == WebEnvironment.Production || !Settings.Prop.DeveloperMode)
147+
return "bloxstraplabs.com";
148+
149+
string? sub = Settings.Prop.WebEnvironment.GetDescription();
150+
return $"web-{sub}.bloxstraplabs.com";
151+
}
152+
153+
public static bool CanSendLogs()
154+
{
155+
// non developer mode always uses production
156+
if (!Settings.Prop.DeveloperMode || Settings.Prop.WebEnvironment == WebEnvironment.Production)
157+
return IsProductionBuild;
158+
159+
return true;
160+
}
161+
127162
public static async Task<GithubRelease?> GetLatestRelease()
128163
{
129164
const string LOG_IDENT = "App::GetLatestRelease";
@@ -155,7 +190,7 @@ public static async void SendStat(string key, string value)
155190

156191
try
157192
{
158-
await HttpClient.GetAsync($"https://bloxstraplabs.com/metrics/post?key={key}&value={value}");
193+
await HttpClient.GetAsync($"https://{WebUrl}/metrics/post?key={key}&value={value}");
159194
}
160195
catch (Exception ex)
161196
{
@@ -165,13 +200,13 @@ public static async void SendStat(string key, string value)
165200

166201
public static async void SendLog()
167202
{
168-
if (!Settings.Prop.EnableAnalytics || !IsProductionBuild)
203+
if (!Settings.Prop.EnableAnalytics || !CanSendLogs())
169204
return;
170205

171206
try
172207
{
173208
await HttpClient.PostAsync(
174-
$"https://bloxstraplabs.com/metrics/post-exception",
209+
$"https://{WebUrl}/metrics/post-exception",
175210
new StringContent(Logger.AsDocument)
176211
);
177212
}
@@ -181,6 +216,22 @@ await HttpClient.PostAsync(
181216
}
182217
}
183218

219+
public static void AssertWindowsOSVersion()
220+
{
221+
const string LOG_IDENT = "App::AssertWindowsOSVersion";
222+
223+
int major = Environment.OSVersion.Version.Major;
224+
if (major < 10) // Windows 10 and newer only
225+
{
226+
Logger.WriteLine(LOG_IDENT, $"Detected unsupported Windows version ({Environment.OSVersion.Version}).");
227+
228+
if (!LaunchSettings.QuietFlag.Active)
229+
Frontend.ShowMessageBox(Strings.App_OSDeprecation_Win7_81, MessageBoxImage.Error);
230+
231+
Terminate(ErrorCode.ERROR_INVALID_FUNCTION);
232+
}
233+
}
234+
184235
protected override void OnStartup(StartupEventArgs e)
185236
{
186237
const string LOG_IDENT = "App::OnStartup";
@@ -213,6 +264,8 @@ protected override void OnStartup(StartupEventArgs e)
213264
#endif
214265
}
215266

267+
Logger.WriteLine(LOG_IDENT, $"OSVersion: {Environment.OSVersion}");
268+
216269
Logger.WriteLine(LOG_IDENT, $"Loaded from {Paths.Process}");
217270
Logger.WriteLine(LOG_IDENT, $"Temp path is {Paths.Temp}");
218271
Logger.WriteLine(LOG_IDENT, $"WindowsStartMenu path is {Paths.WindowsStartMenu}");
@@ -292,6 +345,7 @@ protected override void OnStartup(StartupEventArgs e)
292345
{
293346
Logger.Initialize(true);
294347
Logger.WriteLine(LOG_IDENT, "Not installed, launching the installer");
348+
AssertWindowsOSVersion(); // prevent new installs from unsupported operating systems
295349
LaunchHandler.LaunchInstaller();
296350
}
297351
else
@@ -317,6 +371,7 @@ protected override void OnStartup(StartupEventArgs e)
317371

318372
Settings.Load();
319373
State.Load();
374+
RobloxState.Load();
320375
FastFlags.Load();
321376

322377
if (!Locale.SupportedLocales.ContainsKey(Settings.Prop.Locale))
@@ -325,6 +380,9 @@ protected override void OnStartup(StartupEventArgs e)
325380
Settings.Save();
326381
}
327382

383+
Logger.WriteLine(LOG_IDENT, $"Developer mode: {Settings.Prop.DeveloperMode}");
384+
Logger.WriteLine(LOG_IDENT, $"Web environment: {Settings.Prop.WebEnvironment}");
385+
328386
Locale.Set(Settings.Prop.Locale);
329387

330388
if (!LaunchSettings.BypassUpdateCheck)

Bloxstrap/AppData/RobloxPlayerData.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class RobloxPlayerData : CommonAppData, IAppData
1616

1717
public override string ExecutableName => "RobloxPlayerBeta.exe";
1818

19-
public override AppState State => App.State.Prop.Player;
19+
public override AppState State => App.RobloxState.Prop.Player;
2020

2121
public override IReadOnlyDictionary<string, string> PackageDirectoryMap { get; set; } = new Dictionary<string, string>()
2222
{

Bloxstrap/AppData/RobloxStudioData.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class RobloxStudioData : CommonAppData, IAppData
1010

1111
public override string ExecutableName => "RobloxStudioBeta.exe";
1212

13-
public override AppState State => App.State.Prop.Studio;
13+
public override AppState State => App.RobloxState.Prop.Studio;
1414

1515
public override IReadOnlyDictionary<string, string> PackageDirectoryMap { get; set; } = new Dictionary<string, string>()
1616
{

Bloxstrap/Bloxstrap.csproj

+12-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<UseWPF>true</UseWPF>
88
<UseWindowsForms>True</UseWindowsForms>
99
<ApplicationIcon>Bloxstrap.ico</ApplicationIcon>
10-
<Version>2.8.6</Version>
11-
<FileVersion>2.8.6</FileVersion>
10+
<Version>2.9.0</Version>
11+
<FileVersion>2.9.0</FileVersion>
1212
<ApplicationManifest>app.manifest</ApplicationManifest>
1313
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1414
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
@@ -25,9 +25,14 @@
2525
<Resource Include="Resources\MessageBox\Information.png" />
2626
<Resource Include="Resources\MessageBox\Question.png" />
2727
<Resource Include="Resources\MessageBox\Warning.png" />
28+
<EmbeddedResource Include="UI\Style\Editor-Theme-Dark.xshd" />
29+
<EmbeddedResource Include="UI\Style\Editor-Theme-Light.xshd" />
2830
</ItemGroup>
2931

3032
<ItemGroup>
33+
<EmbeddedResource Include="Resources\CustomBootstrapperSchema.json" />
34+
<EmbeddedResource Include="Resources\CustomBootstrapperTemplate_Blank.xml" />
35+
<EmbeddedResource Include="Resources\CustomBootstrapperTemplate_Simple.xml" />
3136
<EmbeddedResource Include="Resources\Icon2008.ico" />
3237
<EmbeddedResource Include="Resources\Icon2011.ico" />
3338
<EmbeddedResource Include="Resources\Icon2017.ico" />
@@ -49,16 +54,18 @@
4954
</ItemGroup>
5055

5156
<ItemGroup>
52-
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
57+
<PackageReference Include="AvalonEdit" Version="6.3.0.90" />
58+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
5359
<PackageReference Include="DiscordRichPresence" Version="1.2.1.24" />
54-
<PackageReference Include="Markdig" Version="0.37.0" />
55-
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
60+
<PackageReference Include="Markdig" Version="0.40.0" />
61+
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183">
5662
<!--<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>-->
5763
<PrivateAssets>all</PrivateAssets>
5864
</PackageReference>
5965
<PackageReference Include="securifybv.ShellLink" Version="0.1.0" />
6066
<PackageReference Include="SharpZipLib" Version="1.4.2" />
6167
<PackageReference Include="System.Resources.ResourceManager" Version="4.3.0" />
68+
<PackageReference Include="XamlAnimatedGif" Version="2.3.0" />
6269
</ItemGroup>
6370

6471
<ItemGroup>

0 commit comments

Comments
 (0)