Enhanced ARM64 support and code cleanup

- Updated `Community.PowerToys.Run.Plugin.Everything.csproj` for better `x64` and `ARM64` support, including platform-specific constants and simplified resource management.

- Improved `ARM64` build process in `PostBuild` event, including automatic replacement of `Everything64.dll` with `EverythingARM64.dll`.

- Streamlined result processing in `Everything.cs` for efficiency and readability, using direct paths and filenames from the Everything SDK.

- Reverted to `[DllImport]` in `NativeMethods.cs` for P/Invoke, updating method signatures accordingly.

- Cleaned up `Main.cs` by removing unused `using` directives, handling a new `Prefix` setting, and removing obsolete ARM DLL logic.

- Extended plugin configuration options in `Settings.cs` with a new property for the query prefix and differentiated update logic in `Update.cs` for `x64` and `ARM64` executables.

- Closes #115 #112
This commit is contained in:
Lin Yu-Chieh (Victor) 2024-07-03 22:00:35 +08:00
parent 9f19e814c5
commit 3841365af3
13 changed files with 116 additions and 99 deletions

View File

@ -33,6 +33,14 @@
<DebugType>none</DebugType> <DebugType>none</DebugType>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='x64'">
<DefineConstants>$(DefineConstants);X64</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
<DefineConstants>$(DefineConstants);ARM64</DefineConstants>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="NativeMethods.cs" /> <Compile Remove="NativeMethods.cs" />
</ItemGroup> </ItemGroup>
@ -65,23 +73,14 @@
<EmbeddedResource Update="Properties\Resources.es-es.resx"> <EmbeddedResource Update="Properties\Resources.es-es.resx">
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.de-de.resx"> <EmbeddedResource Update="Properties\Resources.de-de.resx">
<CustomToolNamespace>Community.PowerToys.Run.Plugin.Everything.Language</CustomToolNamespace>
<LastGenOutput>Resources.de.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.zh-cn.resx"> <EmbeddedResource Update="Properties\Resources.zh-cn.resx">
<CustomToolNamespace>Community.PowerToys.Run.Plugin.Everything.Language</CustomToolNamespace>
<LastGenOutput>Resources - Copy.zh.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.resx"> <EmbeddedResource Update="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator> <Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.zh.resx"> <EmbeddedResource Update="Properties\Resources.zh-tw.resx">
<CustomToolNamespace>Community.PowerToys.Run.Plugin.Everything.Language</CustomToolNamespace>
<LastGenOutput>Resources.zh.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
@ -137,7 +136,7 @@
</ItemGroup> </ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> <Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="del /Q &quot;$(TargetDir)*.pdb&quot;&#xD;&#xA;del /Q &quot;$(TargetDir)PowerToys*.dll&quot;&#xD;&#xA;del /Q &quot;$(TargetDir)Wox*.dll&quot;&#xD;&#xA;del /Q &quot;$(TargetDir)Ijwhost.dll&quot;&#xD;&#xA;del /Q &quot;$(TargetDir)*.xml&quot;&#xD;&#xA;del/ Q &quot;$(TargetDir)backup_restore_settings.json&quot;&#xD;&#xA;del /Q &quot;.\bin\CHECKSUM.txt&quot;&#xD;&#xA;copy /y &quot;.\NSIS\MIT.txt&quot; &quot;$(TargetDir)LICENSE.txt&quot;&#xD;&#xA;powershell Compress-Archive -Path $(TargetDir) -DestinationPath .\bin\EverythingPT-$(Version)-x64+ARM64.zip -Force&#xD;&#xA;&quot;C:\Program Files (x86)\NSIS\makensis&quot; /Dver=$(Version) /Ddirect=$(TargetDir) .\NSIS\exeCreator.nsi&#xD;&#xA;certUtil -hashfile .\bin\EverythingPT-$(Version)-x64+ARM64.zip SHA256 &gt;&gt; .\bin\CHECKSUM.txt&#xD;&#xA;certUtil -hashfile .\bin\EverythingPT-$(Version)-x64+ARM64.exe SHA256 &gt;&gt; .\bin\CHECKSUM.txt&#xD;&#xA;rd /Q /S &quot;$(TargetDir)&quot;&#xD;&#xA;rd /Q /S &quot;$(ProjectDir)obj&quot;" /> <Exec Command="if $(Platform) == ARM64 (&#xD;&#xA;del /Q &quot;$(TargetDir)Everything64.dll&quot;&#xD;&#xA;copy /y &quot;$(TargetDir)EverythingARM64.dll&quot; &quot;$(TargetDir)Everything64.dll&quot;&#xD;&#xA;)&#xD;&#xA;del /Q &quot;$(TargetDir)EverythingARM64.dll&quot;&#xD;&#xA;del /Q &quot;$(TargetDir)*.pdb&quot;&#xD;&#xA;del /Q &quot;$(TargetDir)PowerToys*.dll&quot;&#xD;&#xA;del /Q &quot;$(TargetDir)Wox*.dll&quot;&#xD;&#xA;del /Q &quot;$(TargetDir)Ijwhost.dll&quot;&#xD;&#xA;del /Q &quot;$(TargetDir)*.xml&quot;&#xD;&#xA;del/ Q &quot;$(TargetDir)backup_restore_settings.json&quot;&#xD;&#xA;del /Q &quot;.\bin\CHECKSUM.txt&quot;&#xD;&#xA;copy /y &quot;.\NSIS\MIT.txt&quot; &quot;$(TargetDir)LICENSE.txt&quot;&#xD;&#xA;powershell Compress-Archive -Path $(TargetDir) -DestinationPath .\bin\EverythingPT-$(Version)-$(Platform).zip -Force&#xD;&#xA;&quot;C:\Program Files (x86)\NSIS\makensis&quot; /Dver=$(Version) /Ddirect=$(TargetDir) /Dplatform=$(Platform) .\NSIS\exeCreator.nsi&#xD;&#xA;certUtil -hashfile .\bin\EverythingPT-$(Version)-$(Platform).zip SHA256 &gt;&gt; .\bin\CHECKSUM.txt&#xD;&#xA;certUtil -hashfile .\bin\EverythingPT-$(Version)-$(Platform).exe SHA256 &gt;&gt; .\bin\CHECKSUM.txt&#xD;&#xA;rd /Q /S &quot;$(TargetDir)&quot;&#xD;&#xA;rd /Q /S &quot;$(ProjectDir)obj&quot;" />
</Target> </Target>
</Project> </Project>

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Runtime.InteropServices;
using Community.PowerToys.Run.Plugin.Everything.Properties; using Community.PowerToys.Run.Plugin.Everything.Properties;
using Wox.Plugin; using Wox.Plugin;
using static Community.PowerToys.Run.Plugin.Everything.Interop.NativeMethods; using static Community.PowerToys.Run.Plugin.Everything.Interop.NativeMethods;
@ -13,7 +14,7 @@ namespace Community.PowerToys.Run.Plugin.Everything
{ {
internal Everything(Settings setting) internal Everything(Settings setting)
{ {
Everything_SetRequestFlags(Request.FULL_PATH_AND_FILE_NAME); Everything_SetRequestFlags(Request.FILE_NAME | Request.PATH);
UpdateSettings(setting); UpdateSettings(setting);
} }
@ -30,14 +31,18 @@ namespace Community.PowerToys.Run.Plugin.Everything
if (setting.Log > LogLevel.None) if (setting.Log > LogLevel.None)
{ {
Debugger.Write($"\r\n\r\nNew Query: {query}\r\n" + Debugger.Write($"\r\n\r\nNew Query: {query}\r\n" +
$"Prefix {setting.Prefix} | " +
$"Sort {(int)setting.Sort}_{Everything_GetSort()} | " + $"Sort {(int)setting.Sort}_{Everything_GetSort()} | " +
$"Max {setting.Max}_{Everything_GetMax()} | " + $"Max {setting.Max}_{Everything_GetMax()} | " +
$"Match Path {setting.MatchPath}_{Everything_GetMatchPath()} | " + $"Match Path {setting.MatchPath}_{Everything_GetMatchPath()} | " +
$"Regex {setting.RegEx}_{Everything_GetRegex()}"); $"Regex {setting.RegEx}_{Everything_GetRegex()}");
} }
if (!string.IsNullOrEmpty(setting.Prefix))
query = setting.Prefix + query;
string orgqry = query; string orgqry = query;
if (setting.EnvVar && orgqry.Contains('%')) if (setting.EnvVar && orgqry.Contains('%'))
{ {
query = Environment.ExpandEnvironmentVariables(query).Replace(';', '|'); query = Environment.ExpandEnvironmentVariables(query).Replace(';', '|');
@ -76,16 +81,16 @@ namespace Community.PowerToys.Run.Plugin.Everything
if (setting.Log > LogLevel.None) if (setting.Log > LogLevel.None)
Debugger.Write($"\r\n===== RESULT #{i} ====="); Debugger.Write($"\r\n===== RESULT #{i} =====");
char[] buffer = new char[32767]; string name = Marshal.PtrToStringUni(Everything_GetResultFileNameW(i));
uint length = Everything_GetResultFullPathNameW(i, buffer, (uint)buffer.Length); string path = Marshal.PtrToStringUni(Everything_GetResultPathW(i));
string fullPath = Path.Combine(path, name);
string fullPath = new(buffer, 0, (int)length);
if (setting.Log > LogLevel.None) if (setting.Log > LogLevel.None)
Debugger.Write($"{length} {(setting.Log == LogLevel.Verbose ? fullPath : string.Empty)}"); Debugger.Write($"{fullPath.Length} {(setting.Log == LogLevel.Verbose ? fullPath : string.Empty)}");
string name = Path.GetFileName(fullPath);
bool isFolder = Everything_IsFolderResult(i);
string path = isFolder ? fullPath : Path.GetDirectoryName(fullPath); bool isFolder = Everything_IsFolderResult(i);
if (isFolder)
path = fullPath;
string ext = Path.GetExtension(fullPath.Replace(".lnk", string.Empty)); string ext = Path.GetExtension(fullPath.Replace(".lnk", string.Empty));
if (setting.Log > LogLevel.None) if (setting.Log > LogLevel.None)
Debugger.Write($"Folder: {isFolder}\r\nFile Path {(setting.Log == LogLevel.Verbose ? path : path.Length)}\r\nFile Name {(setting.Log == LogLevel.Verbose ? name : name.Length)}\r\nExt: {ext}"); Debugger.Write($"Folder: {isFolder}\r\nFile Path {(setting.Log == LogLevel.Verbose ? path : path.Length)}\r\nFile Name {(setting.Log == LogLevel.Verbose ? name : name.Length)}\r\nExt: {ext}");
@ -114,7 +119,7 @@ namespace Community.PowerToys.Run.Plugin.Everything
try try
{ {
process.Start(); process.Start();
_ = Everything_IncRunCountFromFileNameW(fullPath); _ = Everything_IncRunCountFromFileName(fullPath);
return true; return true;
} }
catch (Win32Exception) catch (Win32Exception)

View File

@ -13,3 +13,5 @@ using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1633:File should have header", Justification = "Reviewed")] [assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1633:File should have header", Justification = "Reviewed")]
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1636:FileHeaderCopyrightTextMustMatch", Justification = "Reviewed.")] [assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1636:FileHeaderCopyrightTextMustMatch", Justification = "Reviewed.")]
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1010:Opening square brackets should be spaced correctly", Justification = "Reviewed")] [assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1010:Opening square brackets should be spaced correctly", Justification = "Reviewed")]
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1005:Single line comments should begin with single space", Justification = "Reviewed")]
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1512:Single-line comments should not be followed by blank line", Justification = "Reviewed")]

