Skip to content

[Feature Request] File Search Extension - Windows - Allow setting instance name to pass to es.exe #1400

@mdmdj

Description

@mdmdj

Before I get into the report, I'd like to say I'd love to be the one to contribute the fix for this as my first OSS contribution. I think it is within my overall skill level but I am having some trouble with the details of working with Electron and debugging ueli, which I'll get back to at the end.

Is your feature request related to a problem? Please describe.
Using File Search extension in ueli on Windows with Everything Alpha is difficult.

Ueli on Windows and Everything
On Windows, the File Search extension relies on Everything and Everything CLI.

The Everything Alpha
Everything currently has an alpha branch that is significantly more capable than the main version.
This branch has been on-going for many years (since 2021), and is likely to continue for significantly longer. This branch has also demonstrated that the developer of Everything may utilize a similar organization for major versions in the future, meaning even if 1.5 becomes the main there may then be an attractive 1.6 alpha.

Everything's Multiple Instance Feature
Everything has a 'multiple instances / named instances' feature that allows multiple, parallel instances of Everything (possibly with different configurations) to be available.
The main version of everything will use a 'blank' default instance name, which allows the Everything CLI (es.exe) to access it without specifying an instance name.
The Everything Alpha, in order to allow it to be installed and run alongside the main branch uses a named instance called "1.5a".

There are a few methods available to use Everything CLI with named instances or with the 1.5a instance in particular:

  1. Specify the named instance name as a command line arg to Everything CLI (ref):

From the Everything CLI program folder:

./es.exe -instance 1.5a {search terms}

Image

  1. Create an ini file beside the Everything CLI to set the default instance (ref):

From the Everything CLI program folder, as Administrator:
.\es.exe -instance 1.5a -save-settings

Or create file es.ini in the Everything CLI program folder, as Administrator:

[ES]
instance=1.5a
  1. Edit file Everything.ini in the Everything program folder, as Administrator: (ref):

Change the following line:
alpha_instance=1
to:
alpha_instance=0

Currently in File Search, only methods 2 and 3 are theoretically suitable. Unfortunately, they both require inconvenient administrator level actions and impact the functionality of Everything and/or Everything CLI at the system level. Although you could perform method 2 on a second copy of Everything CLI that only ueli uses -- this would require manual management when updating Everything CLI.

Personally, this made me stop using ueli after the overall. I don't remember how I solved it the old version, but I would like to try using ueli with Everything Alpha again and make it as easy as possible for others. I'm not satisfied with alternatives and would like to try using ueli daily again.

Describe the solution you'd like
I propose that File Search should make some minor changes to facilitate method 1. This will allow the case that when a user has installed ueli, Everything Alpha and Everything CLI using their default behaviors, they do not need to do any command line operations or create or edit additional files. By providing a method to specify the Everything named instance we can connect ueli/File Search to Everything alpha without Administrator actions or additional side effects on the behavior of Everything or the Everything CLI. All 3 apps should also be able to be updated as normal without additional maintenance by the user.

On Windows platform only, provide a setting in the File Search extension settings to specify an Everything instance name.

For example:
Image

If this setting is a non-blank value, when File Search is invoked, it will add "-instance {instanceName}" to the command line args that it calls es.exe with. Otherwise, the behavior is unchanged from the current behavior.

An additional benefit would be that any users that use the named instances feature of Everything for other reasons, will be able to use it via ueli -- although at this scope they would still be limited to interacting with 1 instance. (I could investigate ways to improve this though)

It may be a challenge to validate if the instance name is correct, but File Search currently doesn't seem to provide any feedback if it's failing to get data from es.exe so it would be consistent.

Validate if the direction in the readme to move es.exe is necessary -- if not, remove it.

Add a note in the readme for users of Everything Alpha to type "1.5a" in the instance name setting.
Add a note in the readme for users of Everything named instances feature to type their instance name in the instance name setting.

In the case of future branches of Everything we can update the instance name or direct the user to documentation from the developer to find the correct instance name.

Describe alternatives you've considered
Method 2 and 3 above can theoretically work around the issue by manipulating files as Administrator, but they have side effects to Everything outside of ueli and are complex actions that are difficult to document and easy to have user error, so I propose they are not ideal. Also, in practice I am having trouble verifying that the File Search extension is actually running, but I'll get back to that at the end.

I tried to make a .bat file that would call es.exe with the instance command line args prefixed to the incoming command line args, but ueli will only accept es.exe as a target. I was on the verge of making an exe to do the same thing when I thought it was going too far and it would be better to fix it directly in ueli.

Additional context
I have already pulled down the repo and got it running in VS Code. I have seemingly succeeded at adding a setting to File Search and having it save but I'm stuck after that.

I have not been able to verify that the File Search extension is working as intended in 9.13.0.
On a normal installation, after applying method 2 above (specify default instance for Everything CLI), I cannot get File Search to return any files and there are not any errors visible that I can tell.
When running under VS Code debug, breakpoints placed around the extension code where it called es.exe are not getting hit.

I have not been able to verify logging/debug out is working as intended. I have tried using logger statements in various places throughout File Search and I can't find the output either in VS Code, Chrome Dev tools or in the Debug panel of settings.

If I can get some guidance on how to properly debug extensions, I think I can deliver on this.

Room to Expand
Building logic for customizing command line parameters to Everything CLI could allow the user to further customize the results from Everything in later versions of File Search -- for example to enable regex matching or sorting priorities.

Thank you!!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions