1 What is mkvtoolnix.exe
Moritz Bunkus edited this page 2022-03-15 08:36:49 +00:00

What is mkvtoolnix.exe?

The short answer

The Windows installer & portable archive include a new executable called mkvtoolnix.exe. The TLDR is that it's an incomplete, work in progress wrapper executable meant for Microsoft Store distribution. It doesn't offer the user anything at the moment and can be safely ignored.

The longer answer

Distributing MKVToolNix through the Microsoft Store poses a unique challenge in that the executables contained in the package aren't made available for direct use unless they're flagged for it via the store manifest. The problem with the manifest is that it's tailored towards GUI applications. Each entry for such an executable must be a GUI application, or the the manifest is rejected by the store.

There seems to be an exception for CLI applications, but that exception must be requested manually (which I've tried several times before, all to no avail), and as long as I don't have that exception, I cannot make my CLI applications available for use with the Store method.

See issue #3223 for details.

The idea behind mkvtoolnix.exe is to make this a wrapper around all the other executables and use that as the one entry point application for the store. It would determine which executable to actually run depending on the first command line argument and pass all remaining command line arguments through to that executable. For example, if the first argument is merge it would run mkvmerge.exe. If no argument is given, it would run the GUI.

The problem with that idea is that it doesn't seem to work well due to how Windows differentiates between GUI and non-GUI applications:

  1. If I compile mkvtoolnix.exe as a non-GUI application, a terminal window will always be opened by Windows itself as soon as mkvtoolnix.exe is run, even if mkvtoolnix.exe only runs for fractions of a second & then spawns the actual GUI. That terminal window will be visible, the effect will be noticeable by the user, it will be annoying.
  2. If I compile mkvtoolnix.exe as a GUI application, no terminal window will be opened. However, both cmd.exe and the PowerShell will launch such applications in the background. This means the user gets returned to the prompt immediately. The effect is that whichever CLI application mkvtoolnix.exe launches will write to a terminal window that the user is also currently writing to, making the whole experience very confusing. The user could circumvent this by running start /w mkvtoolnix.exe merge …, but that isn't what I would the experience to be either.

At the moment mkvtoolnix.exe is therefore incomplete. It's a work in progress. It cannot be used properly yet, if ever.

For release v66 I accidentally forgot to remove the executable from the build process. Its inclusion in the release was accidental. Please disregard its existence for the time being.

Other distribution methods

Avid readers might note that other distribution methods have similar problems, and that's true: both Flatpak and the AppImage have a single entry point. For Flatpak that entry point executable is actually such a wrapper that acts as a distributor for the other executables. The big difference is that on Linux there's no differentiation of GUI vs non-GUI in how they're started: no terminal will be allocated automatically, the application won't be started in the background automatically if run from the command line. Therefore this method works just fine there.