View File

@ -3,7 +3,7 @@ using System.Runtime.InteropServices;
namespace Community.PowerToys.Run.Plugin.Everything.Interop namespace Community.PowerToys.Run.Plugin.Everything.Interop
{ {
public sealed partial class NativeMethods public sealed class NativeMethods
{ {
#region FlagsEnums #region FlagsEnums
[Flags] [Flags]
@ -106,40 +106,38 @@ namespace Community.PowerToys.Run.Plugin.Everything.Interop
} }
#endregion #endregion
internal const string dllName = "Everything64.dll"; internal const string dllName = "Everything64.dll";
[LibraryImport(dllName)] [DllImport(dllName)]
internal static partial uint Everything_GetNumResults(); internal static extern uint Everything_GetNumResults();
[LibraryImport(dllName)] [DllImport(dllName)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool Everything_GetMatchPath(); internal static extern bool Everything_GetMatchPath();
[LibraryImport(dllName)] [DllImport(dllName)]
internal static partial uint Everything_GetMax(); internal static extern uint Everything_GetMax();
[LibraryImport(dllName)] [DllImport(dllName)]
[return: MarshalAs(UnmanagedType.Bool)] internal static extern bool Everything_GetRegex();
internal static partial bool Everything_GetRegex(); [DllImport(dllName, CharSet = CharSet.Unicode)]
[LibraryImport(dllName, StringMarshalling = StringMarshalling.Utf16)] internal static extern IntPtr Everything_GetResultFileNameW(uint nIndex);
internal static partial uint Everything_GetResultFullPathNameW(uint nIndex, [Out] char[] lpString, uint nMaxCount); [DllImport(dllName, CharSet = CharSet.Unicode)]
[LibraryImport(dllName)] internal static extern IntPtr Everything_GetResultPathW(uint nIndex);
internal static partial uint Everything_GetSort(); [DllImport(dllName)]
[LibraryImport(dllName, StringMarshalling = StringMarshalling.Utf16)] internal static extern uint Everything_GetSort();
internal static partial uint Everything_IncRunCountFromFileNameW(string lpFileName); [DllImport(dllName, CharSet = CharSet.Unicode)]
[LibraryImport(dllName)] internal static extern uint Everything_IncRunCountFromFileName(string lpFileName);
[return: MarshalAs(UnmanagedType.Bool)] [DllImport(dllName)]
internal static partial bool Everything_IsFolderResult(uint index); internal static extern bool Everything_IsFolderResult(uint index);
[LibraryImport(dllName)] [DllImport(dllName)]
[return: MarshalAs(UnmanagedType.Bool)] internal static extern bool Everything_QueryW([MarshalAs(UnmanagedType.Bool)] bool bWait);
internal static partial bool Everything_QueryW([MarshalAs(UnmanagedType.Bool)] bool bWait); [DllImport(dllName)]
[LibraryImport(dllName)] internal static extern void Everything_SetMax(uint dwMax);
internal static partial void Everything_SetMax(uint dwMax); [DllImport(dllName)]
[LibraryImport(dllName)] internal static extern void Everything_SetRegex([MarshalAs(UnmanagedType.Bool)] bool bEnable);
internal static partial void Everything_SetRegex([MarshalAs(UnmanagedType.Bool)] bool bEnable); [DllImport(dllName)]
[LibraryImport(dllName)] internal static extern void Everything_SetRequestFlags(Request RequestFlags);
internal static partial void Everything_SetRequestFlags(Request RequestFlags); [DllImport(dllName, CharSet = CharSet.Unicode)]
[LibraryImport(dllName, StringMarshalling = StringMarshalling.Utf16)] internal static extern void Everything_SetSearchW(string lpSearchString);
internal static partial void Everything_SetSearchW(string lpSearchString); [DllImport(dllName)]
[LibraryImport(dllName)] internal static extern bool Everything_SetMatchPath([MarshalAs(UnmanagedType.Bool)] bool bEnable);
[return: MarshalAs(UnmanagedType.Bool)] [DllImport(dllName)]
internal static partial bool Everything_SetMatchPath([MarshalAs(UnmanagedType.Bool)] bool bEnable); internal static extern void Everything_SetSort(Sort SortType);
[LibraryImport(dllName)]
internal static partial void Everything_SetSort(Sort SortType);
} }
} }

