Repository navigation
Conversation
Look for FFmpeg, Tesseract and whisper-cli in the native MSYS2 environments on the system drive after the existing system locations. Addresses KnifeLemon#1216.
KnifeLemon
left a comment
There was a problem hiding this comment.
Thanks for picking this up, @Stamina9! The order is exactly what we agreed on #1216: the user's copy, then Filee's, then PATH and the installer folders, and MSYS2 last. Skipping usr/bin is right too, and so is leaving tessdata alone: Filee passes its own language data, so even a MINGW64 Tesseract without tessdata works.
Must fix
1. C:\msys64 can't be trusted by its name
Windows lets any signed-in account create folders in the root of C:. So on a PC shared by several accounts, someone else can create C:\msys64\ucrt64\bin\tesseract.exe without any admin rights. Filee would then start that program as whoever runs Filee, without a click, because a found copy gets a version check on every launch (EngineDownloadService.StatusOf → CopyVersions.Installed). The other places we search on Windows can only be changed by an admin or by the user themselves, so this would be the first one that another account can write to.
Could you take the folder from MSYS2's own installer record instead?
- The installer writes an entry under
HKCU(orHKLMfor an all-users install):Software\Microsoft\Windows\CurrentVersion\Uninstall\{guid}, withDisplayNameandInstallLocation. - Another account can't change those.
- It also finds
D:\msys64, so the "custom root" gap in your description goes away. - A copy unpacked by hand keeps using PATH or Use my copy, which is fine.
I read this from the installer's source and haven't seen it on a real install, so please check the values on one.
2. The tests don't reach the search
They call Msys2Folders and FolderWithPrograms directly. I removed the two lines in SystemFolders and reversed the environment list, and all three cases still passed. Please split the part that goes from the registry entries to the folder list into a small function that takes them as input, and test the result and its order.
Worth doing while you're here
- ARM64:
clangarm64comes after the x64 environments, so an ARM PC with both gets the emulated tool over the native one. On an x64 PC it can't run at all. Please put it first on ARM64 and leave it out on x64 (RuntimeInformation.OSArchitecture). - Whisper: MSYS2's whisper.cpp package doesn't appear to include a model, so the card can say "Found on this PC" while Whisper stays unavailable until a model is there. One sentence in
docs/ENGINES.mdwould cover it.
@yzc3582, once this is updated, could you try it with Use my copy cleared and MSYS2 not on PATH? You have the setup we don't, with FFmpeg and whisper.cpp in MINGW64 and Tesseract in CLANG64.
What does this change?
Find FFmpeg, Tesseract and whisper-cli in native MSYS2 environments under
msys64on the Windows system drive, even when theirbinfolders are absent from PATH. These locations are searched after PATH and the usual installer folders; the user-selected and Filee-managed copies retain priority. FFmpeg still requires both ffmpeg and ffprobe in the same folder.Addresses #1216. This covers automatic discovery in the standard location; custom MSYS2 roots still need PATH or a manually selected program. It does not change where Filee installs Tesseract language data.
Type of change
How was it tested?
dotnet format Filee.slnx --verify-no-changes --no-restoreChecklist