Skip to content

Commit 6772f25

Browse files
committed
try arm 64 build
- Specify ARM64 target - Everything Search will return an error
1 parent 2afebcb commit 6772f25

File tree

5 files changed

+33
-10
lines changed

5 files changed

+33
-10
lines changed

Flow.Launcher/Flow.Launcher.csproj

+7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@
3838
<Prefer32Bit>false</Prefer32Bit>
3939
</PropertyGroup>
4040

41+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM64' ">
42+
<DefineConstants>ARM64;$(DefineConstants)</DefineConstants>
43+
</PropertyGroup>
44+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM64' ">
45+
<DefineConstants>ARM64;$(DefineConstants)</DefineConstants>
46+
</PropertyGroup>
47+
4148
<ItemGroup>
4249
<ApplicationDefinition Remove="App.xaml" />
4350
</ItemGroup>

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
<!-- Everything -->
128128
<system:String x:Key="flowlauncher_plugin_everything_sdk_issue">Failed to load Everything SDK</system:String>
129129
<system:String x:Key="flowlauncher_plugin_everything_is_not_running">Warning: Everything service is not running</system:String>
130+
<system:String x:Key="flowlauncher_plugin_everything_arm64_not_supported">ARM64 is not supported for everything.</system:String>
130131
<system:String x:Key="flowlauncher_plugin_everything_query_error">Error while querying Everything</system:String>
131132
<system:String x:Key="flowlauncher_plugin_everything_sort_by">Sort By</system:String>
132133
<system:String x:Key="flowlauncher_plugin_everything_sort_by_name">Name</system:String>

Plugins/Flow.Launcher.Plugin.Explorer/Main.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ public Task InitAsync(PluginInitContext context)
4242
contextMenu = new ContextMenu(Context, Settings, viewModel);
4343
searchManager = new SearchManager(Settings, Context);
4444
ResultManager.Init(Context, Settings);
45-
45+
4646
SortOptionTranslationHelper.API = context.API;
4747

48+
#if !ARM64
4849
EverythingApiDllImport.Load(Path.Combine(Context.CurrentPluginMetadata.PluginDirectory, "EverythingSDK",
4950
Environment.Is64BitProcess ? "x64" : "x86"));
51+
#endif
5052
return Task.CompletedTask;
5153
}
5254

@@ -75,7 +77,7 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
7577
IcoPath = e is EngineNotAvailableException { ErrorIcon: { } iconPath }
7678
? iconPath
7779
: Constants.GeneralSearchErrorImagePath,
78-
AsyncAction = e is EngineNotAvailableException {Action: { } action}
80+
AsyncAction = e is EngineNotAvailableException { Action: { } action }
7981
? action
8082
: _ =>
8183
{

Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs

+20-7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ public EverythingSearchManager(Settings settings)
2020

2121
private async ValueTask ThrowIfEverythingNotAvailableAsync(CancellationToken token = default)
2222
{
23+
#if ARM64
24+
throw new EngineNotAvailableException(
25+
Enum.GetName(Settings.IndexSearchEngineOption.Everything)!,
26+
"ARM64 is not supported",
27+
Main.Context.API.GetTranslation("flowlauncher_plugin_everything_not_support_arm64"),
28+
Constants.EverythingErrorImagePath,
29+
_ => ValueTask.FromResult(false));
30+
#endif
31+
2332
try
2433
{
2534
if (!await EverythingApi.IsEverythingRunningAsync(token))
@@ -42,7 +51,9 @@ private async ValueTask ThrowIfEverythingNotAvailableAsync(CancellationToken tok
4251

4352
private async ValueTask<bool> ClickToInstallEverythingAsync(ActionContext _)
4453
{
45-
var installedPath = await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath, Main.Context.API);
54+
var installedPath =
55+
await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath,
56+
Main.Context.API);
4657

4758
if (installedPath == null)
4859
{
@@ -57,17 +68,18 @@ private async ValueTask<bool> ClickToInstallEverythingAsync(ActionContext _)
5768
return true;
5869
}
5970

60-
public async IAsyncEnumerable<SearchResult> SearchAsync(string search, [EnumeratorCancellation] CancellationToken token)
71+
public async IAsyncEnumerable<SearchResult> SearchAsync(string search,
72+
[EnumeratorCancellation] CancellationToken token)
6173
{
6274
await ThrowIfEverythingNotAvailableAsync(token);
6375

6476
if (token.IsCancellationRequested)
6577
yield break;
6678

67-
var option = new EverythingSearchOption(search,
68-
Settings.SortOption,
69-
MaxCount: Settings.MaxResult,
70-
IsFullPathSearch: Settings.EverythingSearchFullPath,
79+
var option = new EverythingSearchOption(search,
80+
Settings.SortOption,
81+
MaxCount: Settings.MaxResult,
82+
IsFullPathSearch: Settings.EverythingSearchFullPath,
7183
IsRunCounterEnabled: Settings.EverythingEnableRunCount);
7284

7385
await foreach (var result in EverythingApi.SearchAsync(option, token))
@@ -110,7 +122,8 @@ public async IAsyncEnumerable<SearchResult> ContentSearchAsync(string plainSearc
110122
}
111123
}
112124

113-
public async IAsyncEnumerable<SearchResult> EnumerateAsync(string path, string search, bool recursive, [EnumeratorCancellation] CancellationToken token)
125+
public async IAsyncEnumerable<SearchResult> EnumerateAsync(string path, string search, bool recursive,
126+
[EnumeratorCancellation] CancellationToken token)
114127
{
115128
await ThrowIfEverythingNotAvailableAsync(token);
116129

Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.FileContentSearchActionKey
9999
case false
100100
when ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword)
101101
|| ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword):
102-
102+
103103
searchResults = Settings.IndexProvider.SearchAsync(query.Search, token);
104104
engineName = Enum.GetName(Settings.IndexSearchEngine);
105105
break;

0 commit comments

Comments
 (0)