Skip to content

Commit

Permalink
Use WIX 5
Browse files Browse the repository at this point in the history
IB-8024

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma committed May 3, 2024
1 parent 30281d1 commit eb3ee20
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 156 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -189,8 +189,8 @@ jobs:
sdk: 10.0.19041.0
- name: Install WiX
run: |
dotnet tool install --global wix
wix extension -g add WixToolset.UI.wixext/4.0.4
dotnet tool install -g wix --version 5.0.0
wix extension -g add WixToolset.UI.wixext/5.0.0
- name: Build
run: |
md build/client
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cmake_minimum_required(VERSION 3.16)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/cmake/modules/VersionInfo.cmake)
message(FATAL_ERROR "cmake submodule directory empty, did you 'git clone --recursive'?")
endif()
project(qdigidoc4 VERSION 4.6.0)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
Expand Down
2 changes: 1 addition & 1 deletion cmake
20 changes: 10 additions & 10 deletions extensions/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ add_library(EsteidShellExtension SHARED
EsteidShlExt.cpp
stdafx.cpp
EsteidShellExtension.rc
EsteidShellExtension.rgs
EsteidShlExt_x86.rgs
EsteidShlExt_x64.rgs
)
Expand All @@ -53,16 +52,17 @@ set_target_properties(EsteidShellExtension PROPERTIES
)

add_custom_target(msishellext DEPENDS EsteidShellExtension
COMMAND "$ENV{WIX}bin\\candle.exe" -nologo -arch ${PLATFORM}
-dMSI_VERSION=${VERSION} -dShellExt=$<TARGET_FILE:EsteidShellExtension>
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}/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"
${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}
)

