Skip to content

Commit 9d3888f

Browse files
authored
Merge pull request #3655 from Flow-Launcher/everything_installation_issue_tip
Catch exception when installing Everything
2 parents 6c4e948 + 7d5001d commit 9d3888f

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@
162162
<system:String x:Key="flowlauncher_plugin_everything_enable_content_search">Do you want to enable content search for Everything?</system:String>
163163
<system:String x:Key="flowlauncher_plugin_everything_enable_content_search_tips">It can be very slow without index (which is only supported in Everything v1.5+)</system:String>
164164

165+
<system:String x:Key="flowlauncher_plugin_everything_not_found">Unable to find Everything.exe</system:String>
166+
<system:String x:Key="flowlauncher_plugin_everything_install_issue">Failed to install Everything, please install it manually</system:String>
167+
165168
<!-- Native Context Menu -->
166169
<system:String x:Key="plugin_explorer_native_context_menu_header">Native Context Menu</system:String>
167170
<system:String x:Key="plugin_explorer_native_context_menu_display_context_menu">Display native context menu (experimental)</system:String>

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

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything
1111
{
1212
public class EverythingSearchManager : IIndexProvider, IContentIndexProvider, IPathIndexProvider
1313
{
14+
private static readonly string ClassName = nameof(EverythingSearchManager);
15+
1416
private Settings Settings { get; }
1517

1618
public EverythingSearchManager(Settings settings)
@@ -42,19 +44,32 @@ private async ValueTask ThrowIfEverythingNotAvailableAsync(CancellationToken tok
4244

4345
private async ValueTask<bool> ClickToInstallEverythingAsync(ActionContext _)
4446
{
45-
var installedPath = await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath, Main.Context.API);
47+
try
48+
{
49+
var installedPath = await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath, Main.Context.API);
50+
51+
if (installedPath == null)
52+
{
53+
Main.Context.API.ShowMsgError(Main.Context.API.GetTranslation("flowlauncher_plugin_everything_not_found"));
54+
Main.Context.API.LogError(ClassName, "Unable to find Everything.exe");
55+
56+
return false;
57+
}
4658

47-
if (installedPath == null)
59+
Settings.EverythingInstalledPath = installedPath;
60+
Process.Start(installedPath, "-startup");
61+
62+
return true;
63+
}
64+
// Sometimes Everything installation will fail because of permission issues or file not found issues
65+
// Just let the user know that Everything is not installed properly and ask them to install it manually
66+
catch (Exception e)
4867
{
49-
Main.Context.API.ShowMsgError("Unable to find Everything.exe");
68+
Main.Context.API.ShowMsgError(Main.Context.API.GetTranslation("flowlauncher_plugin_everything_install_issue"));
69+
Main.Context.API.LogException(ClassName, "Failed to install Everything", e);
5070

5171
return false;
5272
}
53-
54-
Settings.EverythingInstalledPath = installedPath;
55-
Process.Start(installedPath, "-startup");
56-
57-
return true;
5873
}
5974

6075
public async IAsyncEnumerable<SearchResult> SearchAsync(string search, [EnumeratorCancellation] CancellationToken token)

0 commit comments

Comments
 (0)