Skip to content

Commit

Permalink
fixed #12066 - use Qt6 for official Windows release / some cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Nov 26, 2024
1 parent 93ea424 commit 501f329
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 34 deletions.
47 changes: 31 additions & 16 deletions .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
env:
# see https://www.pcre.org/original/changelog.txt
PCRE_VERSION: 8.45
QT_VERSION: 5.15.2
QT_VERSION: 6.8.0

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -69,11 +69,12 @@ jobs:
tools: 'tools_opensslv3_x64'
cache: true

# TODO: build with multiple threads
- name: Build x64 release GUI
run: |
:: TODO: enable rules?
:: specify Release build so matchcompiler is used
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On || exit /b !errorlevel!
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On || exit /b !errorlevel!
cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel!
- name: Deploy app
Expand All @@ -82,13 +83,24 @@ jobs:
del build\bin\Release\cppcheck-gui.ilk || exit /b !errorlevel!
del build\bin\Release\cppcheck-gui.pdb || exit /b !errorlevel!
- uses: actions/upload-artifact@v4
with:
name: deploy
path: build\bin\Release

- name: Matchcompiler
run: python tools\matchcompiler.py --write-dir lib || exit /b !errorlevel!

# TODO: build with multiple threads
# TODO: build with boost enabled
- name: Build CLI x64 release configuration using MSBuild
run: msbuild -m cppcheck.sln -t:cli -p:Configuration=Release-PCRE -p:Platform=x64 || exit /b !errorlevel!

- uses: actions/upload-artifact@v4
with:
name: bin
path: bin

- name: Compile misra.py executable
run: |
pip install -U pyinstaller || exit /b !errorlevel!
Expand All @@ -103,13 +115,18 @@ jobs:
copy addons\dist\misra\*.* win_installer\files\addons || exit /b !errorlevel!
copy bin\cppcheck.exe win_installer\files || exit /b !errorlevel!
copy bin\cppcheck-core.dll win_installer\files || exit /b !errorlevel!
mkdir win_installer\files\help || exit /b !errorlevel!
:: mkdir win_installer\files\help || exit /b !errorlevel!
xcopy /s gui\help win_installer\files\help || exit /b !errorlevel!
del win_installer\files\translations\*.qm || exit /b !errorlevel!
move build\gui\*.qm win_installer\files\translations || exit /b !errorlevel!
:: copy libcrypto-3-x64.dll and libssl-3-x64.dll
copy %RUNNER_WORKSPACE%\Qt\Tools\OpenSSLv3\Win_x64\bin\lib*.dll win_installer\files || exit /b !errorlevel!
- uses: actions/upload-artifact@v4
with:
name: collect
path: win_installer\files

- name: Build Installer
run: |
cd win_installer || exit /b !errorlevel!
Expand All @@ -125,28 +142,26 @@ jobs:
name: installer
path: win_installer/Build/

- uses: actions/upload-artifact@v4
with:
name: deploy
path: win_installer\files

- name: Clean up deploy
run: |
del win_installer\files\addons\*.dll || exit /b !errorlevel!
del win_installer\files\addons\*.pyd || exit /b !errorlevel!
del win_installer\files\addons\base_library.zip || exit /b !errorlevel!
rmdir /s /q win_installer\files\bearer || exit /b !errorlevel!
@echo on
:: del win_installer\files\addons\*.dll || exit /b !errorlevel!
:: del win_installer\files\addons\*.pyd || exit /b !errorlevel!
:: del win_installer\files\addons\base_library.zip || exit /b !errorlevel!
:: rmdir /s /q win_installer\files\bearer || exit /b !errorlevel!
rmdir /s /q win_installer\files\help || exit /b !errorlevel!
rmdir /s /q win_installer\files\iconengines || exit /b !errorlevel!
rmdir /s /q win_installer\files\imageformats || exit /b !errorlevel!
rmdir /s /q win_installer\files\printsupport || exit /b !errorlevel!
:: rmdir /s /q win_installer\files\printsupport || exit /b !errorlevel!
rmdir /s /q win_installer\files\sqldrivers || exit /b !errorlevel!
ren win_installer\files\translations lang || exit /b !errorlevel!
del win_installer\files\d3dcompiler_47.dll || exit /b !errorlevel!
del win_installer\files\libEGL.dll || exit /b !errorlevel!
del win_installer\files\libGLESv2.dll || exit /b !errorlevel!
del win_installer\files\dmake.exe || exit /b !errorlevel!
del win_installer\files\dmake.pdb || exit /b !errorlevel!
:: del win_installer\files\libEGL.dll || exit /b !errorlevel!
:: del win_installer\files\libGLESv2.dll || exit /b !errorlevel!
del win_installer\files\opengl32sw.dll || exit /b !errorlevel!
del win_installer\files\Qt5Svg.dll || exit /b !errorlevel!
del win_installer\files\Qt6Svg.dll || exit /b !errorlevel!
del win_installer\files\vc_redist.x64.exe || exit /b !errorlevel!
- uses: actions/upload-artifact@v4
Expand Down
9 changes: 2 additions & 7 deletions win_installer/config.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
<?define AddonsDir = "files\addons" ?>
<?define QtDllDir = "files" ?>

