From 21a7c03220c263053dc7b87f14de706b47798ce6 Mon Sep 17 00:00:00 2001 From: Maxime Gervais Date: Mon, 20 Nov 2023 13:54:42 +0100 Subject: [PATCH 1/3] Windows GUI: Reduce plugin download info precision Signed-off-by: Maxime Gervais --- Source/GUI/VCL/GUI_Main.cpp | 17 +++++++++++++++++ Source/GUI/VCL/GUI_Plugin.cpp | 5 ++--- Source/GUI/VCL/GUI_Plugin.dfm | 4 ++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Source/GUI/VCL/GUI_Main.cpp b/Source/GUI/VCL/GUI_Main.cpp index a320ec500..173c9735f 100644 --- a/Source/GUI/VCL/GUI_Main.cpp +++ b/Source/GUI/VCL/GUI_Main.cpp @@ -255,6 +255,23 @@ void __fastcall TMainF::GUI_Configure() //Toolbar ToolBar->Visible=M_Options_ShowToolBar->Checked; + // FFmpeg + #ifndef MEDIAINFOGUI_PLUGIN_NO + Ztring InstallFolder = Application->ExeName.c_str(); + InstallFolder = InstallFolder.substr(0, InstallFolder.rfind(__T("\\")) + 1); + + if (!File::Exists(InstallFolder + __T("\\Plugin\\FFmpeg\\version.txt"))) //Try to install plugin + { + TPluginF* P = new TPluginF(this, PLUGIN_FFMPEG); + if (P->Configure()) + P->ShowModal(); + delete P; + + if (!File::Exists(InstallFolder + __T("\\Plugin\\FFmpeg\\version.txt"))) + MessageBox(NULL, __T("An error occured, please download and install the plugin manually from the MediaInfo download page."), __T("Error"), MB_OK); + } + #endif + //Translation Translate(); diff --git a/Source/GUI/VCL/GUI_Plugin.cpp b/Source/GUI/VCL/GUI_Plugin.cpp index 281e83669..31c05bdf8 100644 --- a/Source/GUI/VCL/GUI_Plugin.cpp +++ b/Source/GUI/VCL/GUI_Plugin.cpp @@ -99,7 +99,7 @@ void __fastcall DownloadInstallerThread::UpdateDownloadProgress() return; Caption.erase(Pos + 3); - Caption += __T(" ") + Ztring().From_Number(Progress) + __T("%"); + Caption += __T(" ") + Ztring().From_Number(Progress, 0) + __T("%"); Parent->DownloadLabel->Caption = Caption.c_str(); } @@ -217,8 +217,7 @@ bool __fastcall TPluginF::Configure() SourceURL = Prefs->Config(__T("GraphPluginURL")); break; case PLUGIN_FFMPEG: - //SourceURL = Prefs->Config(__T("ffmpegPluginURL")); - SourceURL = __T("https://old.mediaarea.net/download/binary/mediainfo-ffmpeg-plugin/6.1/MediaInfo_ffmpegPlugin_6.1_Windows.exe"); //TODO: delete and uncomment previous line + SourceURL = Prefs->Config(__T("ffmpegPluginURL")); break; default:; } diff --git a/Source/GUI/VCL/GUI_Plugin.dfm b/Source/GUI/VCL/GUI_Plugin.dfm index 4ea6fa802..c4a653b3e 100644 --- a/Source/GUI/VCL/GUI_Plugin.dfm +++ b/Source/GUI/VCL/GUI_Plugin.dfm @@ -4,8 +4,8 @@ object PluginF: TPluginF BorderIcons = [biSystemMenu] BorderStyle = bsDialog Caption = 'Install Plugin' - ClientHeight = 200 - ClientWidth = 350 + ClientHeight = 146 + ClientWidth = 320 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText From c6eaa6a9ebfcd4672872d2613e688ec79eca2e46 Mon Sep 17 00:00:00 2001 From: Maxime Gervais Date: Sun, 26 Nov 2023 16:50:28 +0100 Subject: [PATCH 2/3] ffmpeg -> FFmpeg Signed-off-by: Maxime Gervais --- Source/Common/Preferences.cpp | 24 ++++++++++++------------ Source/Common/Preferences.h | 4 ++-- Source/GUI/VCL/GUI_Plugin.cpp | 4 ++-- Source/GUI/VCL/GUI_Preferences.cpp | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Source/Common/Preferences.cpp b/Source/Common/Preferences.cpp index 8d6e37a7a..3fe9f9cea 100644 --- a/Source/Common/Preferences.cpp +++ b/Source/Common/Preferences.cpp @@ -75,8 +75,8 @@ Preferences::Preferences() //Plugins GraphPluginURL=__T(""); GraphPluginVersion=__T(""); - ffmpegPluginURL=__T(""); - ffmpegPluginVersion=__T(""); + FFmpegPluginURL=__T(""); + FFmpegPluginVersion=__T(""); } //*************************************************************************** @@ -225,11 +225,11 @@ int Preferences::Config_Load() if (!Config(__T("GraphPluginVersion")).empty()) GraphPluginVersion=Config(__T("GraphPluginVersion")); - if (!Config(__T("ffmpegPluginURL")).empty()) - ffmpegPluginURL=Config(__T("ffmpegPluginURL")); + if (!Config(__T("FFmpegPluginURL")).empty()) + FFmpegPluginURL=Config(__T("FFmpegPluginURL")); - if (!Config(__T("ffmpegPluginVersion")).empty()) - ffmpegPluginVersion=Config(__T("ffmpegPluginVersion")); + if (!Config(__T("FFmpegPluginVersion")).empty()) + FFmpegPluginVersion=Config(__T("FFmpegPluginVersion")); delete Reg_User; Reg_User=NULL; @@ -554,17 +554,17 @@ void __fastcall ThreadInternetCheck::Execute() Prefs->Config_Save(); } - Ztring ffmpegPluginURL=Download(__T("ffmpegPluginURL")); - if (!ffmpegPluginURL.empty()) + Ztring FFmpegPluginURL=Download(__T("FFmpegPluginURL")); + if (!FFmpegPluginURL.empty()) { - Prefs->Config(__T("ffmpegPluginURL"))=ffmpegPluginURL; + Prefs->Config(__T("FFmpegPluginURL"))=FFmpegPluginURL; Prefs->Config_Save(); } - Ztring ffmpegPluginVersion=Download(__T("ffmpegPluginVersion")); - if (!ffmpegPluginVersion.empty()) + Ztring FFmpegPluginVersion=Download(__T("FFmpegPluginVersion")); + if (!FFmpegPluginVersion.empty()) { - Prefs->Config(__T("ffmpegPluginVersion"))=ffmpegPluginVersion; + Prefs->Config(__T("FFmpegPluginVersion"))=FFmpegPluginVersion; Prefs->Config_Save(); } diff --git a/Source/Common/Preferences.h b/Source/Common/Preferences.h index e490deb80..f0d6a0399 100644 --- a/Source/Common/Preferences.h +++ b/Source/Common/Preferences.h @@ -96,8 +96,8 @@ class Preferences //Plugins ZenLib::Ztring GraphPluginURL; ZenLib::Ztring GraphPluginVersion; - ZenLib::Ztring ffmpegPluginURL; - ZenLib::Ztring ffmpegPluginVersion; + ZenLib::Ztring FFmpegPluginURL; + ZenLib::Ztring FFmpegPluginVersion; }; //General preference for the whole program diff --git a/Source/GUI/VCL/GUI_Plugin.cpp b/Source/GUI/VCL/GUI_Plugin.cpp index 31c05bdf8..069a0dfac 100644 --- a/Source/GUI/VCL/GUI_Plugin.cpp +++ b/Source/GUI/VCL/GUI_Plugin.cpp @@ -36,7 +36,7 @@ using namespace ZenLib; //--------------------------------------------------------------------------- ZenLib::Char* PluginInfo[PLUGIN_MAX][2] = { {__T("GraphPlugin"), __T("Graph visualization plugin")}, - {__T("ffmpegPlugin"), __T("FFmpeg plugin")}, + {__T("FFmpegPlugin"), __T("FFmpeg plugin")}, }; //--------------------------------------------------------------------------- @@ -217,7 +217,7 @@ bool __fastcall TPluginF::Configure() SourceURL = Prefs->Config(__T("GraphPluginURL")); break; case PLUGIN_FFMPEG: - SourceURL = Prefs->Config(__T("ffmpegPluginURL")); + SourceURL = Prefs->Config(__T("FFmpegPluginURL")); break; default:; } diff --git a/Source/GUI/VCL/GUI_Preferences.cpp b/Source/GUI/VCL/GUI_Preferences.cpp index b5845a5da..55a618fe1 100644 --- a/Source/GUI/VCL/GUI_Preferences.cpp +++ b/Source/GUI/VCL/GUI_Preferences.cpp @@ -442,14 +442,14 @@ void __fastcall TPreferencesF::Advanced_EnableFfmpegClick(TObject *Sender) Ztring InstallFolder = Application->ExeName.c_str(); InstallFolder = InstallFolder.substr(0, InstallFolder.rfind(__T("\\")) + 1); - if (!File::Exists(InstallFolder+__T("\\Plugin\\ffmpeg\\version.txt"))) //Try to install plugin + if (!File::Exists(InstallFolder+__T("\\Plugin\\FFmpeg\\version.txt"))) //Try to install plugin { TPluginF* P = new TPluginF(this, PLUGIN_FFMPEG); if (P->Configure()) P->ShowModal(); delete P; - if (!File::Exists(InstallFolder+__T("\\Plugin\\ffmpeg\\version.txt"))) + if (!File::Exists(InstallFolder+__T("\\Plugin\\FFmpeg\\version.txt"))) MessageBox(NULL, __T("An error occured, please download and install the plugin manually from the MediaInfo download page."), __T("Error"), MB_OK); } #endif From 82c7eba85f0181527112ee7ae432242828b25423 Mon Sep 17 00:00:00 2001 From: Maxime Gervais Date: Mon, 27 Nov 2023 10:43:39 +0100 Subject: [PATCH 3/3] Add ffmpeg plugin to uninst targets Signed-off-by: Maxime Gervais --- Source/Install/MediaInfo_GUI_Windows.nsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Install/MediaInfo_GUI_Windows.nsi b/Source/Install/MediaInfo_GUI_Windows.nsi index ca50b920e..435be2993 100644 --- a/Source/Install/MediaInfo_GUI_Windows.nsi +++ b/Source/Install/MediaInfo_GUI_Windows.nsi @@ -192,6 +192,10 @@ Section Uninstall ExecWait '"$INSTDIR\graph_plugin_uninst.exe" /S _?=$INSTDIR' Delete "$INSTDIR\graph_plugin_uninst.exe" + IfFileExists "$INSTDIR\ffmpeg_plugin_uninst.exe" 0 +3 + ExecWait '"$INSTDIR\ffmpeg_plugin_uninst.exe" /S _?=$INSTDIR' + Delete "$INSTDIR\ffmpeg_plugin_uninst.exe" + Delete "$INSTDIR\${PRODUCT_NAME}.url" Delete "$INSTDIR\uninst.exe" Delete "$INSTDIR\MediaInfo.exe"