Skip to content

Commit

Permalink
Removed x86 and AnyCPU Support
Browse files Browse the repository at this point in the history
  • Loading branch information
CarJem committed Jun 30, 2021
1 parent 47201f8 commit 867b814
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
Binary file modified .vs/BedrockLauncher.Installer/v16/.suo
Binary file not shown.
8 changes: 4 additions & 4 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
Title="{DynamicResource Installer_Title}" Height="450" Width="800" WindowStyle="ThreeDBorderWindow" Foreground="White" Background="#FF212121" ResizeMode="CanMinimize" MouseDown="Window_MouseDown" Icon="icon.ico" Initialized="Window_Initialized">
<Grid Margin="0">
<Frame x:Name="MainFrame" Background="#FF1B1B1B" BorderBrush="Gray" BorderThickness="0,0,0,1" Margin="0,0,0,50" NavigationUIVisibility="Hidden" Source="/BedrockLauncher.Installer;component/Pages/LanguageSelectPage.xaml"></Frame>
<Button x:Name="CancelBtn" Style="{DynamicResource DialogButton}" Foreground="White" FontFamily="Arial" FontSize="13" FontWeight="Bold" Click="CancelBtn_Click" Content="{DynamicResource Installer_Cancel_Text}" Margin="0,0,10,10" Width="100" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
<Button x:Name="NextBtn" Style="{DynamicResource DialogButton}" Foreground="White" FontFamily="Arial" FontSize="13" FontWeight="Bold" Click="NextBtn_Click" Content="{DynamicResource Installer_Next_Text}" Margin="0,0,130,10" Width="100" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
<Button x:Name="BackBtn" Style="{DynamicResource DialogButton}" Foreground="White" FontFamily="Arial" FontSize="13" FontWeight="Bold" Click="BackBtn_Click" IsEnabled="False" Content="{DynamicResource Installer_Back_Text}" Margin="0,0,240,10" Width="100" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
<Button x:Name="FinishBtn" Style="{DynamicResource DialogButton}" Visibility="Hidden" Foreground="White" FontFamily="Arial" FontSize="13" FontWeight="Bold" Content="{DynamicResource Installer_Finish_Text}" Margin="0,0,10,10" Width="100" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
<Button x:Name="CancelBtn" Style="{DynamicResource DialogButton}" Foreground="{DynamicResource NormalText}" FontFamily="Arial" FontSize="13" FontWeight="Bold" Click="CancelBtn_Click" Content="{DynamicResource Installer_Cancel_Text}" Margin="0,0,10,10" Width="100" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
<Button x:Name="NextBtn" Style="{DynamicResource DialogButton}" Foreground="{DynamicResource NormalText}" FontFamily="Arial" FontSize="13" FontWeight="Bold" Click="NextBtn_Click" Content="{DynamicResource Installer_Next_Text}" Margin="0,0,130,10" Width="100" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
<Button x:Name="BackBtn" Style="{DynamicResource DialogButton}" Foreground="{DynamicResource NormalText}" FontFamily="Arial" FontSize="13" FontWeight="Bold" Click="BackBtn_Click" IsEnabled="False" Content="{DynamicResource Installer_Back_Text}" Margin="0,0,240,10" Width="100" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
<Button x:Name="FinishBtn" Style="{DynamicResource DialogButton}" Visibility="Hidden" Foreground="{DynamicResource NormalText}" FontFamily="Arial" FontSize="13" FontWeight="Bold" Content="{DynamicResource Installer_Finish_Text}" Margin="0,0,10,10" Width="100" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
</Grid>
</Window>
37 changes: 37 additions & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System.Diagnostics;
using System.Reflection;
using BedrockLauncher.Installer.Classes;
using System.Runtime.InteropServices;

namespace BedrockLauncher.Installer
{
Expand Down Expand Up @@ -134,8 +135,44 @@ void ShowError()
}
}

public static bool ArchitextureTest()
{
var Architecture = RuntimeInformation.OSArchitecture;
bool canRun;
switch (Architecture)
{
case Architecture.Arm:
ShowError("Unsupported Architexture", "This application can not run on ARM computers");
canRun = false;
break;
case Architecture.Arm64:
ShowError("Unsupported Architexture", "This application can not run on ARM computers");
canRun = false;
break;
case Architecture.X86:
ShowError("Unsupported Architexture", "This application can not run on x86 / 32-bit computers");
canRun = false;
break;
case Architecture.X64:
canRun = true;
break;
default:
ShowError("Unsupported Architexture", "Unable to determine architexture, not supported");
canRun = false;
break;
}
return canRun;


void ShowError(string title, string message)
{
MessageBox.Show(message, title);
}
}

private void Window_Initialized(object sender, EventArgs e)
{
if (ArchitextureTest() == false) Environment.Exit(0);
Installer.ProgressPage = installationProgressPage;
string[] ConsoleArgs = Environment.GetCommandLineArgs();
bool isSilent = false;
Expand Down
4 changes: 4 additions & 0 deletions Resources/styles/values.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

</ResourceDictionary>

0 comments on commit 867b814

Please sign in to comment.