Skip to content

Fix: Ensure AutoDetectMkvToolnixPath runs when MKVToolnix Path is empty. For #28#29

Merged
Gpower2 merged 1 commit into
Gpower2:masterfrom
lapluis:master
Oct 4, 2025
Merged

Fix: Ensure AutoDetectMkvToolnixPath runs when MKVToolnix Path is empty. For #28#29
Gpower2 merged 1 commit into
Gpower2:masterfrom
lapluis:master

Conversation

@lapluis

@lapluis lapluis commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

Problem

When gMKVExtractGUI is started directly, the detection of mmg/mkvmerge.exe is skipped if MKVToolnix Path in the .ini file is empty.

  • If _Settings.MkvToolnixPath is empty, the existence check falls back to the current working directory.
  • When the app is opened by double-click, the working directory happens to contain mkvmerge.exe, so it is detected.
  • But when the app is opened by dragging an MKV file, the working directory is different, so mkvmerge.exe is not found.
  • As a result, AutoDetectMkvToolnixPath is skipped entirely, leading to failure to detect MKVToolnix.

Root Cause

  • MKVToolnix Path being empty in the .ini file.
  • The existence check incorrectly succeeds or fails depending on the working directory.
  • This caused inconsistent behavior:
    • Direct open → succeeds (due to working dir containing mkvmerge).
    • Drag-drop open → fails (different working dir).

Solution

Before performing the detection checks, explicitly verify that _Settings.MkvToolnixPath is not empty or whitespace.

  • If empty → force AutoDetectMkvToolnixPath to run.
  • Otherwise → continue with the normal path checks.

This ensures consistent detection regardless of how the program is started.

if MkvToolnixPath is empty, force detect path of mmg
@Gpower2 Gpower2 merged commit bf932be into Gpower2:master Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants