Skip to content

Commit 117e6a7

Browse files
committed
LuaInstaller.EndUsers: only allow native builds to be selected on radiobuttons
1 parent 53a04e3 commit 117e6a7

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

LuaInstaller/MainWindow.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373

7474
<Label Grid.Column="0" Grid.Row="0" Content="Platform"/>
7575
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal">
76-
<RadioButton VerticalContentAlignment="Center" Content="x86" Margin="0,0,5,0" IsChecked="{Binding Platform, Converter={StaticResource archConverter}, ConverterParameter=x86}"/>
77-
<RadioButton VerticalContentAlignment="Center" Content="x64" Margin="5,0,0,0" IsChecked="{Binding Platform, Converter={StaticResource archConverter}, ConverterParameter=x64}"/>
78-
<RadioButton VerticalContentAlignment="Center" Content="ARM64" Margin="5,0,0,0" IsChecked="{Binding Platform, Converter={StaticResource archConverter}, ConverterParameter=ARM64}"/>
76+
<RadioButton VerticalContentAlignment="Center" Content="x86" Margin="0,0,5,0" IsEnabled="{Binding Isx86x64}" IsChecked="{Binding Platform, Converter={StaticResource archConverter}, ConverterParameter=x86}"/>
77+
<RadioButton VerticalContentAlignment="Center" Content="x64" Margin="5,0,0,0" IsEnabled="{Binding Isx86x64}" IsChecked="{Binding Platform, Converter={StaticResource archConverter}, ConverterParameter=x64}"/>
78+
<RadioButton VerticalContentAlignment="Center" Content="ARM64" Margin="5,0,0,0" IsEnabled="{Binding IsArm64}" IsChecked="{Binding Platform, Converter={StaticResource archConverter}, ConverterParameter=ARM64}"/>
7979
</StackPanel>
8080

8181
<Label Grid.Column="0" Grid.Row="2" Content="Installation Directory"/>

LuaInstaller/ViewModels/LuaInstallerViewModel.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public class LuaInstallerViewModel : INotifyPropertyChanged
3131
private string status;
3232
private InstallationProgress progress;
3333

34+
private bool isArm64;
35+
3436
public Architecture Platform
3537
{
3638
get
@@ -276,13 +278,32 @@ public string InstallerVersion
276278
}
277279
}
278280

281+
public bool IsArm64
282+
{
283+
get
284+
{
285+
return isArm64;
286+
}
287+
}
288+
289+
public bool Isx86x64
290+
{
291+
get
292+
{
293+
return !isArm64;
294+
}
295+
}
296+
279297
public LuaInstallerViewModel()
280298
{
281299
components = new InstalledComponents();
282300

283301
refreshCommand = new RefreshCommand();
284302
installCommand = new InstallCommand();
285303

304+
platform = ArchitectureSelector.Instance.Architecture;
305+
isArm64 = platform == Architecture.ARM64;
306+
286307
status = string.Empty;
287308
progress = InstallationProgress.None;
288309
setEnvironmentVariables = false;
@@ -302,8 +323,6 @@ public LuaInstallerViewModel()
302323
selectedLuaVersion = luaVersions[0];
303324
}
304325

305-
platform = ArchitectureSelector.Instance.Architecture;
306-
307326
IVisualStudioEnumeration vsEnum = components.AllVisualStudioByArch(platform);
308327

309328
visualStudioVersions = new ObservableCollection<VisualStudio>(

0 commit comments

Comments
 (0)