Skip to content

Commit f6a6358

Browse files
stefansjfwjaimecbernardocrutkas
authored
[CmdNotFound]Disable on Arm64 as there is no MSI installer for PowerShell 7.4 yet (#30759)
* [Command Not Found] Disable on Arm64 * Hide deps * Update src/settings-ui/Settings.UI/Strings/en-us/Resources.resw Co-authored-by: Jaime Bernardo <[email protected]> * Update Resources.resw --------- Co-authored-by: Jaime Bernardo <[email protected]> Co-authored-by: Clint Rutkas <[email protected]>
1 parent a7907ff commit f6a6358

File tree

3 files changed

+48
-28
lines changed

3 files changed

+48
-28
lines changed

src/settings-ui/Settings.UI/SettingsXAML/Views/CmdNotFoundPage.xaml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
TrueValue="Collapsed" />
1818
<toolkitConverters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
1919
</Page.Resources>
20-
<custom:SettingsPageControl x:Uid="CmdNotFound" ModuleImageSource="ms-appx:///Assets/Settings/Modules/CmdNotFound.png">
20+
<custom:SettingsPageControl
21+
x:Uid="CmdNotFound"
22+
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsArm64Arch, Converter={StaticResource BoolNegationConverter}}"
23+
ModuleImageSource="ms-appx:///Assets/Settings/Modules/CmdNotFound.png">
2124
<custom:SettingsPageControl.ModuleContent>
2225
<StackPanel ChildrenTransitions="{StaticResource SettingsCardsAnimations}" Orientation="Vertical">
2326
<InfoBar
@@ -56,24 +59,32 @@
5659
</controls:Case>
5760
</controls:SwitchPresenter>
5861
<controls:SettingsExpander.ItemsHeader>
59-
<InfoBar
60-
x:Uid="CmdNotFound_RequirementsBar"
61-
BorderThickness="0"
62-
CornerRadius="0"
63-
IsClosable="False"
64-
IsOpen="True">
65-
<InfoBar.ActionButton>
66-
<HyperlinkButton x:Uid="CmdNotFound_CheckCompatibility" Command="{x:Bind ViewModel.CheckRequirementsEventHandler}">
67-
<ToolTipService.ToolTip>
68-
<TextBlock x:Uid="CmdNotFound_CheckCompatibilityTooltip" TextWrapping="Wrap" />
69-
</ToolTipService.ToolTip>
70-
</HyperlinkButton>
71-
</InfoBar.ActionButton>
72-
</InfoBar>
62+
<StackPanel>
63+
<InfoBar
64+
x:Uid="CmdNotFound_RequirementsBar"
65+
BorderThickness="0"
66+
CornerRadius="0"
67+
IsClosable="False"
68+
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.IsArm64Arch, Converter={StaticResource BoolNegationConverter}}">
69+
<InfoBar.ActionButton>
70+
<HyperlinkButton x:Uid="CmdNotFound_CheckCompatibility" Command="{x:Bind ViewModel.CheckRequirementsEventHandler}">
71+
<ToolTipService.ToolTip>
72+
<TextBlock x:Uid="CmdNotFound_CheckCompatibilityTooltip" TextWrapping="Wrap" />
73+
</ToolTipService.ToolTip>
74+
</HyperlinkButton>
75+
</InfoBar.ActionButton>
76+
</InfoBar>
77+
<InfoBar
78+
x:Uid="CmdNotFound_Arm64ArchBar"
79+
BorderThickness="0"
80+
CornerRadius="0"
81+
IsClosable="False"
82+
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.IsArm64Arch}" />
83+
</StackPanel>
7384
</controls:SettingsExpander.ItemsHeader>
7485
<controls:SettingsExpander.Items>
7586

76-
<controls:SettingsCard x:Uid="CmdNotFound_PowerShellDetection">
87+
<controls:SettingsCard x:Uid="CmdNotFound_PowerShellDetection" Visibility="{x:Bind Mode=OneWay, Path=ViewModel.IsArm64Arch, Converter={StaticResource BoolToInvertedVisibilityConverter}}">
7788
<controls:SwitchPresenter TargetType="x:Boolean" Value="{x:Bind ViewModel.IsPowerShell7Detected, Mode=OneWay}">
7889
<controls:Case Value="True">
7990
<StackPanel Orientation="Horizontal" Spacing="8">
@@ -104,7 +115,7 @@
104115
</controls:SwitchPresenter>
105116
</controls:SettingsCard>
106117

107-
<controls:SettingsCard x:Uid="CmdNotFound_WinGetClientDetection">
118+
<controls:SettingsCard x:Uid="CmdNotFound_WinGetClientDetection" Visibility="{x:Bind Mode=OneWay, Path=ViewModel.IsArm64Arch, Converter={StaticResource BoolToInvertedVisibilityConverter}}">
108119
<controls:SwitchPresenter TargetType="x:Boolean" Value="{x:Bind ViewModel.IsWinGetClientModuleDetected, Mode=OneWay}">
109120
<controls:Case Value="True">
110121
<StackPanel Orientation="Horizontal" Spacing="8">

