Open DanH-ER opened 8 months ago
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.
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.
Tools
> GetIt Package Manager...
MediaInfoDevelopment
for this guide.MediaInfoDevelopment
using Git or GitHub Desktop:
MediaInfoDevelopment
.
MediaInfoDevelopment
folder should now have the following folders:
MediaInfo
MediaInfoLib
ZenLib
zlib
Project
> Build (Shift+F9)
:
MediaInfoDevelopment\ZenLib\Project\BCB\ZenLib_Proj.groupproj
MediaInfoDevelopment\zlib\contrib\BCB\zlib_Proj.groupproj
MediaInfo.dll
MediaInfo.dll
from the official distribution to MediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win32\Release
and MediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win64\Release
respectively.MediaInfo.dll
s from MediaInfoDevelopment\MediaInfoLib\Project\MSVC2022\Win32\Release
to MediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win32\Release
and from MediaInfoDevelopment\MediaInfoLib\Project\MSVC2022\x64\Release
to MediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win64\Release
.WebView2Loader.dll
from C:\Program Files (x86)\Embarcadero\Studio\23.0\Redist\win32
to MediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win32\Release
and from C:\Program Files (x86)\Embarcadero\Studio\23.0\Redist\win64
to MediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win64\Release
.MediaInfoDevelopment\MediaInfo\Source\Resource\Plugin
to MediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win32\Release
and MediaInfoDevelopment\MediaInfo\Project\BCB\GUI\Win64\Release
.MediaInfoDevelopment\MediaInfo\Project\BCB\MediaInfo_Proj.groupproj
in C++Builder.Project
> Build MediaInfo_GUI
(Shift+F9).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.
MediaInfoDevelopment\MediaInfoLib\Project\MSVC2022\MediaInfoLib.sln
in Visual Studio 2022.MediaInfoDll
project.Release
configuration and x64
platform for step 4.MediaInfoDevelopment\MediaInfoLib\Project\MSVC2022\x64\Release\MediaInfo-Static.lib
MediaInfoDevelopment\ZenLib\Project\MSVC2022\x64\Release\ZenLib.lib
MediaInfoDevelopment\zlib\contrib\vstudio\vc17\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib
MediaInfoDevelopment\MediaInfo\Project\QMake\GUI\MediaInfoQt.pro
in Qt Creator.Build
> Build Project "MediaInfoQt"
or Ctrl+B
.Build
> Run
or Ctrl+R
and see the GUI appear.Open Command Prompt for Qt 6.7.2 (MSVC 2019 64-bit)
or Qt 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 and MediaInfo.exe
in it should run sucessfully.
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 MediaInfoShellExt
project instead of the MediaInfoDll
project in step 5 and build both Release
Win32
and Release
x64
versions 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 MediaInfoDevelopment
as 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.nsi
and MediaInfo_GUI_Windows_x64.nsi
in MediaInfoDevelopment\MediaInfo\Source\Install\
to replace all occurrences of MSVC2019
with MSVC2022
.
Run MediaInfoDevelopment\MediaInfo\Release\Release_GUI_Windows.bat
.
You should now find the 32-bit, 64-bit and combined installers at MediaInfoDevelopment\MediaInfo\Release\
.
Install required tools:
Tools
> GetIt Package Manager...
Create an empty folder. We'll call this MediaInfoDevelopment
for this guide.
Open Windows Terminal with MediaInfoDevelopment
as the current directory.
Execute the following commands (you can save this as a *.cmd
file in MediaInfoDevelopment
and 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.
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.