<?if $(var.Platform) = x64 ?>
<?define CrtMergeModule = "$(env.VCINSTALLDIR)Redist\MSVC\v143\MergeModules\Microsoft_VC143_CRT_x64.msm" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else?>
<?define CrtMergeModule = "$(env.VCINSTALLDIR)Redist\MSVC\v143\MergeModules\Microsoft_VC143_CRT_x86.msm" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif?>
<?define CrtMergeModule = "$(env.VCINSTALLDIR)Redist\MSVC\v143\MergeModules\Microsoft_VC143_CRT_x64.msm" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
</Include>
24 changes: 13 additions & 11 deletions win_installer/cppcheck.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Media Id='1' Cabinet='Cppcheck.cab' EmbedCab='yes' CompressionLevel='high' DiskPrompt='CD-ROM 1' />
<Property Id='DiskPrompt' Value='Cppcheck installation [1]' />

<!-- TODO: what is DiskId for? It is used inconsistently -->
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='System32' FileSource='SystemFolder' />
<Directory Id='$(var.PlatformProgramFilesFolder)' Name='PFiles'>
Expand All @@ -36,16 +37,16 @@
</File>
<File Id='onlinehelpqhc' Name='online-help.qhc' Source='$(var.GuiHelpDir)\online-help.qhc' />
<File Id='onlinehelpqch' Name='online-help.qch' Source='$(var.GuiHelpDir)\online-help.qch' />
<File Id='Qt5Coredll' Name='Qt5Core.dll' Source='$(var.QtDllDir)\Qt5Core.dll' />
<File Id='Qt5Guidll' Name='Qt5Gui.dll' Source='$(var.QtDllDir)\Qt5Gui.dll' />
<File Id='Qt5Helpdll' Name='Qt5Help.dll' Source='$(var.QtDllDir)\Qt5Help.dll' />
<File Id='Qt5Sqldll' Name='Qt5Sql.dll' Source='$(var.QtDllDir)\Qt5Sql.dll' />
<File Id='Qt5Widgetsdll' Name='Qt5Widgets.dll' Source='$(var.QtDllDir)\Qt5Widgets.dll' />
<File Id='Qt5PrintSupportdll' Name='Qt5PrintSupport.dll' Source='$(var.QtDllDir)\Qt5PrintSupport.dll' />
<?if $(var.Platform) = x64 ?>
<File Id='Qt5Chartsdll' Name='Qt5Charts.dll' Source='$(var.QtDllDir)\Qt5Charts.dll' />
<?endif?>
<File Id='Qt5Network.dll' Name='Qt5Network.dll' DiskId='1' Source='$(var.QtDllDir)\Qt5Network.dll' />
<File Id='Qt6Coredll' Name='Qt6Core.dll' Source='$(var.QtDllDir)\Qt6Core.dll' />
<File Id='Qt6Guidll' Name='Qt6Gui.dll' Source='$(var.QtDllDir)\Qt6Gui.dll' />
<File Id='Qt6Helpdll' Name='Qt6Help.dll' Source='$(var.QtDllDir)\Qt6Help.dll' />
<File Id='Qt6Sqldll' Name='Qt6Sql.dll' Source='$(var.QtDllDir)\Qt6Sql.dll' />
<File Id='Qt6Widgetsdll' Name='Qt6Widgets.dll' Source='$(var.QtDllDir)\Qt6Widgets.dll' />
<File Id='Qt6PrintSupportdll' Name='Qt6PrintSupport.dll' Source='$(var.QtDllDir)\Qt6PrintSupport.dll' />
<File Id='Qt6Chartsdll' Name='Qt6Charts.dll' Source='$(var.QtDllDir)\Qt6Charts.dll' />
<File Id='Qt6Network.dll' Name='Qt6Network.dll' DiskId='1' Source='$(var.QtDllDir)\Qt6Network.dll' />
<File Id='Qt6OpenGL.dll' Name='Qt6OpenGL.dll' DiskId='1' Source='$(var.QtDllDir)\Qt6OpenGL.dll' />
<File Id='Qt6OpenGLWidgets.dll' Name='Qt6OpenGLWidgets.dll' DiskId='1' Source='$(var.QtDllDir)\Qt6OpenGLWidgets.dll' />
<File Id='libcrypto.dll' Name='libcrypto-3-x64.dll' DiskId='1' Source='$(var.QtDllDir)\libcrypto-3-x64.dll' />
<File Id='libssl.dll' Name='libssl-3-x64.dll' DiskId='1' Source='$(var.QtDllDir)\libssl-3-x64.dll' />
</Component>
Expand All @@ -56,7 +57,7 @@
</Directory>
<Directory Id='QtStylesFolder' Name='styles'>
<Component Id='QtStyles' DiskId='1' Guid='$(var.qtstylesGUID)'>
<File Id='qwindowsvistastyledll' Name='qwindowsvistastyle.dll' Source='$(var.QtDllDir)\styles\qwindowsvistastyle.dll' />
<File Id='qmodernwindowsstyledll' Name='qmodernwindowsstyle.dll' Source='$(var.QtDllDir)\styles\qmodernwindowsstyle.dll' />
</Component>
</Directory>
<Directory Id='TranslationsFolder' Name='lang'>
Expand Down Expand Up @@ -229,6 +230,7 @@
</Feature>

<MajorUpgrade DowngradeErrorMessage='Downgrade is not allowed'/>
<!-- TODO: remove old workarounds -->
<!--Remove some pre 1.57 versions which can't be upgraded with MajorUpgrade-->
<InstallExecuteSequence>
<Custom Action='UninstallOld152' After='InstallFinalize'>NOT Installed</Custom>
Expand Down

0 comments on commit 501f329

Please sign in to comment.