40
Main.cs
View File

@ -1,9 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
using Community.PowerToys.Run.Plugin.Everything.Properties; using Community.PowerToys.Run.Plugin.Everything.Properties;
@ -19,10 +17,8 @@ namespace Community.PowerToys.Run.Plugin.Everything
public static string PluginID => "A86867E2D932459CBD77D176373DD657"; public static string PluginID => "A86867E2D932459CBD77D176373DD657";
public string Name => Resources.plugin_name; public string Name => Resources.plugin_name;
public string Description => Resources.plugin_description; public string Description => Resources.plugin_description;
private readonly Settings _setting = new(); private readonly Settings _setting = new();
private Everything _everything; private Everything _everything;
private ContextMenuLoader _contextMenuLoader; private ContextMenuLoader _contextMenuLoader;
private bool _disposed; private bool _disposed;
@ -54,6 +50,14 @@ namespace Community.PowerToys.Run.Plugin.Everything
NumberValue = _setting.Max, NumberValue = _setting.Max,
}, },
new() new()
{
Key = nameof(Settings.Prefix),
DisplayLabel = Resources.Prefix,
DisplayDescription = Resources.Prefix_Description,
PluginOptionType = PluginAdditionalOption.AdditionalOptionType.Textbox,
TextValue = _setting.Prefix,
},
new()
{ {
Key = nameof(Settings.Copy), Key = nameof(Settings.Copy),
DisplayLabel = Resources.SwapCopy, DisplayLabel = Resources.SwapCopy,
@ -112,33 +116,8 @@ namespace Community.PowerToys.Run.Plugin.Everything
}, },
]; ];
private void CheckArm()
{
string dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
arm = Path.Combine(dir, "EverythingARM64.dll");
if (File.Exists(arm))
{
Architecture arch = RuntimeInformation.ProcessArchitecture;
if (_setting.Log > LogLevel.None)
Debugger.Write("0.Checking ARM..." + (_setting.Log == LogLevel.Verbose ? $"\r\n\tArchitecture: {arch}" : string.Empty));
if (arch == Architecture.Arm64)
{
File.Delete(Path.Combine(dir, "Everything64.dll"));
File.Move(arm, Path.Combine(dir, "Everything64.dll"));
}
else
{
File.Delete(arm);
}
}
if (_setting.Log > LogLevel.None)
Debugger.Write(" Checking ARM...Done");
}
public void Init(PluginInitContext context) public void Init(PluginInitContext context)
{ {
CheckArm();
if (_setting.Updates) if (_setting.Updates)
Task.Run(() => new Update().UpdateAsync(Assembly.GetExecutingAssembly().GetName().Version, _setting)); Task.Run(() => new Update().UpdateAsync(Assembly.GetExecutingAssembly().GetName().Version, _setting));
_setting.Getfilters(); _setting.Getfilters();
@ -164,6 +143,7 @@ namespace Community.PowerToys.Run.Plugin.Everything
_setting.EnvVar = settings.AdditionalOptions.FirstOrDefault(x => x.Key == nameof(_setting.EnvVar)).Value; _setting.EnvVar = settings.AdditionalOptions.FirstOrDefault(x => x.Key == nameof(_setting.EnvVar)).Value;
_setting.Updates = settings.AdditionalOptions.FirstOrDefault(x => x.Key == nameof(_setting.Updates)).Value; _setting.Updates = settings.AdditionalOptions.FirstOrDefault(x => x.Key == nameof(_setting.Updates)).Value;
_setting.Log = (LogLevel)settings.AdditionalOptions.FirstOrDefault(x => x.Key == nameof(_setting.Log)).ComboBoxValue; _setting.Log = (LogLevel)settings.AdditionalOptions.FirstOrDefault(x => x.Key == nameof(_setting.Log)).ComboBoxValue;
_setting.Prefix = settings.AdditionalOptions.FirstOrDefault(x => x.Key == nameof(_setting.Prefix)).TextValue;
_everything?.UpdateSettings(_setting); _everything?.UpdateSettings(_setting);
_contextMenuLoader?.Update(_setting); _contextMenuLoader?.Update(_setting);
@ -229,10 +209,8 @@ namespace Community.PowerToys.Run.Plugin.Everything
} }
public List<ContextMenuResult> LoadContextMenus(Result selectedResult) => _contextMenuLoader.LoadContextMenus(selectedResult); public List<ContextMenuResult> LoadContextMenus(Result selectedResult) => _contextMenuLoader.LoadContextMenus(selectedResult);
public Control CreateSettingPanel() => throw new NotImplementedException(); public Control CreateSettingPanel() => throw new NotImplementedException();
public string GetTranslatedPluginTitle() => Resources.plugin_name; public string GetTranslatedPluginTitle() => Resources.plugin_name;
public string GetTranslatedPluginDescription() => Resources.plugin_description; public string GetTranslatedPluginDescription() => Resources.plugin_description;
} }
} }

