From 32e2fb7ae98daeeb1930a7e40dc5b7f35b282ad0 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Sun, 31 Mar 2024 14:43:40 +0300 Subject: [PATCH] Merge shell extension installer to main installer IB-7980 Signed-off-by: Raul Metsma --- .github/workflows/build.yml | 7 ++- client/CMakeLists.txt | 3 +- extensions/windows/CMakeLists.txt | 48 +++-------------- extensions/windows/EsteidShellExtension.wxs | 57 --------------------- qdigidoc4.wxs | 36 +++++++++++-- 5 files changed, 44 insertions(+), 107 deletions(-) delete mode 100644 extensions/windows/EsteidShellExtension.wxs diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 294bf00d5..83fd66390 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,10 +62,10 @@ jobs: steps: - name: Install dependencies if: matrix.container == '20.04' - run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper pkg-config cmake libldap2-dev gettext libpcsclite-dev libssl-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev lintian libflatbuffers-dev zlib1g-dev + run: apt update -qq && apt install --no-install-recommends -y git lsb-release build-essential devscripts debhelper pkg-config cmake libldap2-dev gettext libpcsclite-dev libssl-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev lintian libflatbuffers-dev zlib1g-dev - name: Install dependencies if: matrix.container != '20.04' - run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper pkg-config cmake libldap2-dev gettext libpcsclite-dev libssl-dev libgl-dev libqt6svg6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools lintian libflatbuffers-dev zlib1g-dev + run: apt update -qq && apt install --no-install-recommends -y git lsb-release build-essential devscripts debhelper pkg-config cmake libldap2-dev gettext libpcsclite-dev libssl-dev libgl-dev libqt6svg6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools lintian libflatbuffers-dev zlib1g-dev - name: Checkout uses: actions/checkout@v4 with: @@ -190,7 +190,7 @@ jobs: - name: Install WiX run: | dotnet tool install --global wix - wix extension -g add WixToolset.UI.wixext/4.0.4 + wix extension -g add WixToolset.UI.wixext/4.0.5 - name: Build run: | md build/client @@ -199,7 +199,6 @@ jobs: -DCMAKE_TOOLCHAIN_FILE=${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ` "-DLibDigiDocpp_ROOT=libs/PFiles64/libdigidocpp" cmake --build build --target msi - cmake --build build --target msishellext cmake --build build --target appx - name: Archive artifacts uses: actions/upload-artifact@v4 diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 8986587b6..3ed60ca4d 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -230,11 +230,12 @@ elseif(WIN32) -d libs_path=${LIBS_PATH} -d client_path=$ -d qt_suffix=$<$:d> + -d ShellExt=$ ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.wxs ${CMAKE_SOURCE_DIR}/cmake/modules/WelcomeDlg.wxs ${CMAKE_SOURCE_DIR}/cmake/modules/WixUI_Minimal.wxs ) - add_custom_target(msi DEPENDS ${PROJECT_NAME} + add_custom_target(msi DEPENDS ${PROJECT_NAME} EsteidShellExtension COMMAND ${WIX_CMD} -o "${MSI_FILE}.msi" #Build MSI with QT COMMAND ${WIX_CMD} -d qt_path=${qtCore_install_prefix} -o "${MSI_FILE}.qt.msi" diff --git a/extensions/windows/CMakeLists.txt b/extensions/windows/CMakeLists.txt index 7845191e5..a22817ed4 100644 --- a/extensions/windows/CMakeLists.txt +++ b/extensions/windows/CMakeLists.txt @@ -1,17 +1,10 @@ -cmake_minimum_required(VERSION 3.16) -project(digidocshellextension VERSION 3.13.9) - -set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -include( VersionInfo ) +project(EsteidShellExtension VERSION 3.13.9) +include(VersionInfo) if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(MIDL_TARGET "x64") - set(PLATFORM "x64") else() set(MIDL_TARGET "win32") - set(PLATFORM "x86") endif() add_custom_command( @@ -19,7 +12,7 @@ add_custom_command( ${CMAKE_CURRENT_BINARY_DIR}/EsteidShellExtension_i.c ${CMAKE_CURRENT_BINARY_DIR}/EsteidShellExtension_p.c COMMAND Midl.Exe ${CMAKE_CURRENT_SOURCE_DIR}/EsteidShellExtension.idl - /nologo /no_robust /char signed /Oicf /env ${MIDL_TARGET} + /nologo /char signed /Oicf /env ${MIDL_TARGET} /I ${CMAKE_CURRENT_SOURCE_DIR} /tlb EsteidShellExtension.tlb /h EsteidShellExtension_i.h @@ -29,7 +22,7 @@ add_custom_command( VERBATIM ) -add_library(EsteidShellExtension SHARED +add_library(${PROJECT_NAME} SHARED ${CMAKE_CURRENT_BINARY_DIR}/EsteidShellExtension_i.c dllmain.cpp EsteidShellExtension.cpp @@ -41,44 +34,19 @@ add_library(EsteidShellExtension SHARED EsteidShlExt_x86.rgs EsteidShlExt_x64.rgs ) -set_target_properties(EsteidShellExtension PROPERTIES +set_target_properties(${PROJECT_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" COMPILE_DEFINITIONS "_UNICODE;UNICODE;_MERGE_PROXYSTUB;_WINDLL" - COMPILE_OPTIONS "/guard:cf" INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR} - INTERPROCEDURAL_OPTIMIZATION YES + COMPILE_OPTIONS "/guard:cf" LINK_OPTIONS "/guard:cf" LINK_LIBRARIES "uxtheme.lib" SKIP_AUTOMOC ON ) -add_custom_target(msishellext DEPENDS EsteidShellExtension - COMMAND "$ENV{WIX}bin\\candle.exe" -nologo -arch ${PLATFORM} - -dMSI_VERSION=${VERSION} -dShellExt=$ - ${CMAKE_CURRENT_SOURCE_DIR}/EsteidShellExtension.wxs - ${CMAKE_MODULE_PATH}/WelcomeDlg2.wxs - ${CMAKE_MODULE_PATH}/WixUI_Minimal2.wxs - COMMAND "$ENV{WIX}bin\\light.exe" -nologo -ext WixUIExtension - EsteidShellExtension.wixobj WelcomeDlg2.wixobj WixUI_Minimal2.wixobj - -dWixUIDialogBmp=${CMAKE_MODULE_PATH}/dlgbmp.bmp - -dWixUIBannerBmp=${CMAKE_MODULE_PATH}/banner.bmp - -o "Digidoc_ShellExt-${VERSION}$ENV{VER_SUFFIX}.${PLATFORM}.msi" - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} -) - if(SIGNCERT) - if(CROSSSIGNCERT) - target_link_options(EsteidShellExtension PRIVATE "/INTEGRITYCHECK") - endif() - add_custom_command(TARGET EsteidShellExtension POST_BUILD - COMMAND signtool.exe sign /a /v /s MY /n "${SIGNCERT}" /fd SHA256 /du http://installer.id.ee - "$<$:/ph;/ac;${CROSSSIGNCERT}>" - /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 $ - COMMAND_EXPAND_LISTS - ) - add_custom_command(TARGET msishellext POST_BUILD + add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND signtool.exe sign /a /v /s MY /n "${SIGNCERT}" /fd SHA256 /du http://installer.id.ee - /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 - "${CMAKE_BINARY_DIR}/Digidoc_ShellExt-${VERSION}$ENV{VER_SUFFIX}.${PLATFORM}.msi" + /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 $ ) endif() diff --git a/extensions/windows/EsteidShellExtension.wxs b/extensions/windows/EsteidShellExtension.wxs deleted file mode 100644 index 5fbe4068f..000000000 --- a/extensions/windows/EsteidShellExtension.wxs +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - = 601)]]> - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qdigidoc4.wxs b/qdigidoc4.wxs index d699d399c..8c4eba355 100644 --- a/qdigidoc4.wxs +++ b/qdigidoc4.wxs @@ -1,7 +1,13 @@ + + + @@ -23,8 +29,8 @@ - + @@ -33,17 +39,17 @@ - - + + - + + Directory="ProgramMenuFolder" WorkingDirectory="INSTALLFOLDER" /> @@ -162,6 +168,23 @@ + + + + + + + + + + + + + @@ -176,6 +199,9 @@ + + +