How to properly build GUI on Windows?
When I build the Visual Studio project on Windows the resulting GUI app has the sheets and tree views disabled, is missing the preferences window, and just generally looks different that the official release from the website. So my question is how do I build the same UI that's in the official release? Is there a config or build flag step I'm missing?
The instructions in the readme only describe how to build Mac and Linux, not Windows.
We definitely lack of doc about building GUIs, and not something we are focused on especially because we want to change that in a (far...) future. It will change one day, when we have the tile to refactor everything about the GUI (no ETA as it is not a priority of our sponsors).
In practice the official GUI does not currently use WxWidgets (the one you built, and the one we used a long time ago on Windows, now it is used only on Linux and macOS free version) but use the Borland C++ Builder version (you need Embarcadero, Embarcadero C++ Builder, Embarcadero bought Borland C++ Builder) or the UWP version (you'll get the version for the Windows Store).
I downloaded the community edition of Embarcadero and I can build the UI in 32 bit mode but when I try to build the 64 bit version I get errors similar to this...
[ilink64 Error] Error: Unresolved external 'ZenLib::ZtringListListF::ZtringListListF()' referenced from C:\REPOS\MEDIAINFO\PROJECT\BCB\GUI\WIN64\RELEASE\PREFERENCES.O
I built the BCB ZenLib project first, in both 32 and 64 bit, so I'm not sure what is causing this.
Also I can't seem to build MediaInfoLib at all. The 32 bit version throws errors complaining about int128u and the the 64 bit version complains about __uuifof.
Since you guys use this for the official build I assume you don't have these errors. Any tips on what might be causing them?
Never mind I see that the release script uses the 32bit GUI and the DLLs from Visual Studio. I think I see how it works.
How to build MediaInfo Windows GUI (VCL/Qt), MediaInfoLib (MSVC) and installer (NSIS) on Windows
Documenting how I managed to build the Windows GUI here to help others and for my future reference. Thanks to https://github.com/MediaArea/MediaInfo/issues/788#issuecomment-1887569305 and https://github.com/MediaArea/MediaInfo/issues/788#issuecomment-1888203511 for giving me an idea.
Contents
- How to build official Windows GUI (VCL)
- How to build MediaInfoLib (MSVC)
- How to build unreleased Windows GUI (Qt)
- How to build Windows installer (NSIS)
- How to build MediaInfoLib (MSVC), official Windows GUI (VCL) and Windows installer (NSIS) using command line
How to build official Windows GUI (VCL)
- Install the following required software on a Windows PC:
- C++Builder 12 Community Edition (https://www.embarcadero.com/products/cbuilder/starter)
- Install the following dependencies from
Tools>GetIt Package Manager...- VCL Windows Style - Windows11 Dark 1.0 by Embarcadero Technologies
- EdgeView2 SDK 1.0.2739.1 by Microsoft
- Install the following dependencies from
- Git for Windows (https://gitforwindows.org/) and/or GitHub Desktop (https://desktop.github.com/)
- C++Builder 12 Community Edition (https://www.embarcadero.com/products/cbuilder/starter)
- Create an empty folder. We'll call this
MediaInfoDevelopmentfor this guide. - Clone the following MediaInfo dependencies to
MediaInfoDevelopmentusing Git or GitHub Desktop: - Clone MediaInfo (this repository) to
MediaInfoDevelopment.- If you intend to contribute to MediaInfo, fork the repository on GitHub first and clone your fork instead.
- The
MediaInfoDevelopmentfolder should now have the following folders:MediaInfoMediaInfoLibZenLibzlib
- Build MediaInfo dependencies by opening the following in C++Builder, choosing the 32-bit or 64-bit target platform and selecting
Project>Build (Shift+F9):MediaInfoDevelopment\ZenLib\Project\BCB\ZenLib_Proj.groupprojMediaInfoDevelopment\zlib\contrib\BCB\zlib_Proj.groupproj
- Copy the DLL and CSV dependencies:
MediaInfo.dll- If you do not want to build MediaInfoLib, copy 32-bit and 64-bit
MediaInfo.dllfrom the official distribution toMediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win32\ReleaseandMediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win64\Releaserespectively. - If you want to build it yourself, follow How to build MediaInfoLib (MSVC) below and copy
MediaInfo.dlls fromMediaInfoDevelopment\MediaInfoLib\Project\MSVC2022\Win32\ReleasetoMediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win32\Releaseand fromMediaInfoDevelopment\MediaInfoLib\Project\MSVC2022\x64\ReleasetoMediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win64\Release.
- If you do not want to build MediaInfoLib, copy 32-bit and 64-bit
- Copy
WebView2Loader.dllfromC:\Program Files (x86)\Embarcadero\Studio\23.0\Redist\win32toMediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win32\Releaseand fromC:\Program Files (x86)\Embarcadero\Studio\23.0\Redist\win64toMediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win64\Release. - Copy
MediaInfoDevelopment\MediaInfo\Source\Resource\PlugintoMediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win32\ReleaseandMediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win64\Release.
- Open
MediaInfoDevelopment\MediaInfo\Project\BCB\MediaInfo_Proj.groupprojin C++Builder. - Select 32-bit or 64-bit target platform then build MediaInfo GUI by selecting
Project>Build MediaInfo_GUI(Shift+F9). - You should now be able to run MediaInfo by selecting
Run Without Debugging (Shift+Ctrl+F9)and see the GUI appear.
Note: For certain features, libcurl may be required. In that case, obtain LIBCURL.DLL and curl-ca-bundle.crt from MediaArea-Utils-Binaries and place it in the directory mentioned in step 7.
How to build MediaInfoLib (MSVC)
- Install the following required software on a Windows PC:
- Visual Studio 2022 Community Edition (https://visualstudio.microsoft.com/vs/community/)
- Git for Windows (https://gitforwindows.org/) and/or GitHub Desktop (https://desktop.github.com/)
- Clone the required repositories by following steps 2 and 3 of How to build official Windows GUI (VCL) above.
- Open
MediaInfoDevelopment\MediaInfoLib\Project\MSVC2022\MediaInfoLib.slnin Visual Studio 2022. - Select the desired configuration and platform.
- Build the
MediaInfoDllproject.
How to build unreleased Windows GUI (Qt)
- Install the following required software on a Windows PC:
- Qt for open source use (https://www.qt.io/download-qt-installer-oss)
Install at least the following components:- Qt 6.7.2 or newer
- MSVC 2019 64-bit or MSVC 2022 64-bit
- Qt Creator 13.0.2 or newer
- Visual Studio 2022 Community Edition (https://visualstudio.microsoft.com/vs/community/)
- Git for Windows (https://gitforwindows.org/) and/or GitHub Desktop (https://desktop.github.com/)
- Qt for open source use (https://www.qt.io/download-qt-installer-oss)
- Clone the required repositories by following steps 2 to 5 of How to build official Windows GUI (VCL) above.
- Build MediaInfo dependencies.
- Follow How to build MediaInfoLib (MSVC) above using the
Releaseconfiguration andx64platform for step 4. - Ensure the following files are present:
MediaInfoDevelopment\MediaInfoLib\Project\MSVC2022\x64\Release\MediaInfo-Static.libMediaInfoDevelopment\ZenLib\Project\MSVC2022\x64\Release\ZenLib.libMediaInfoDevelopment\zlib\contrib\vstudio\vc17\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib
- Follow How to build MediaInfoLib (MSVC) above using the
- Open
MediaInfoDevelopment\MediaInfo\Project\QMake\GUI\MediaInfoQt.proin Qt Creator. - Configure the project for Desktop Qt MSVC 2019 or 2022 64bit.
- Build MediaInfo GUI by selecting
Build>Build Project "MediaInfoQt"orCtrl+B. - You should now be able to run MediaInfo by selecting
Build>RunorCtrl+Rand see the GUI appear.
To deploy
-
Open Command Prompt for
Qt 6.7.2 (MSVC 2019 64-bit)orQt 6.7.2 (MSVC 2022 64-bit). -
Change directory to
MediaInfoDevelopment. -
Execute the following commands:
MediaInfoDevelopment>mkdir MediaInfo\Release\MediaInfo_Qt_Windows_x64 MediaInfoDevelopment>copy MediaInfo\Project\QMake\GUI\build\Desktop_Qt_6_7_2_MSVC2019_64bit-Release\x64\MediaInfo.exe MediaInfo\Release\MediaInfo_Qt_Windows_x64\ MediaInfoDevelopment>windeployqt MediaInfo\Release\MediaInfo_Qt_Windows_x64\MediaInfo.exe -
The folder
MediaInfo\Release\MediaInfo_Qt_Windows_x64\can now be deployed andMediaInfo.exein it should run sucessfully.
How to build Windows installer (NSIS)
-
Follow How to build official Windows GUI (VCL) above and build both 64-bit and 32-bit versions of the GUI.
-
Follow How to build MediaInfoLib (MSVC) above but build the
MediaInfoShellExtproject instead of theMediaInfoDllproject in step 5 and build bothReleaseWin32andReleasex64versions of the required binaries. -
Install Git for Windows (https://gitforwindows.org/) if you have not.
-
Obtain the required tools and additional binaries by executing the following in Windows Terminal with
MediaInfoDevelopmentas the current directory:MediaInfoDevelopment>git clone -n --depth=1 --filter=tree:0 https://github.com/MediaArea/MediaArea-Utils-Binaries.git MediaInfoDevelopment>cd MediaArea-Utils-Binaries MediaInfoDevelopment\MediaArea-Utils-Binaries>git sparse-checkout set Windows/NSIS Windows/libcurl MediaInfoDevelopment\MediaArea-Utils-Binaries>git checkout -
If MSVC2022 was used for step 2, edit
MediaInfo_GUI_Windows.nsi,MediaInfo_GUI_Windows_i386.nsiandMediaInfo_GUI_Windows_x64.nsiinMediaInfoDevelopment\MediaInfo\Source\Install\to replace all occurrences ofMSVC2019withMSVC2022. -
Run
MediaInfoDevelopment\MediaInfo\Release\Release_GUI_Windows.bat. -
You should now find the 32-bit, 64-bit and combined installers at
MediaInfoDevelopment\MediaInfo\Release\.
How to build MediaInfoLib (MSVC), official Windows GUI (VCL) and Windows installer (NSIS) using command line
-
Install required tools:
- C++Builder 12 Community Edition (https://www.embarcadero.com/products/cbuilder/starter)
- Install the following dependencies from
Tools>GetIt Package Manager...- VCL Windows Style - Windows11 Dark 1.0 by Embarcadero Technologies
- EdgeView2 SDK 1.0.2739.1 by Microsoft
- Install the following dependencies from
- Visual Studio 2022 Community Edition (https://visualstudio.microsoft.com/vs/community/)
- Git for Windows (https://gitforwindows.org/)
- C++Builder 12 Community Edition (https://www.embarcadero.com/products/cbuilder/starter)
-
Create an empty folder. We'll call this
MediaInfoDevelopmentfor this guide. -
Open Windows Terminal with
MediaInfoDevelopmentas the current directory. -
Execute the following commands (you can save this as a
*.cmdfile inMediaInfoDevelopmentand run it):git clone https://github.com/MediaArea/MediaInfo.git git clone https://github.com/MediaArea/MediaInfoLib.git git clone https://github.com/MediaArea/ZenLib.git git clone https://github.com/MediaArea/zlib.git git clone -n --depth=1 --filter=tree:0 https://github.com/MediaArea/MediaArea-Utils-Binaries.git cd MediaArea-Utils-Binaries git sparse-checkout set Windows/NSIS Windows/libcurl git checkout cd .. set PATH_TEMP=%PATH% call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" MSBuild /t:MediaInfoShellExt /p:Configuration=Release;Platform=Win32 MediaInfoLib\Project\MSVC2022\MediaInfoLib.sln MSBuild /t:MediaInfoShellExt /p:Configuration=Release;Platform=x64 MediaInfoLib\Project\MSVC2022\MediaInfoLib.sln set PATH=%PATH_TEMP% call "C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat" MSBuild /p:Configuration=Release;Platform=Win32 zlib\contrib\BCB\zlib.cbproj MSBuild /p:Configuration=Release;Platform=Win64 zlib\contrib\BCB\zlib.cbproj MSBuild /p:Configuration=Release;Platform=Win32 ZenLib\Project\BCB\Library\ZenLib.cbproj MSBuild /p:Configuration=Release;Platform=Win64 ZenLib\Project\BCB\Library\ZenLib.cbproj MSBuild /p:Configuration=Release;Platform=Win32 MediaInfo\Project\BCB\GUI\MediaInfo_GUI.cbproj MSBuild /p:Configuration=Release;Platform=Win64 MediaInfo\Project\BCB\GUI\MediaInfo_GUI.cbproj set PATH=%PATH_TEMP% set PATH_TEMP= powershell -Command "(gc MediaInfo\Source\Install\MediaInfo_GUI_Windows.nsi) -replace 'MSVC2019', 'MSVC2022' | sc MediaInfo\Source\Install\MediaInfo_GUI_Windows.nsi" powershell -Command "(gc MediaInfo\Source\Install\MediaInfo_GUI_Windows_i386.nsi) -replace 'MSVC2019', 'MSVC2022' | sc MediaInfo\Source\Install\MediaInfo_GUI_Windows_i386.nsi" powershell -Command "(gc MediaInfo\Source\Install\MediaInfo_GUI_Windows_x64.nsi) -replace 'MSVC2019', 'MSVC2022' | sc MediaInfo\Source\Install\MediaInfo_GUI_Windows_x64.nsi" call MediaInfo\Release\Release_GUI_Windows.bat -
You should now find the 32-bit, 64-bit and combined installers in
MediaInfoDevelopment\MediaInfo\Release\.
Updated on 2024-06-22 to prepare for 64-bit builds.
Updated on 2024-06-24 to add MediaInfoLib and Qt GUI as well as GetIt Package Manager and libcurl dependencies along with improvements.
Updated on 2024-07-03 to add 64-bit build, WebView2 & Plugin dependencies, deploying Qt GUI, Windows installer and building using CLI.
Updated on 2024-07-30 to use C++Builder 12
I downloaded the community edition of Embarcadero and I can build the UI in 32 bit mode but when I try to build the 64 bit version I get errors similar to this...
[ilink64 Error] Error: Unresolved external 'ZenLib::ZtringListListF::ZtringListListF()' referenced from C:\REPOS\MEDIAINFO\PROJECT\BCB\GUI\WIN64\RELEASE\PREFERENCES.O
I built the BCB ZenLib project first, in both 32 and 64 bit, so I'm not sure what is causing this.
I successfully built a 64-bit version. Anyone interested? 😄
I successfully built a 64-bit version. Anyone interested? 😄
Did you need to change the project files? If so, please do a PR. And we could put the 64-bit version in the 64-bit 7z package without installer, unfortunately 32-bit is still there and for the more used installer it would inflate the size to have both 32 and 64 bit, so not now, but at long term we may put the 64-bit version in the installer and move the 32-bit installer to a 2nd choice when the installer detects 64-bit...
Did you need to change the project files? If so, please do a PR.
Yes, changed project files for MediaInfo BCB, ZenLib BCB and zlib BCB.
And we could put the 64-bit version in the 64-bit 7z package without installer,
This should be easy to include in the PR.
unfortunately 32-bit is still there and for the more used installer it would inflate the size to have both 32 and 64 bit, so not now, but at long term we may put the 64-bit version in the installer and move the 32-bit installer to a 2nd choice when the installer detects 64-bit...
I can try and see how much it inflates...
I can try and see how much it inflates...
Package size is a hot topic for us, most people don't care at all and download GB of content but some others complain loudly when there is 1 more MB in the main package...
For the 7z, it would actually helps as we can remove the 32-bit DLL in that case.
I can try and see how much it inflates...
Package size is a hot topic for us, most people don't care at all and download GB of content but some others complain loudly when there is 1 more MB in the main package...
Then maybe better to make two installers. Most PCs should be 64-bit now and Windows 11 does not even have a 32-bit version. Now it also contains both 64-bit and 32-bit DLLs.
Good thing the WebView2Loader.dll is only 100+KB
Making an installer that handles both 32-bit and 64-bit is around 9MiB
Installed size is less by around 3MiB when taking into account larger 64-bit EXE and excluding the 32-bit DLL
FYI updated the guide above (https://github.com/MediaArea/MediaInfo/issues/788#issuecomment-2124537221). Will update it again when the PRs are merged.
FYI updated the guide above
Thank you!
FYI guide (https://github.com/MediaArea/MediaInfo/issues/788#issuecomment-2124537221) updated again.