Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge shell extension installer to main installer #1254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,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
Expand Down
3 changes: 2 additions & 1 deletion client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,12 @@ elseif(WIN32)
-d libs_path=${LIBS_PATH}
-d client_path=$<TARGET_FILE:${PROJECT_NAME}>
-d qt_suffix=$<$<CONFIG:Debug>:d>
-d ShellExt=$<TARGET_FILE:EsteidShellExtension>
${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"
Expand Down
35 changes: 1 addition & 34 deletions extensions/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
cmake_minimum_required(VERSION 3.16)
project(EsteidShellExtension VERSION 3.13.9)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

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(
Expand All @@ -37,41 +30,15 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
COMPILE_DEFINITIONS "_UNICODE;UNICODE;_WINDLL"
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 ${PROJECT_NAME}
COMMAND wix.exe build -nologo
-arch ${PLATFORM}
-d MSI_VERSION=${VERSION}
-d ShellExt=$<TARGET_FILE:EsteidShellExtension>
${CMAKE_CURRENT_SOURCE_DIR}/EsteidShellExtension.wxs
${CMAKE_MODULE_PATH}/WelcomeDlg.wxs
${CMAKE_MODULE_PATH}/WixUI_Minimal.wxs
-ext WixToolset.UI.wixext
-bv WixUIDialogBmp=${CMAKE_MODULE_PATH}/dlgbmp.bmp
-bv WixUIBannerBmp=${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(${PROJECT_NAME} PRIVATE "/INTEGRITYCHECK")
endif()
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
"$<$<BOOL:${CROSSSIGNCERT}>:/ph;/ac;${CROSSSIGNCERT}>"
/tr http://timestamp.digicert.com /td SHA256 $<TARGET_FILE:EsteidShellExtension>
COMMAND_EXPAND_LISTS
)
add_custom_command(TARGET msishellext POST_BUILD
COMMAND signtool.exe sign /a /v /s MY /n "${SIGNCERT}" /fd SHA256 /du http://installer.id.ee
/tr http://timestamp.digicert.com /td SHA256
"${CMAKE_BINARY_DIR}/Digidoc_ShellExt-${VERSION}$ENV{VER_SUFFIX}.${PLATFORM}.msi"
/tr http://timestamp.digicert.com /td SHA256 $<TARGET_FILE:${PROJECT_NAME}>
)
endif()
45 changes: 0 additions & 45 deletions extensions/windows/EsteidShellExtension.wxs

This file was deleted.

24 changes: 24 additions & 0 deletions qdigidoc4.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<?if $(sys.BUILDARCH) = x64 ?>
<?define OpenSSLSuffix = "-x64" ?>
<!-- Separate upgrade code / component ID created for x64 installer because both 32-
and 64-bit shell extensions are installed on x64 machine and x64 installer
removes x86 component installed directly before it if same guids are used.
-->
<?define ShellExtId = "{5606A547-759D-43DA-AEEB-D3BF1D1E816D}" ?>
<?else?>
<?define OpenSSLSuffix = "" ?>
<?define ShellExtId = "{310AAB39-76FE-401B-8A7F-0F578C5F6AB5}" ?>
<?endif?>

<?if $(env.VisualStudioVersion) = "17.0" ?>
Expand All @@ -24,6 +30,7 @@
<Icon Id="qdigidoc4.ico" SourceFile="$(var.ico_path)" />
<Property Id="ARPPRODUCTICON" Value="qdigidoc4.ico" />
<Property Id="DESKTOP_SHORTCUT" Value="0" />
<Property Id="SHELL_EXTENSION" Value="1" />
<MajorUpgrade AllowSameVersionUpgrades="yes" Schedule="afterInstallInitialize" DowngradeErrorMessage=
"A newer version of [ProductName] is already installed. If you are trying to downgrade, please uninstall the newer version first." />
<Launch Condition="Installed OR (VersionNT &gt;= 601)" Message="[ProductName] requires Windows 7 or higher." />
Expand Down Expand Up @@ -136,6 +143,23 @@
<Directory Name="imageformats">
<File Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
</Directory>
<?endif?>
<?ifdef var.ShellExt ?>
<Component Id="ShellExt" Guid="7adaa2cc-c3f5-4e2e-a38d-5d9c9730444e" Transitive="yes" Condition="SHELL_EXTENSION = 1">
<!--Does not work with multiple files -->
<!--RegistryValue Root="HKCR" Key="*\shell\[ProductName]" Type="string" Value="Sign with [ProductName]" />
<RegistryValue Root="HKCR" Key="*\shell\[ProductName]" Name="Icon" Type="string" Value=""[INSTALLFOLDER]qdigidoc4.exe",0" />
<RegistryValue Root="HKCR" Key="*\shell\[ProductName]\command" Type="string" Value=""[INSTALLFOLDER]qdigidoc4.exe" "%1"" /-->
<File Source="$(var.ShellExt)"/>
<RegistryKey Root="HKCR" Key="CLSID\$(var.ShellExtId)\InprocServer32">
<RegistryValue Type="string" Value="[INSTALLFOLDER]EsteidShellExtension.dll"/>
<RegistryValue Type="string" Name="ThreadingModel" Value="Apartment" />
</RegistryKey>
<RegistryValue Root="HKCR" Key="*\shellex\ContextMenuHandlers\DigiDoc4ShellExtension$(sys.BUILDARCH)"
Value="$(var.ShellExtId)" Type="string" />
<RegistryValue Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved"
Name="$(var.ShellExtId)" Value="DigiDoc4 Shell Extension" Type="string" />
</Component>
<?endif?>
</Directory>
</StandardDirectory>
Expand Down
Loading