src/settings-ui/Settings.UI/Strings/en-us/Resources.resw

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3677,16 +3677,16 @@ Activate by holding the key for the character you want to add an accent to, then
36773677
<value>Command Not Found</value>
36783678
<comment>"Command Not Found" is a product name</comment>
36793679
</data>
3680-
<data name="InstalledLabel.Text" xml:space="preserve">
3680+
<data name="InstalledLabel.Text" xml:space="preserve">
36813681
<value>Installed</value>
36823682
</data>
3683-
<data name="DetectedLabel.Text" xml:space="preserve">
3683+
<data name="DetectedLabel.Text" xml:space="preserve">
36843684
<value>Detected</value>
36853685
</data>
3686-
<data name="NotDetectedLabel.Text" xml:space="preserve">
3686+
<data name="NotDetectedLabel.Text" xml:space="preserve">
36873687
<value>Not detected</value>
36883688
</data>
3689-
<data name="CmdNotFound_RequirementsBar.Title" xml:space="preserve">
3689+
<data name="CmdNotFound_RequirementsBar.Title" xml:space="preserve">
36903690
<value>The following components are required</value>
36913691
</data>
36923692
<data name="CmdNotFound_PowerShellDetection.Header" xml:space="preserve">
@@ -3695,11 +3695,11 @@ Activate by holding the key for the character you want to add an accent to, then
36953695
<data name="CmdNotFound_WinGetClientDetection.Header" xml:space="preserve">
36963696
<value>WinGet Client PowerShell module</value>
36973697
</data>
3698-
<data name="CmdNotFound_Enable.Header" xml:space="preserve">
3698+
<data name="CmdNotFound_Enable.Header" xml:space="preserve">
36993699
<value>Command Not Found</value>
37003700
<comment>"Command Not Found" is a product name</comment>
37013701
</data>
3702-
<data name="CmdNotFound_Enable.Description" xml:space="preserve">
3702+
<data name="CmdNotFound_Enable.Description" xml:space="preserve">
37033703
<value>Add this module to the PowerShell 7 profile script so that it is enabled with every new session</value>
37043704
</data>
37053705
<data name="CmdNotFound_ModuleInstallationLogs.Text" xml:space="preserve">
@@ -3708,16 +3708,16 @@ Activate by holding the key for the character you want to add an accent to, then
37083708
<data name="CmdNotFound_CheckPowerShellVersionButtonControl.Description" xml:space="preserve">
37093709
<value>PowerShell 7 is required to use this module</value>
37103710
</data>
3711-
<data name="CmdNotFound_CheckCompatibility.Content" xml:space="preserve">
3711+
<data name="CmdNotFound_CheckCompatibility.Content" xml:space="preserve">
37123712
<value>Refresh</value>
37133713
</data>
3714-
<data name="CmdNotFound_CheckCompatibilityTooltip.Text" xml:space="preserve">
3714+
<data name="CmdNotFound_CheckCompatibilityTooltip.Text" xml:space="preserve">
37153715
<value>Check if your PowerShell configuration is compatible and configured correctly</value>
37163716
</data>
3717-
<data name="CmdNotFound_InstallButton.Content" xml:space="preserve">
3717+
<data name="CmdNotFound_InstallButton.Content" xml:space="preserve">
37183718
<value>Install</value>
37193719
</data>
3720-
<data name="CmdNotFound_UninstallButton.Content" xml:space="preserve">
3720+
<data name="CmdNotFound_UninstallButton.Content" xml:space="preserve">
37213721
<value>Uninstall</value>
37223722
</data>
37233723
<data name="Oobe_CmdNotFound.Description" xml:space="preserve">
@@ -3998,4 +3998,7 @@ Activate by holding the key for the character you want to add an accent to, then
39983998
<data name="PowerLauncher_TextFontSizeSlider.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
39993999
<value>Text size of result titles</value>
40004000
</data>
4001-
</root>
4001+
<data name="CmdNotFound_Arm64ArchBar.Title" xml:space="preserve">
4002+
<value>Command Not Found is not supported on the ARM64 architecture currently. We are actively working on a solution.</value>
4003+
</data>
4004+
</root>

src/settings-ui/Settings.UI/ViewModels/CmdNotFoundViewModel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Diagnostics;
77
using System.IO;
88
using System.Reflection;
9+
using System.Runtime.InteropServices;
910
using global::PowerToys.GPOWrapper;
1011
using ManagedCommon;
1112
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
@@ -123,6 +124,11 @@ public bool IsEnabledGpoConfigured
123124
get => _enabledStateIsGPOConfigured;
124125
}
125126

127+
public bool IsArm64Arch
128+
{
129+
get => RuntimeInformation.OSArchitecture == System.Runtime.InteropServices.Architecture.Arm64;
130+
}
131+
126132
public string RunPowerShellScript(string powershellExecutable, string powershellArguments, bool hidePowerShellWindow = false)
127133
{
128134
string outputLog = string.Empty;

0 commit comments

Comments
 (0)