View File

@ -1,11 +1,10 @@
; Silent switch /S ; Silent switch /S
; to check silent mode `start /wait EverythingPT-0.81.0-x64+ARM64.exe /S` ; to check silent mode `start /wait EverythingPT-0.81.0-x64.exe /S`
; and `echo %ERRORLEVEL%` to check if 0 or 2 ; and `echo %ERRORLEVEL%` to check if 0 or 2
; Pass in /Dver=0.00.0 /Ddirect=(TargetDir) before calling the script to set the version ; Pass in /Dver=0.00.0 /Ddirect=$(TargetDir) before calling the script to set the version
; ie: makensis /Dver=0.77.0 /Ddirect=bin\x64\Release\Everything\ .\exeCreator.nsi ; ie: makensis /Dver=0.77.0 /Ddirect=bin\x64\Release\Everything\ .\exeCreator.nsi
; Doc: https://nsis.sourceforge.io/Docs/Chapter4.html ; Doc: https://nsis.sourceforge.io/Docs/Chapter4.html
!define EPT "EverythingPT" !define EPT "EverythingPT"
!define PT "PowerToys.exe"
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf" LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
;-------------------------------- ;--------------------------------
@ -25,7 +24,7 @@ FileErrorText "Can't write: $\r$\n$\r$\n$0$\r$\n$\r$\nPowerToys is probably stil
Icon Everything.ico Icon Everything.ico
InstallDir "$LOCALAPPDATA\Microsoft\PowerToys\PowerToys Run\Plugins\Everything" InstallDir "$LOCALAPPDATA\Microsoft\PowerToys\PowerToys Run\Plugins\Everything"
Name "${EPT}" Name "${EPT}"
OutFile ".\..\bin\${EPT}-${ver}-x64+ARM64.exe" OutFile ".\..\bin\${EPT}-${ver}-${platform}.exe"
RequestExecutionLevel user RequestExecutionLevel user
SetCompressor /SOLID /FINAL lzma SetCompressor /SOLID /FINAL lzma
LicenseData "MIT.txt" LicenseData "MIT.txt"

