From 0cfbacef40f8c08891036a7240bb6b4bcc339ada Mon Sep 17 00:00:00 2001 From: Maxime Gervais Date: Mon, 13 Jan 2025 08:05:19 +0100 Subject: [PATCH 1/2] Rework Windows Build Script - Publish Windows package creation scripts - Use PowerShell and wsl2, as it's common now Signed-off-by: Maxime Gervais --- Project/BuildAllFromSource/build.bat | 132 ------------------- Project/BuildAllFromSource/build.ps1 | 108 ++++++++++++++++ Release/Release_CLI_Windows_x64.ps1 | 90 +++++++++++++ Release/Release_GUI_Windows_x64.ps1 | 117 +++++++++++++++++ Source/Install/QCTools.nsi | 182 +++++++++++++++------------ 5 files changed, 419 insertions(+), 210 deletions(-) delete mode 100755 Project/BuildAllFromSource/build.bat create mode 100644 Project/BuildAllFromSource/build.ps1 create mode 100644 Release/Release_CLI_Windows_x64.ps1 create mode 100644 Release/Release_GUI_Windows_x64.ps1 diff --git a/Project/BuildAllFromSource/build.bat b/Project/BuildAllFromSource/build.bat deleted file mode 100755 index 5c7c767b7..000000000 --- a/Project/BuildAllFromSource/build.bat +++ /dev/null @@ -1,132 +0,0 @@ -@echo off - -rem *********************************************************************************************** -rem * build.bat - Batch script for building Windows version of QCTools * -rem * * -rem *Script requirements: * -rem * - Microsoft Visual Studio 2019 at the default place * -rem * - qctools_AllInclusive source tree * -rem * - Qt bin directory corresponding to the requested build type (static or shared, x86 or x64) * -rem * in the PATH * -rem * - Cygwin directory with bash, sed, make and diffutils in the PATH * -rem * - yasm.exe in the PATH if not provided by Cygwin * -rem * Options: * -rem * - /static - build statically linked binary * -rem * - /target x86|x64 - target arch (default x86) * -rem * - /nogui - build only qcli * -rem * - /prebuild_ffmpeg - assume that ffmpeg is already builds * -rem *********************************************************************************************** - -rem *** Init *** -set ARCH=x86 -set STATIC= -set NOGUI= -set NO_BUILD_FFMPEG= -set QMAKEOPTS= - -set OLD_CD="%CD%" -set OLD_PATH=%PATH% -set BUILD_DIR="%~dp0..\..\.." - -set CHERE_INVOKING=1 - -rem *** Initialize bash user files (needed to make CHERE_INVOKING work) *** -bash --login -c "exit" - -rem *** Parse command line *** -:cmdline -if not "%1"=="" ( - if /I "%1"=="/static" set STATIC=1 - if /I "%1"=="/nogui" set NOGUI=1 - if /I "%1"=="/prebuild_ffmpeg" set NO_BUILD_FFMPEG=1 - if /I "%1"=="/target" ( - set ARCH=%2 - shift - ) - shift - goto:cmdline -) - -if not "%ARCH%"=="x86" if not "%ARCH%"=="x64" ( - echo ERROR: Unknown value for arch %ARCH% - goto:clean -) - -if defined STATIC ( - set QMAKEOPTS=STATIC^=1 -) - -rem *** Get VC tools path *** -call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% - -if "%ARCH%"=="x86" set PLATFORM=Win32 -if "%ARCH%"=="x64" set PLATFORM=x64 - -set FFMPEG_CMDLINE=--prefix^=. --disable-programs --enable-gpl --enable-version3 --toolchain^=msvc -set FFMPEG_CMDLINE=%FFMPEG_CMDLINE% --disable-securetransport --disable-videotoolbox -set FFMPEG_CMDLINE=%FFMPEG_CMDLINE% --disable-doc --disable-debug -set FFMPEG_CMDLINE=%FFMPEG_CMDLINE% --enable-libfreetype --extra-cflags^=-I../freetype/include - -set FFMPEG_CMDLINE=%FFMPEG_CMDLINE% --extra-libs^=../freetype/objs/%PLATFORM%/ReleaseStatic/freetype.lib - -if defined STATIC ( - set FFMPEG_CMDLINE=%FFMPEG_CMDLINE% --enable-static --disable-shared -) else ( - set FFMPEG_CMDLINE=%FFMPEG_CMDLINE% --enable-shared --disable-static -) - -if not defined NO_BUILD_FFMPEG ( - rem *** Build freetype *** - cd "%BUILD_DIR%\freetype\builds\windows\vc2010" - devenv /upgrade freetype.vcxproj - MSBuild /t:Clean;Build /p:Configuration="Release Static";Platform=%PLATFORM% - - cd "%BUILD_DIR%\freetype" - move /Y "objs\%PLATFORM%\Release Static" "objs\%PLATFORM%\ReleaseStatic" - - rem *** Build ffmpeg *** - cd "%BUILD_DIR%\ffmpeg" - if exist Makefile bash --login -c "make clean uninstall" - if exist lib bash --login -c "rm -f lib/*.lib" - bash --login -c "./configure %FFMPEG_CMDLINE%" - bash --login -c "make install" - - if defined STATIC forfiles /S /M *.a /C "cmd /c rename @file ///*.lib" -) - -rem *** Build qwt *** -cd "%BUILD_DIR%\qwt" -if not defined NOGUI ( - rem TODO: Make dynamically linked version of QWT work - if exist Makefile nmake distclean - set QWT_STATIC=1 - set QWT_NO_SVG=1 - set QWT_NO_OPENGL=1 - set QWT_NO_DESIGNER=1 - qmake -recursive - nmake Release -) - -rem *** Build QCTools *** -rmdir /S /Q "%BUILD_DIR%\qctools\Project\QtCreator\build" -mkdir "%BUILD_DIR%\qctools\Project\QtCreator\build" -cd "%BUILD_DIR%\qctools\Project\QtCreator\build" - -qmake %QMAKEOPTS% DEFINES+=QT_AVPLAYER_MULTIMEDIA QMAKE_CXXFLAGS+=/Zi QMAKE_LFLAGS+=/INCREMENTAL:NO QMAKE_LFLAGS+=/Debug .. -if not defined NOGUI ( - nmake -) else ( - nmake sub-qctools-cli -) - -if not defined STATIC ( - windeployqt qctools-gui/release/QtAVPlayer.dll - windeployqt qctools-gui/release/QCTools.exe - - windeployqt qctools-cli/release/qcli.exe -) - -rem *** Cleaning *** -:clean -set PATH=%OLD_PATH% -cd %OLD_CD% diff --git a/Project/BuildAllFromSource/build.ps1 b/Project/BuildAllFromSource/build.ps1 new file mode 100644 index 000000000..df08650e9 --- /dev/null +++ b/Project/BuildAllFromSource/build.ps1 @@ -0,0 +1,108 @@ +################################################################################################### +# build.ps1 - Batch script for building the Windows version of QCTools # +# # +# Script requirements: # +# - qctools_AllInclusive source # +# - Microsoft Visual Studio environment # +# - Qt bin directory in the PATH # +# - Python3 binary in the PATH # +# - pkg-config binary in the PATH # +# - Meson binary in the PATH # +# - Ninja binary in the PATH # +# - Configured WSL2 Linux environment with pkgconf, make and nasm packages installed # +################################################################################################### + +# helpers +function Cmd-Result { + if (-Not $?) { + Exit(1) + } +} + +# setup environment +$ErrorActionPreference="Stop" +$Env:SUBDIR= # Prevent ffmpeg build error +$Env:PKG_CONFIG_PATH="$Pwd\output\lib\pkgconfig" +$FFmpeg_CmdLine=@( + '--toolchain=msvc', + '--prefix=.', + '--enable-shared', + '--disable-static', + '--disable-doc', + '--disable-debug', + '--disable-programs', + '--disable-autodetect', + '--enable-gpl', + '--enable-version3', + '--enable-libfreetype', + '--enable-libharfbuzz', + '--extra-libs=msvcrt.lib' +) + +# freetype +Write-Output "Build FreeType" +if (Test-Path -Path freetype\build) { + Remove-Item -Recurse -Force -Path freetype\build +} +New-Item -ItemType directory -Name freetype\build +Push-Location -Path freetype\build + meson setup --prefix $Pwd\..\..\output --buildtype=release -Db_vscrt=md -Dbrotli=disabled -Dbzip2=disabled -Dharfbuzz=disabled -Dpng=disabled -Dzlib=internal .. ; Cmd-Result + ninja install ; Cmd-Result +Pop-Location + +# harfbuzz +Write-Output "Build HarfBuzz" +if (Test-Path -Path harfbuzz\build) { + Remove-Item -Recurse -Force -Path harfbuzz\build +} +New-Item -ItemType directory -Name harfbuzz\build +Push-Location -Path harfbuzz\build + meson setup --prefix $Pwd\..\..\output --buildtype=release -Db_vscrt=md -Dglib=disabled -Dgobject=disabled -Dcairo=disabled -Dchafa=disabled -Dicu=disabled -Dgraphite=disabled -Dgraphite2=disabled -Dgdi=disabled -Ddirectwrite=disabled -Dcoretext=disabled -Dwasm=disabled -Dtests=disabled -Dintrospection=disabled -Ddocs=disabled -Ddoc_tests=false -Dutilities=disabled .. ; Cmd-Result + ninja install ; Cmd-Result +Pop-Location + +# remove windows-style line endings from the pkgconf files generated by meson (not well supported by the ffmpeg's configure script) +Write-Output "Fixes .pc files" +Push-Location -Path output\lib\pkgconfig + Get-ChildItem -Path *.pc | ForEach-Object { + (Get-Content -Raw -Path $_.Name) -Replace "`r`n", "`n" | Set-Content -Path $_.Name + } +Pop-Location + +# ffmpeg +Write-Output "Build FFmpeg" +Push-Location ffmpeg + if (Test-Path -Path Makefile) { + wsl --shell-type standard -- make clean + } + wsl --shell-type standard -- PKG_CONFIG_PATH=`$PWD/../output/lib/pkgconfig ./configure @FFmpeg_CmdLine ; Cmd-Result + wsl --shell-type standard -- make install ; Cmd-Result +Pop-Location + + +# qwt +Write-Output "Build Qwt" +Push-Location -Path qwt + $Env:QWT_STATIC=1 + $Env:QWT_NO_SVG=1 + $Env:QWT_NO_OPENGL=1 + $Env:QWT_NO_DESIGNER=1 + if (Test-Path -Path Makefile) { + nmake distclean + } + qmake -recursive ; Cmd-Result + nmake Release ; Cmd-Result +Pop-Location + +# qctools +Write-Output "Build QCTools" +if (Test-Path -Path qctools\Project\QtCreator\build) { + Remove-Item -Recurse -Force -Path qctools\Project\QtCreator\build +} +New-Item -ItemType directory -Name qctools\Project\QtCreator\build +Push-Location -Path qctools\Project\QtCreator\build + qmake QMAKE_CXXFLAGS+=/Zi QMAKE_LFLAGS+=/INCREMENTAL:NO QMAKE_LFLAGS+=/Debug DEFINES+=QT_AVPLAYER_MULTIMEDIA .. ; Cmd-Result + nmake Release ; Cmd-Result + windeployqt qctools-gui/release/QCTools.exe ; Cmd-Result + windeployqt qctools-cli/release/qcli.exe ; Cmd-Result +Pop-Location diff --git a/Release/Release_CLI_Windows_x64.ps1 b/Release/Release_CLI_Windows_x64.ps1 new file mode 100644 index 000000000..35cf3e857 --- /dev/null +++ b/Release/Release_CLI_Windows_x64.ps1 @@ -0,0 +1,90 @@ +################################################################################################### +# Release_CLI_Windows_x64.ps1 - PowerShell script for creating Windows QCli packages (x64) # +# # +# Script requirements: # +# - Built qctools_AllInclusive sources # +# - Microsoft Visual Studio environment # +################################################################################################### + +# setup environment +$ErrorActionPreference="Stop" +$build_path=$Pwd +$version=Get-Content -Path $build_path\qctools\Project\version.txt + +# binary archive +Write-Output "Create CLI archive" +if (Test-Path -Path QCli_${version}_Windows_x64) { + Remove-Item -Force -Recurse -Path QCli_${version}_Windows_x64 +} +New-Item -ItemType directory -Name QCli_${version}_Windows_x64 +Push-Location -Path QCli_${version}_Windows_x64 + Copy-Item -Path $build_path\qctools\History.txt + Copy-Item -Path $build_path\qctools\License.html + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\qcli.exe + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\Qt6Core.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\Qt6Gui.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\Qt6Multimedia.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\Qt6Network.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\Qt6Svg.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\d3dcompiler_47.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\opengl32sw.dll + New-Item -ItemType directory -Name iconengines + Push-Location -Path iconengines + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\iconengines\qsvgicon.dll + Pop-Location + New-Item -ItemType directory -Name imageformats + Push-Location -Path imageformats + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\imageformats\qjpeg.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\imageformats\qsvg.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\imageformats\qico.dll + Pop-Location + New-Item -ItemType directory -Name multimedia + Push-Location -Path multimedia + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\multimedia\windowsmediaplugin.dll + Pop-Location + New-Item -ItemType directory -Name networkinformation + Push-Location -Path networkinformation + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\networkinformation\qnetworklistmanager.dll + Pop-Location + New-Item -ItemType directory -Name platforms + Push-Location -Path platforms + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\platforms\qwindows.dll + Pop-Location + New-Item -ItemType directory -Name tls + Push-Location -Path tls + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\tls\qcertonlybackend.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\tls\qopensslbackend.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\tls\qschannelbackend.dll + Pop-Location + Copy-Item -Path $build_path\ffmpeg\bin\avdevice-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\avcodec-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\avfilter-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\avformat-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\avutil-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\postproc-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\swresample-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\swscale-*.dll + Copy-Item -Path $build_path\output\bin\freetype-*.dll + Copy-Item -Path $build_path\output\bin\harfbuzz.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\concrt140.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\msvcp140.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\msvcp140_1.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\msvcp140_2.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\msvcp140_atomic_wait.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\msvcp140_codecvt_ids.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\vccorlib140.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\vcruntime140.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\vcruntime140_1.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\vcruntime140_threads.dll +Pop-Location +if (Test-Path -Path QCli_${version}_Windows_x64.zip) { + Remove-Item -Force -Path QCli_${version}_Windows_x64.zip +} +Compress-Archive -Path QCli_${version}_Windows_x64\* -DestinationPath QCli_${version}_Windows_x64.zip + +# debug symbols archive +Write-Output "Create CLI debug symbols archive" +if (Test-Path -Path QCli_${version}_Windows_x64_DebugInfo.zip) { + Remove-Item -Force -Path QCli_${version}_Windows_x64_DebugInfo.zip +} +Compress-Archive -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\QCli.pdb -DestinationPath QCli_${version}_Windows_x64_DebugInfo.zip diff --git a/Release/Release_GUI_Windows_x64.ps1 b/Release/Release_GUI_Windows_x64.ps1 new file mode 100644 index 000000000..f9d79ca60 --- /dev/null +++ b/Release/Release_GUI_Windows_x64.ps1 @@ -0,0 +1,117 @@ +################################################################################################### +# Release_GUI_Windows_x64.ps1 - PowerShell script for creating Windows QCTools packages (x64) # +# # +# Script requirements: # +# - Built qctools_AllInclusive sources # +# - Microsoft Visual Studio environment # +# - NSIS binary in the PATH # +################################################################################################### + +# helpers +function Cmd-Result { + if (-Not $?) { + Exit(1) + } +} + +# setup environment +$ErrorActionPreference="Stop" +$build_path=$Pwd +$version=Get-Content -Path $build_path\qctools\Project\version.txt + +# binary archive +Write-Output "Create GUI archive" +if (Test-Path -Path QCTools_${version}_Windows_x64) { + Remove-Item -Force -Recurse -Path QCTools_${version}_Windows_x64 +} +New-Item -ItemType directory -Name QCTools_${version}_Windows_x64 +Push-Location -Path QCTools_${version}_Windows_x64 + Copy-Item -Path $build_path\qctools\History.txt + Copy-Item -Path $build_path\qctools\License.html + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\QCTools.exe + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\Qt6Core.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\Qt6Gui.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\Qt6Multimedia.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\Qt6MultimediaWidgets.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\Qt6Network.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\Qt6OpenGL.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\Qt6Qml.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\Qt6QmlModels.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\Qt6Svg.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\Qt6Widgets.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\d3dcompiler_47.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\opengl32sw.dll + New-Item -ItemType directory -Name iconengines + Push-Location -Path iconengines + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\iconengines\qsvgicon.dll + Pop-Location + New-Item -ItemType directory -Name imageformats + Push-Location -Path imageformats + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\imageformats\qjpeg.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\imageformats\qsvg.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\imageformats\qico.dll + Pop-Location + New-Item -ItemType directory -Name multimedia + Push-Location -Path multimedia + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\multimedia\windowsmediaplugin.dll + Pop-Location + New-Item -ItemType directory -Name networkinformation + Push-Location -Path networkinformation + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\networkinformation\qnetworklistmanager.dll + Pop-Location + New-Item -ItemType directory -Name platforms + Push-Location -Path platforms + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\platforms\qwindows.dll + Pop-Location + New-Item -ItemType directory -Name styles + Push-Location -Path styles + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\styles\qwindowsvistastyle.dll + Pop-Location + New-Item -ItemType directory -Name tls + Push-Location -Path tls + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\tls\qcertonlybackend.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\tls\qopensslbackend.dll + Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\tls\qschannelbackend.dll + Pop-Location + Copy-Item -Path $build_path\ffmpeg\bin\avdevice-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\avcodec-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\avfilter-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\avformat-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\avutil-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\postproc-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\swresample-*.dll + Copy-Item -Path $build_path\ffmpeg\bin\swscale-*.dll + Copy-Item -Path $build_path\output\bin\freetype-*.dll + Copy-Item -Path $build_path\output\bin\harfbuzz.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\concrt140.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\msvcp140.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\msvcp140_1.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\msvcp140_2.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\msvcp140_atomic_wait.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\msvcp140_codecvt_ids.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\vccorlib140.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\vcruntime140.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\vcruntime140_1.dll + Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\vcruntime140_threads.dll +Pop-Location +if (Test-Path -Path QCTools_${version}_Windows_x64_WithoutInstaller.zip) { + Remove-Item -Force -Path QCTools_${version}_Windows_x64_WithoutInstaller.zip +} +Compress-Archive -Path QCTools_${version}_Windows_x64\* -DestinationPath QCTools_${version}_Windows_x64_WithoutInstaller.zip + +# debug symbols archive +Write-Output "Create GUI debug symbols archive" +if (Test-Path -Path QCTools_${version}_Windows_x64_DebugInfo.zip) { + Remove-Item -Force -Path QCTools_${version}_Windows_x64_DebugInfo.zip +} +Compress-Archive -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\QCTools.pdb -DestinationPath QCTools_${version}_Windows_x64_DebugInfo.zip + +# installer +Write-Output "Create GUI installer" +if (Test-Path -Path QCTools_${version}_Windows.exe) { + Remove-Item -Force -Path QCTools_${version}_Windows.exe +} +Push-Location -Path qctools\Source\Install + makensis.exe QCTools.nsi ; Cmd-Result +Pop-Location +Copy-Item -Path qctools\QCTools_${version}_Windows.exe diff --git a/Source/Install/QCTools.nsi b/Source/Install/QCTools.nsi index e897b7445..6d555f06c 100644 --- a/Source/Install/QCTools.nsi +++ b/Source/Install/QCTools.nsi @@ -103,45 +103,48 @@ Section "SectionPrincipale" SEC01 File "..\..\..\ffmpeg\bin\postproc-*.dll" File "..\..\..\ffmpeg\bin\swresample-*.dll" File "..\..\..\ffmpeg\bin\swscale-*.dll" - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29910\X64\Microsoft.VC142.CRT\concrt140.dll" - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29910\X64\Microsoft.VC142.CRT\msvcp140.dll" - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29910\X64\Microsoft.VC142.CRT\msvcp140_1.dll" - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29910\X64\Microsoft.VC142.CRT\msvcp140_2.dll" - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29910\X64\Microsoft.VC142.CRT\msvcp140_atomic_wait.dll" - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29910\X64\Microsoft.VC142.CRT\msvcp140_codecvt_ids.dll" - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29910\X64\Microsoft.VC142.CRT\vccorlib140.dll" - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29910\X64\Microsoft.VC142.CRT\vcruntime140.dll" - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29910\X64\Microsoft.VC142.CRT\vcruntime140_1.dll" - ;File "..\..\Project\QtCreator\build\qctools-gui\release\QtAVPlayer.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\Qt5Core.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\Qt5Gui.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\Qt5Network.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\Qt5Multimedia.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\Qt5MultimediaWidgets.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\Qt5Qml.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\Qt5Svg.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\Qt5Widgets.dll" + File "..\..\..\output\bin\freetype-*.dll" + File "..\..\..\output\bin\harfbuzz.dll" + File "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\X64\Microsoft.VC143.CRT\concrt140.dll" + File "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\X64\Microsoft.VC143.CRT\msvcp140.dll" + File "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\X64\Microsoft.VC143.CRT\msvcp140_1.dll" + File "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\X64\Microsoft.VC143.CRT\msvcp140_2.dll" + File "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\X64\Microsoft.VC143.CRT\msvcp140_atomic_wait.dll" + File "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\X64\Microsoft.VC143.CRT\msvcp140_codecvt_ids.dll" + File "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\X64\Microsoft.VC143.CRT\vccorlib140.dll" + File "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\X64\Microsoft.VC143.CRT\vcruntime140.dll" + File "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\X64\Microsoft.VC143.CRT\vcruntime140_1.dll" + File "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\X64\Microsoft.VC143.CRT\vcruntime140_threads.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\Qt6Core.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\Qt6Gui.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\Qt6Multimedia.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\Qt6MultimediaWidgets.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\Qt6Network.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\Qt6OpenGL.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\Qt6Qml.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\Qt6QmlModels.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\Qt6Svg.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\Qt6Widgets.dll" File "..\..\Project\QtCreator\build\qctools-gui\release\d3dcompiler_47.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\libEGL.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\libGLESV2.dll" - SetOutPath "$INSTDIR\audio" - File "..\..\Project\QtCreator\build\qctools-gui\release\audio\qtaudio_wasapi.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\audio\qtaudio_windows.dll" - SetOutPath "$INSTDIR\bearer" - File "..\..\Project\QtCreator\build\qctools-gui\release\bearer\qgenericbearer.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\opengl32sw.dll" SetOutPath "$INSTDIR\iconengines" File "..\..\Project\QtCreator\build\qctools-gui\release\iconengines\qsvgicon.dll" SetOutPath "$INSTDIR\imageformats" File "..\..\Project\QtCreator\build\qctools-gui\release\imageformats\qjpeg.dll" File "..\..\Project\QtCreator\build\qctools-gui\release\imageformats\qsvg.dll" - SetOutPath "$INSTDIR\mediaservice" - File "..\..\Project\QtCreator\build\qctools-gui\release\mediaservice\dsengine.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\mediaservice\wmfengine.dll" - File "..\..\Project\QtCreator\build\qctools-gui\release\mediaservice\qtmedia_audioengine.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\imageformats\qico.dll" + SetOutPath "$INSTDIR\multimedia" + File "..\..\Project\QtCreator\build\qctools-gui\release\multimedia\windowsmediaplugin.dll" + SetOutPath "$INSTDIR\networkinformation" + File "..\..\Project\QtCreator\build\qctools-gui\release\networkinformation\qnetworklistmanager.dll" SetOutPath "$INSTDIR\platforms" File "..\..\Project\QtCreator\build\qctools-gui\release\platforms\qwindows.dll" SetOutPath "$INSTDIR\styles" File "..\..\Project\QtCreator\build\qctools-gui\release\styles\qwindowsvistastyle.dll" + SetOutPath "$INSTDIR\tls" + File "..\..\Project\QtCreator\build\qctools-gui\release\tls\qcertonlybackend.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\tls\qopensslbackend.dll" + File "..\..\Project\QtCreator\build\qctools-gui\release\tls\qschannelbackend.dll" !endif # Create files @@ -178,57 +181,80 @@ Section Uninstall Delete "$INSTDIR\qcli.exe" Delete "$INSTDIR\History.txt" Delete "$INSTDIR\License.html" - !ifndef STATIC - Delete "$INSTDIR\avdevice-*.dll" - Delete "$INSTDIR\avcodec-*.dll" - Delete "$INSTDIR\avfilter-*.dll" - Delete "$INSTDIR\avformat-*.dll" - Delete "$INSTDIR\avutil-*.dll" - Delete "$INSTDIR\postproc-*.dll" - Delete "$INSTDIR\swresample-*.dll" - Delete "$INSTDIR\swscale-*.dll" - Delete "$INSTDIR\concrt140.dll" - Delete "$INSTDIR\msvcp140.dll" - Delete "$INSTDIR\msvcp140_1.dll" - Delete "$INSTDIR\msvcp140_2.dll" - Delete "$INSTDIR\msvcp140_atomic_wait.dll" - Delete "$INSTDIR\msvcp140_codecvt_ids.dll" - Delete "$INSTDIR\vccorlib140.dll" - Delete "$INSTDIR\vcruntime140.dll" - Delete "$INSTDIR\vcruntime140_1.dll" - Delete "$INSTDIR\QtAVPlayer.dll" - Delete "$INSTDIR\Qt5Core.dll" - Delete "$INSTDIR\Qt5Gui.dll" - Delete "$INSTDIR\Qt5Network.dll" - Delete "$INSTDIR\Qt5Multimedia.dll" - Delete "$INSTDIR\Qt5MultimediaWidgets.dll" - Delete "$INSTDIR\Qt5Qml.dll" - Delete "$INSTDIR\Qt5Svg.dll" - Delete "$INSTDIR\Qt5Widgets.dll" - Delete "$INSTDIR\d3dcompiler_47.dll" - Delete "$INSTDIR\libEGL.dll" - Delete "$INSTDIR\libGLESV2.dll" - Delete "$INSTDIR\audio\qtaudio_wasapi.dll" - Delete "$INSTDIR\audio\qtaudio_windows.dll" - Delete "$INSTDIR\bearer\qgenericbearer.dll" - Delete "$INSTDIR\mediaservice\dsengine.dll" - Delete "$INSTDIR\mediaservice\wmfengine.dll" - Delete "$INSTDIR\mediaservice\qtmedia_audioengine.dll" - Delete "$INSTDIR\imageformats\qjpeg.dll" - Delete "$INSTDIR\imageformats\qsvg.dll" - Delete "$INSTDIR\platforms\qwindows.dll" - Delete "$INSTDIR\iconengines\qsvgicon.dll" - Delete "$INSTDIR\styles\qwindowsvistastyle.dll" - RMDir "$INSTDIR\audio" - RMDir "$INSTDIR\bearer" - RMDir "$INSTDIR\mediaservice" - RMDir "$INSTDIR\iconengines" - RMDir "$INSTDIR\imageformats" - RMDir "$INSTDIR\platforms" - RMDir "$INSTDIR\styles" - !endif + Delete "$INSTDIR\avdevice-*.dll" + Delete "$INSTDIR\avcodec-*.dll" + Delete "$INSTDIR\avfilter-*.dll" + Delete "$INSTDIR\avformat-*.dll" + Delete "$INSTDIR\avutil-*.dll" + Delete "$INSTDIR\postproc-*.dll" + Delete "$INSTDIR\swresample-*.dll" + Delete "$INSTDIR\swscale-*.dll" + Delete "$INSTDIR\freetype-*.dll" + Delete "$INSTDIR\harfbuzz.dll" + Delete "$INSTDIR\concrt140.dll" + Delete "$INSTDIR\msvcp140.dll" + Delete "$INSTDIR\msvcp140_1.dll" + Delete "$INSTDIR\msvcp140_2.dll" + Delete "$INSTDIR\msvcp140_atomic_wait.dll" + Delete "$INSTDIR\msvcp140_codecvt_ids.dll" + Delete "$INSTDIR\vccorlib140.dll" + Delete "$INSTDIR\vcruntime140.dll" + Delete "$INSTDIR\vcruntime140_1.dll" + Delete "$INSTDIR\vcruntime140_threads.dll" + Delete "$INSTDIR\Qt6Core.dll" + Delete "$INSTDIR\Qt6Gui.dll" + Delete "$INSTDIR\Qt6Multimedia.dll" + Delete "$INSTDIR\Qt6MultimediaWidgets.dll" + Delete "$INSTDIR\Qt6Network.dll" + Delete "$INSTDIR\Qt6OpenGL.dll" + Delete "$INSTDIR\Qt6Qml.dll" + Delete "$INSTDIR\Qt6QmlModels.dll" + Delete "$INSTDIR\Qt6Svg.dll" + Delete "$INSTDIR\Qt6Widgets.dll" + Delete "$INSTDIR\d3dcompiler_47.dll" + Delete "$INSTDIR\opengl32sw.dll" + Delete "$INSTDIR\iconengines\qsvgicon.dll" + Delete "$INSTDIR\imageformats\qjpeg.dll" + Delete "$INSTDIR\imageformats\qsvg.dll" + Delete "$INSTDIR\imageformats\qico.dll" + Delete "$INSTDIR\multimedia\windowsmediaplugin.dll" + Delete "$INSTDIR\networkinformation\qnetworklistmanager.dll" + Delete "$INSTDIR\platforms\qwindows.dll" + Delete "$INSTDIR\styles\qwindowsvistastyle.dll" + Delete "$INSTDIR\tls\qcertonlybackend.dll" + Delete "$INSTDIR\tls\qopensslbackend.dll" + Delete "$INSTDIR\tls\qschannelbackend.dll" + RMDir "$INSTDIR\iconengines" + RMDir "$INSTDIR\imageformats" + RMDir "$INSTDIR\multimedia" + RMDir "$INSTDIR\networkinformation" + RMDir "$INSTDIR\platforms" + RMDir "$INSTDIR\styles" + RMDir "$INSTDIR\tls" RMDir "$INSTDIR" Delete "$SMPROGRAMS\QCTools.lnk" + ; Olds + Delete "$INSTDIR\QtAVPlayer.dll" + Delete "$INSTDIR\Qt5Core.dll" + Delete "$INSTDIR\Qt5Gui.dll" + Delete "$INSTDIR\Qt5Network.dll" + Delete "$INSTDIR\Qt5Multimedia.dll" + Delete "$INSTDIR\Qt5MultimediaWidgets.dll" + Delete "$INSTDIR\Qt5Qml.dll" + Delete "$INSTDIR\Qt5Svg.dll" + Delete "$INSTDIR\Qt5Widgets.dll" + Delete "$INSTDIR\d3dcompiler_47.dll" + Delete "$INSTDIR\libEGL.dll" + Delete "$INSTDIR\libGLESV2.dll" + Delete "$INSTDIR\audio\qtaudio_wasapi.dll" + Delete "$INSTDIR\audio\qtaudio_windows.dll" + Delete "$INSTDIR\bearer\qgenericbearer.dll" + Delete "$INSTDIR\mediaservice\dsengine.dll" + Delete "$INSTDIR\mediaservice\wmfengine.dll" + Delete "$INSTDIR\mediaservice\qtmedia_audioengine.dll" + RMDir "$INSTDIR\audio" + RMDir "$INSTDIR\bearer" + RMDir "$INSTDIR\mediaservice" SetRegView 64 DeleteRegKey HKLM "${PRODUCT_REGISTRY}" From 21608be76f3af22420eae2119167ed52cf8eccaa Mon Sep 17 00:00:00 2001 From: Maxime Gervais Date: Mon, 13 Jan 2025 22:07:29 +0100 Subject: [PATCH 2/2] Fix CI Signed-off-by: Maxime Gervais --- .github/workflows/qctools.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/qctools.yml b/.github/workflows/qctools.yml index 0fccb44b3..f8ebf468f 100644 --- a/.github/workflows/qctools.yml +++ b/.github/workflows/qctools.yml @@ -11,7 +11,7 @@ jobs: compiler: ['clang-9'] include: - compiler: clang-9 - packages: llvm@13 + packages: llvm@15 env: { 'CC': 'clang', 'CXX': 'clang++' } runs-on: macos-latest @@ -68,7 +68,7 @@ jobs: compiler: ['clang-9'] include: - compiler: clang-9 - packages: llvm@13 + packages: llvm@15 env: { 'CC': 'clang', 'CXX': 'clang++', 'HOMEBREW_NO_INSTALL_CLEANUP': '1', 'HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK': '1' } runs-on: macos-latest @@ -124,7 +124,7 @@ jobs: compiler: ['clang-9'] include: - compiler: clang-9 - packages: llvm@13 + packages: llvm@15 env: { 'CC': 'clang', 'CXX': 'clang++' } - qt_version: "5.15.*" @@ -209,7 +209,7 @@ jobs: compiler: ['clang-9'] include: - compiler: clang-9 - packages: llvm@13 + packages: llvm@15 env: { 'CC': 'clang', 'CXX': 'clang++', 'HOMEBREW_NO_INSTALL_CLEANUP': '1', 'HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK': '1' } - qt_version: "6.5.*" qt_modules: "qtmultimedia"