Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

Commit 1c2eaa8

Browse files
committed
keep original launch hidden behaviour
1 parent 5f575a3 commit 1c2eaa8

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

Main.cs

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,7 @@ public List<Result> Query(Query query)
5858
Action = _ =>
5959
{
6060
if (_settings.EverythingInstalledPath.FileExists())
61-
{
62-
Process.Start(new ProcessStartInfo
63-
{
64-
FileName = _settings.EverythingInstalledPath,
65-
Arguments = $"{(_settings.LaunchHidden ? "-startup" : "")}"
66-
})?.Dispose();
67-
}
61+
_context.API.OpenDirectory(_settings.EverythingInstalledPath);
6862

6963
return true;
7064
}
@@ -113,7 +107,27 @@ private Result CreateResult(string keyword, SearchResult searchResult)
113107
switch (searchResult.Type)
114108
{
115109
case ResultType.Folder:
116-
_context.API.OpenDirectory(path);
110+
if (!_settings.LaunchHidden)
111+
{
112+
_context.API.OpenDirectory(path);
113+
}
114+
else
115+
{
116+
// Launch hidden is no longer supported due to API change.
117+
// This the default behaviour kept
118+
ProcessStartInfo startInfo = new ProcessStartInfo();
119+
//Hide the process
120+
startInfo.UseShellExecute = false;
121+
startInfo.RedirectStandardOutput = true;
122+
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
123+
startInfo.CreateNoWindow = true;
124+
//Set file and args
125+
startInfo.FileName = "explorer";
126+
startInfo.Arguments = $"\"{path}\"";
127+
//Start the process
128+
Process proc = Process.Start(startInfo);
129+
}
130+
117131
break;
118132
case ResultType.Volume:
119133
case ResultType.File:

0 commit comments

Comments
 (0)