View File

@ -134,7 +134,7 @@ namespace Community.PowerToys.Run.Plugin.Everything.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Expanded enviroment variables, such as %appdata%, so that they work properly at the cost of query time.. /// Looks up a localized string similar to Expand enviroment variables, such as %appdata%, so that they work properly at the cost of query time..
/// </summary> /// </summary>
public static string EnvVar_Description { public static string EnvVar_Description {
get { get {
@ -241,6 +241,25 @@ namespace Community.PowerToys.Run.Plugin.Everything.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Query Prefix.
/// </summary>
public static string Prefix {
get {
return ResourceManager.GetString("Prefix", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Adds prefix to all queries, so that you can always include certain filters/modifiers without typing it every time.
///Space is not added automatically between prfix and query..
/// </summary>
public static string Prefix_Description {
get {
return ResourceManager.GetString("Prefix_Description", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Preview. /// Looks up a localized string similar to Preview.
/// </summary> /// </summary>

View File

@ -143,7 +143,7 @@
<value>Enviroment Variables</value> <value>Enviroment Variables</value>
</data> </data>
<data name="EnvVar_Description" xml:space="preserve"> <data name="EnvVar_Description" xml:space="preserve">
<value>Expanded enviroment variables, such as %appdata%, so that they work properly at the cost of query time.</value> <value>Expand enviroment variables, such as %appdata%, so that they work properly at the cost of query time.</value>
</data> </data>
<data name="Everything_ini" xml:space="preserve"> <data name="Everything_ini" xml:space="preserve">
<value>Install Everything if not installed</value> <value>Install Everything if not installed</value>
@ -178,6 +178,13 @@
<data name="plugin_name" xml:space="preserve"> <data name="plugin_name" xml:space="preserve">
<value>Everything</value> <value>Everything</value>
</data> </data>
<data name="Prefix" xml:space="preserve">
<value>Query Prefix</value>
</data>
<data name="Prefix_Description" xml:space="preserve">
<value>Adds prefix to all queries, so that you can always include certain filters/modifiers without typing it every time.
Space is not added automatically between prfix and query.</value>
</data>
<data name="Preview" xml:space="preserve"> <data name="Preview" xml:space="preserve">
<value>Preview</value> <value>Preview</value>
</data> </data>

View File

@ -191,4 +191,4 @@
安装版本:{0} 安装版本:{0}
最新版本:{1}</value> 最新版本:{1}</value>
</data> </data>
</root> </root>

View File

@ -146,7 +146,7 @@
<value>也收尋路徑</value> <value>也收尋路徑</value>
</data> </data>
<data name="Max_Description" xml:space="preserve"> <data name="Max_Description" xml:space="preserve">
<value>結果中顯示的最大結果數</value> <value>結果中顯示的結果數上限</value>
</data> </data>
<data name="open_containing_folder" xml:space="preserve"> <data name="open_containing_folder" xml:space="preserve">
<value>開啟檔案位置 (Ctrl+Shift+E)</value> <value>開啟檔案位置 (Ctrl+Shift+E)</value>
@ -160,6 +160,10 @@
<data name="plugin_name" xml:space="preserve"> <data name="plugin_name" xml:space="preserve">
<value>Everything 搜尋</value> <value>Everything 搜尋</value>
</data> </data>
<data name="Prefix_Description" xml:space="preserve">
<value>為收尋詞增加固定的前綴,在收詢時不用再自行打修飾詞/篩選詞
前綴與收尋詞之間不會自動加入空格</value>
</data>
<data name="Preview_Description" xml:space="preserve"> <data name="Preview_Description" xml:space="preserve">
<value>將檔案內容顯示為預覽圖示,預覽雲端的檔案可能會造成停頓</value> <value>將檔案內容顯示為預覽圖示,預覽雲端的檔案可能會造成停頓</value>
</data> </data>
@ -174,7 +178,7 @@
<value>以系統管理員身分執行 (Ctrl+Shift+Enter)</value> <value>以系統管理員身分執行 (Ctrl+Shift+Enter)</value>
</data> </data>
<data name="run_as_user" xml:space="preserve"> <data name="run_as_user" xml:space="preserve">
<value>以其他使用者身執行 (Ctrl+Shift+U)</value> <value>以其他使用者身執行 (Ctrl+Shift+U)</value>
</data> </data>
<data name="Sort_Description" xml:space="preserve"> <data name="Sort_Description" xml:space="preserve">
<value>設定結果排序方法</value> <value>設定結果排序方法</value>

View File

@ -21,6 +21,7 @@ namespace Community.PowerToys.Run.Plugin.Everything
public bool Updates { get; set; } = true; public bool Updates { get; set; } = true;
public string Skip { get; set; } public string Skip { get; set; }
public LogLevel Log { get; set; } = LogLevel.None; public LogLevel Log { get; set; } = LogLevel.None;
public string Prefix { get; set; }
// Get Filters from settings.toml // Get Filters from settings.toml
public Dictionary<string, string> Filters { get; } = []; public Dictionary<string, string> Filters { get; } = [];

View File

@ -44,7 +44,11 @@ namespace Community.PowerToys.Run.Plugin.Everything
string[] nameUrl = [string.Empty, string.Empty]; string[] nameUrl = [string.Empty, string.Empty];
foreach (JsonElement asset in assets.EnumerateArray()) foreach (JsonElement asset in assets.EnumerateArray())
{ {
if (asset.TryGetProperty("browser_download_url", out JsonElement downUrl) && downUrl.ToString().EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) #if X64
if (asset.TryGetProperty("browser_download_url", out JsonElement downUrl) && downUrl.ToString().EndsWith("x64.exe", StringComparison.OrdinalIgnoreCase))
#elif ARM64
if (asset.TryGetProperty("browser_download_url", out JsonElement downUrl) && downUrl.ToString().EndsWith("ARM64.exe", StringComparison.OrdinalIgnoreCase))
#endif
{ {
nameUrl[0] = asset.GetProperty("name").ToString(); nameUrl[0] = asset.GetProperty("name").ToString();
nameUrl[1] = downUrl.ToString(); nameUrl[1] = downUrl.ToString();
@ -81,7 +85,8 @@ namespace Community.PowerToys.Run.Plugin.Everything
Debugger.Write($"\r\nERROR: {e.Message}\r\n{e.StackTrace}\r\n"); Debugger.Write($"\r\nERROR: {e.Message}\r\n{e.StackTrace}\r\n");
} }
Debugger.Write(" Checking Update...Done"); if (s.Log > LogLevel.None)
Debugger.Write(" Checking Update...Done");
} }
} }
} }

View File

@ -4,7 +4,7 @@
"IsGlobal": true, "IsGlobal": true,
"Name": "Everything", "Name": "Everything",
"Author": "Yu Chieh (Victor) Lin", "Author": "Yu Chieh (Victor) Lin",
"Version": "0.81.0.1", "Version": "0.82.0",
"Language": "csharp", "Language": "csharp",
"Website": "https://github.com/Lin-ycv/EverythingPowerToys", "Website": "https://github.com/Lin-ycv/EverythingPowerToys",
"ExecuteFileName": "Community.PowerToys.Run.Plugin.Everything.dll", "ExecuteFileName": "Community.PowerToys.Run.Plugin.Everything.dll",