Expand Down
4 changes: 3 additions & 1 deletion extensions/windows/EsteidShellExtension.idl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import "ocidl.idl";
helpstring("IEsteidShlExt Interface"),
pointer_default(unique)
]
interface IEsteidShlExt : IDispatch{
interface IEsteidShlExt : IDispatch
{
};

[
uuid(F4748FA8-B59E-43FA-9D53-2380EB141AED),
version(1.0),
Expand Down
8 changes: 0 additions & 8 deletions extensions/windows/EsteidShellExtension.rc
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ BEGIN
END


/////////////////////////////////////////////////////////////////////////////
//
// REGISTRY
//

IDR_ESTEIDEXT REGISTRY "EsteidShellExtension.rgs"


/////////////////////////////////////////////////////////////////////////////
//
// String Table
Expand Down
11 changes: 0 additions & 11 deletions extensions/windows/EsteidShellExtension.rgs

This file was deleted.

72 changes: 30 additions & 42 deletions extensions/windows/EsteidShellExtension.wxs
Original file line number Diff line number Diff line change
@@ -1,57 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>

<?if $(sys.BUILDARCH) = x64 ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?if $(sys.BUILDARCH) = 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}" ?>
<?define ShellUpgradeCode = "dc5723f9-386f-4581-a872-b9c823dfe40f" ?>
<?define ShellComponentId = "7adaa2cc-c3f5-4e2e-a38d-5d9c9730444e" ?>
<?else ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?else?>
<?define ShellExtId = "{310AAB39-76FE-401B-8A7F-0F578C5F6AB5}" ?>
<?define ShellUpgradeCode = "8c4b5dae-dba9-4445-8584-3d156a48da27" ?>
<?define ShellComponentId = "00ad9482-2770-4dc7-b564-f68268d3f457" ?>
<?endif ?>
<?endif?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Name="EstEID Shell Extension" UpgradeCode="$(var.ShellUpgradeCode)"
Id="*" Language="1033" Version="$(var.MSI_VERSION)" Codepage="1251" Manufacturer="RIA">
<Package Keywords="Installer" InstallerVersion="405" Compressed="yes" InstallScope="perMachine"/>
<MediaTemplate EmbedCab="yes" CompressionLevel="high"/>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package Name="EstEID Shell Extension" UpgradeCode="$(var.ShellUpgradeCode)"
Language="1033" Version="$(var.MSI_VERSION)" Codepage="1251" Manufacturer="RIA" InstallerVersion="500">
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<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."/>
<Condition Message="[ProductName] requires Windows 7 or higher.">
<![CDATA[Installed OR (VersionNT >= 601)]]>
</Condition>
<UIRef Id="WixUI_Minimal2" />
"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." />
<ui:WixUI Id="WixUI_Minimal2" />

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id='$(var.PlatformProgramFilesFolder)'>
<Directory Id="APPLICATIONFOLDER" Name="DigiDoc4 Client">
<Component Id="Application" Guid="$(var.ShellComponentId)">
<!--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='"[APPLICATIONFOLDER]qdigidocclient.exe",0' />
<RegistryValue Root='HKCR' Key='*\shell\[ProductName]\command' Type='string' Value='"[APPLICATIONFOLDER]qdigidocclient.exe" "%1"' /-->
<File Source="$(var.ShellExt)"/>
<RegistryKey Root="HKCR" Key="CLSID\$(var.ShellExtId)\InprocServer32">
<RegistryValue Type="string" Value="[APPLICATIONFOLDER]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>
</Directory>
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="INSTALLFOLDER" Name="DigiDoc4 Client">
<Component Id="Application" Guid="$(var.ShellComponentId)">
<!--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>
</Directory>
</Directory>

<Feature Id="InstallDigidoc" Level="1" Title="Digidoc4 Client Shell Extension" Display="expand" ConfigurableDirectory="APPLICATIONFOLDER">
<ComponentRef Id="Application"/>
</Feature>
</Product>
</StandardDirectory>
</Package>
</Wix>
2 changes: 1 addition & 1 deletion extensions/windows/dllmain.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class CEsteidShellExtensionModule : public CAtlDllModuleT< CEsteidShellExtension
{
public :
DECLARE_LIBID(LIBID_EsteidShellExtensionLib)
DECLARE_REGISTRY_APPID_RESOURCEID(IDR_ESTEIDEXT, "{08BD50C2-0AFC-4ED0-BC78-78488EDF9E58}")
DECLARE_REGISTRY_APPID_RESOURCEID(IDR_ESTEIDSHLEXT, "{F4748FA8-B59E-43FA-9D53-2380EB141AED}")
};

extern class CEsteidShellExtensionModule _AtlModule;
3 changes: 1 addition & 2 deletions extensions/windows/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
// Used by EsteidShellExtension.rc
//
#define IDS_PROJNAME 100
#define IDR_ESTEIDEXT 101
#define IDR_ESTEIDSHLEXT 102
#define IDR_ESTEIDSHLEXT 101
#define IDB_DIGIDOCICO 201

// Next default values for new objects
Expand Down
116 changes: 40 additions & 76 deletions qdigidoc4.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<Icon Id="qdigidoc4.ico" SourceFile="$(var.ico_path)" />
<Property Id="ARPPRODUCTICON" Value="qdigidoc4.ico" />
<Property Id="APPLICATIONNAME" Value="qdigidoc4" />
<Property Id="DESKTOP_SHORTCUT" Value="0" />
<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." />
Expand All @@ -33,17 +32,17 @@
<!-- Desktop shortcut -->
<StandardDirectory Id="DesktopFolder">
<Component Id="DesktopShortcut4" Guid="7B821ED0-4838-4290-997C-AA4119F99DAD" Transitive="yes" Condition="DESKTOP_SHORTCUT = 1">
<Shortcut Id="ClientDesktopShortcut4" Name="DigiDoc4" Target="[!qdigidoc4.exe]" WorkingDirectory="APPLICATIONFOLDER" />
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[APPLICATIONNAME]" Name="DesktopShortcut4" Value="1" Type="integer" KeyPath="yes" />
<Shortcut Id="ClientDesktopShortcut4" Name="DigiDoc4" Target="[!qdigidoc4.exe]" WorkingDirectory="INSTALLFOLDER" />
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\qdigidoc4" Name="DesktopShortcut4" Value="1" Type="integer" KeyPath="yes" />
</Component>
</StandardDirectory>

<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="APPLICATIONFOLDER" Name="DigiDoc4 Client" FileSource="$(var.libs_path)">
<Component Id="Application4" Guid="316B00EB-7519-476F-BCA5-7C8C1A0DF5AB" Transitive="yes">
<Directory Id="INSTALLFOLDER" Name="!(bind.Property.ProductName)" FileSource="$(var.libs_path)">
<Component Id="Application4">
<File Id="qdigidoc4.exe" Source="$(var.client_path)" KeyPath="yes">
<Shortcut Id="ClientStartMenu4" Advertise="yes" Name="DigiDoc4" Icon="qdigidoc4.ico"
Directory="ProgramMenuFolder" WorkingDirectory="APPLICATIONFOLDER" />
Directory="ProgramMenuFolder" WorkingDirectory="INSTALLFOLDER" />
</File>
<ProgId Id="qdigidoc4.adoc" Description="DigiDoc signed document" Icon="qdigidoc4.exe" IconIndex="1">
<Extension Id="adoc" ContentType="application/vnd.lt.archyvai.adoc-2008">
Expand Down Expand Up @@ -96,87 +95,52 @@
</Extension>
</ProgId>
</Component>
<Component Id="Base" Guid="6976e89e-e815-444a-9b1f-5ee63cfe230d">
<File Name="zlib$(var.qt_suffix)1.dll" />
<File Name="xerces-c_3_2$(var.qt_suffix).dll" />
<File Name="XalanMessages_1_12$(var.qt_suffix).dll" />
<File Name="Xalan-C_1_12$(var.qt_suffix).dll" />
<File Name="xsec_2_0$(var.qt_suffix).dll" />
<File Name="digidocpp$(var.qt_suffix).dll" />
<File Name="digidoc-tool.exe" />
<File Name="digidocpp.conf" />
<File Name="zlib$(var.qt_suffix)1.dll" />
<File Name="xerces-c_3_2$(var.qt_suffix).dll" />
<File Name="XalanMessages_1_12$(var.qt_suffix).dll" />
<File Name="Xalan-C_1_12$(var.qt_suffix).dll" />
<File Name="xsec_2_0$(var.qt_suffix).dll" />
<File Name="digidocpp$(var.qt_suffix).dll" />
<File Name="digidoc-tool.exe" />
<File Name="digidocpp.conf" />
<?ifdef var.qt_path ?>
<File Source="$(var.VCPATH)\msvcp140$(var.qt_suffix).dll" />
<File Source="$(var.VCPATH)\vcruntime140$(var.qt_suffix).dll" />
<?if $(sys.BUILDARCH) = x64 ?>
<File Source="$(var.VCPATH)\msvcp140_1$(var.qt_suffix).dll" />
<File Source="$(var.VCPATH)\msvcp140_2$(var.qt_suffix).dll" />
<File Source="$(var.VCPATH)\vcruntime140_1$(var.qt_suffix).dll" />
<File Name="libcrypto-3$(var.OpenSSLSuffix).dll" />
<File Name="libssl-3$(var.OpenSSLSuffix).dll" />
<File Source="$(var.VCPATH)\msvcp140$(var.qt_suffix).dll" />
<File Source="$(var.VCPATH)\msvcp140_1$(var.qt_suffix).dll" />
<File Source="$(var.VCPATH)\msvcp140_2$(var.qt_suffix).dll" />
<File Source="$(var.VCPATH)\vcruntime140$(var.qt_suffix).dll" />
<?if $(sys.BUILDARCH) != x86 ?>
<File Source="$(var.VCPATH)\vcruntime140_1$(var.qt_suffix).dll" />
<?endif?>
<File Name="libcrypto-3$(var.OpenSSLSuffix).dll" />
<File Name="libssl-3$(var.OpenSSLSuffix).dll" />
<File Source="$(var.qt_path)\Qt6Core$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\Qt6Gui$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\Qt6Network$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\Qt6PrintSupport$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\Qt6Svg$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\Qt6Widgets$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\D3DCompiler_47.dll" />
<File Source="$(var.qt_path)\opengl32sw.dll" />
<File Source="$(var.qt_path)\Qt6SvgWidgets$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\Qt6Core$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\Qt6Gui$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\Qt6Network$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\Qt6PrintSupport$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\Qt6Svg$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\Qt6Widgets$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\D3DCompiler_47.dll" />
<File Source="$(var.qt_path)\opengl32sw.dll" />
<File Source="$(var.qt_path)\Qt6SvgWidgets$(var.qt_suffix).dll" />
<?endif?>
</Component>
<Directory Id="SchemaFolder" Name="schema" FileSource="$(var.libs_path)\schema">
<Component Id="Schemas" Guid="caf25ecf-70d0-46e4-9b82-21df3c2da235">
<File Name="xml.xsd" />
<File Name="conf.xsd" />
<File Name="OpenDocument_manifest.xsd" />
<File Name="OpenDocument_manifest_v1_2.xsd" />
<File Name="xmldsig-core-schema.xsd" />
<File Name="XAdES01903v132-201601.xsd" />
<File Name="XAdES01903v132-201601-relaxed.xsd" />
<File Name="XAdES01903v141-201601.xsd" />
<File Name="ts_119612v020201_201601xsd.xsd" />
<File Name="en_31916201v010101.xsd" />
<File Name="OpenDocument_dsig.xsd" />
</Component>
<Directory Name="schema">
<Files Include="$(var.libs_path)\schema\*.xsd" />
</Directory>
<?ifdef var.qt_path ?>
<Directory Id="platforms" Name="platforms">
<Component Id="qwindows.dll">
<File Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
</Component>
<Directory Name="platforms">
<File Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
</Directory>
<Directory Id="tls" Name="tls">
<Component Id="qopensslbackend.dll">
<File Source="$(var.qt_path)\..\plugins\tls\qopensslbackend$(var.qt_suffix).dll" />
</Component>
<Directory Name="tls">
<File Source="$(var.qt_path)\..\plugins\tls\qopensslbackend$(var.qt_suffix).dll" />
</Directory>
<Directory Id="styles" Name="styles">
<Component Id="qwindowsvistastyle.dll">
<File Source="$(var.qt_path)\..\plugins\styles\qwindowsvistastyle$(var.qt_suffix).dll" />
</Component>
<Directory Name="styles">
<File Source="$(var.qt_path)\..\plugins\styles\qwindowsvistastyle$(var.qt_suffix).dll" />
</Directory>
<Directory Id="imageformats" Name="imageformats">
<Component Id="imageformats.dll">
<File Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
</Component>
<Directory Name="imageformats">
<File Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
</Directory>
<?endif?>
</Directory>
</StandardDirectory>

<Feature Id="InstallDigidoc" Level="1" Title="DigiDoc4 Client" Display="expand" ConfigurableDirectory="APPLICATIONFOLDER">
<ComponentRef Id="DesktopShortcut4" />
<ComponentRef Id="Application4" />
<ComponentRef Id="Base" />
<ComponentRef Id="Schemas" />
<?ifdef var.qt_path ?>
<ComponentRef Id="qwindows.dll" />
<ComponentRef Id="qwindowsvistastyle.dll" />
<ComponentRef Id="qopensslbackend.dll" />
<ComponentRef Id="imageformats.dll" />
<?endif?>
</Feature>
</Package>
</Wix>

0 comments on commit eb3ee20

Please sign in to comment.