Global $ans, $inifle, $mediainfo, $pth, $version $inifle = @ScriptDir & "\Settings.ini" $mediainfo = IniRead($inifle, "MediaInfo", "path", "") If $mediainfo = "" Or Not FileExists($mediainfo) Then $mediainfo = @ScriptDir & "\MediaInfo_CLI\MediaInfo.exe" If FileExists($mediainfo) Then IniWrite($inifle, "MediaInfo", "path", $mediainfo) Else $mediainfo = "C:\Program Files\MediaInfo\MediaInfo.exe" While 1 If FileExists($mediainfo) Then $version = FileGetVersion($mediainfo, "InternalName") If StringInStr($version, " - CLI - ") > 0 Then IniWrite($inifle, "MediaInfo", "path", $mediainfo) ExitLoop Else $mediainfo = "" EndIf Else $pth = FileOpenDialog("Choose the MediaInfo CLI executable file", @ProgramFilesDir, "Program file (*.exe)", 3, "MediaInfo.exe") If @error <> 1 And $pth <> "" And StringMid($pth, 2, 2) = ":\" Then $mediainfo = $pth $version = FileGetVersion($mediainfo, "InternalName") If StringInStr($version, " - CLI - ") > 0 Then IniWrite($inifle, "MediaInfo", "path", $mediainfo) ExitLoop Else $mediainfo = "" $ans = MsgBox(262193, "Version Error", _ "Selected file is not the CLI version of MediaInfo." & @LF & @LF & _ "Both the CLI and GUI versions have the same" & @LF & _ "executable name, but only the command-line" & @LF & _ "version (CLI) will work with this program." & @LF & @LF & _ "Do you want to browse for it again?", 0) If $ans = 2 Then $mediainfo = @ScriptDir & "\MediaInfo_CLI" DirCreate($mediainfo) $mediainfo = "" Exit EndIf EndIf Else $mediainfo = @ScriptDir & "\MediaInfo_CLI" DirCreate($mediainfo) $mediainfo = "" MsgBox(262192, "Program Error", "MediaInfo CLI (command-line version) freeware is required!.") Exit EndIf EndIf WEnd EndIf EndIf Exit