Skip to content

Commit a72b79e

Browse files
authored
Use WIX 5 (#1256)
IB-8024 Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent 30281d1 commit a72b79e

File tree

6 files changed

+88
-132
lines changed

6 files changed

+88
-132
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ jobs:
6262
steps:
6363
- name: Install dependencies
6464
if: matrix.container == '20.04'
65-
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
65+
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
6666
- name: Install dependencies
6767
if: matrix.container != '20.04'
68-
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
68+
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
6969
- name: Checkout
7070
uses: actions/checkout@v4
7171
with:
@@ -189,8 +189,8 @@ jobs:
189189
sdk: 10.0.19041.0
190190
- name: Install WiX
191191
run: |
192-
dotnet tool install --global wix
193-
wix extension -g add WixToolset.UI.wixext/4.0.4
192+
dotnet tool install -g wix --version 5.0.0
193+
wix extension -g add WixToolset.UI.wixext/5.0.0
194194
- name: Build
195195
run: |
196196
md build/client

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
cmake_minimum_required(VERSION 3.16)
2+
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/cmake/modules/VersionInfo.cmake)
3+
message(FATAL_ERROR "cmake submodule directory empty, did you 'git clone --recursive'?")
4+
endif()
25
project(qdigidoc4 VERSION 4.6.0)
36

47
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)

extensions/windows/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,17 @@ set_target_properties(EsteidShellExtension PROPERTIES
5353
)
5454

5555
add_custom_target(msishellext DEPENDS EsteidShellExtension
56-
COMMAND "$ENV{WIX}bin\\candle.exe" -nologo -arch ${PLATFORM}
57-
-dMSI_VERSION=${VERSION} -dShellExt=$<TARGET_FILE:EsteidShellExtension>
56+
COMMAND wix.exe build -nologo
57+
-arch ${PLATFORM}
58+
-d MSI_VERSION=${VERSION}
59+
-d ShellExt=$<TARGET_FILE:EsteidShellExtension>
5860
${CMAKE_CURRENT_SOURCE_DIR}/EsteidShellExtension.wxs
59-
${CMAKE_MODULE_PATH}/WelcomeDlg2.wxs
60-
${CMAKE_MODULE_PATH}/WixUI_Minimal2.wxs
61-
COMMAND "$ENV{WIX}bin\\light.exe" -nologo -ext WixUIExtension
62-
EsteidShellExtension.wixobj WelcomeDlg2.wixobj WixUI_Minimal2.wixobj
63-
-dWixUIDialogBmp=${CMAKE_MODULE_PATH}/dlgbmp.bmp
64-
-dWixUIBannerBmp=${CMAKE_MODULE_PATH}/banner.bmp
65-
-o "Digidoc_ShellExt-${VERSION}$ENV{VER_SUFFIX}.${PLATFORM}.msi"
61+
${CMAKE_MODULE_PATH}/WelcomeDlg.wxs
62+
${CMAKE_MODULE_PATH}/WixUI_Minimal.wxs
63+
-ext WixToolset.UI.wixext
64+
-bv WixUIDialogBmp=${CMAKE_MODULE_PATH}/dlgbmp.bmp
65+
-bv WixUIBannerBmp=${CMAKE_MODULE_PATH}/banner.bmp
66+
-o Digidoc_ShellExt-${VERSION}$ENV{VER_SUFFIX}.${PLATFORM}.msi
6667
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
6768
)
6869

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,45 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
3-
<?if $(sys.BUILDARCH) = x64 ?>
4-
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
1+
<?if $(sys.BUILDARCH) = x64 ?>
52
<!-- Separate upgrade code / component ID created for x64 installer because both 32-
63
and 64-bit shell extensions are installed on x64 machine and x64 installer
74
removes x86 component installed directly before it if same guids are used.
85
-->
96
<?define ShellExtId = "{5606A547-759D-43DA-AEEB-D3BF1D1E816D}" ?>
107
<?define ShellUpgradeCode = "dc5723f9-386f-4581-a872-b9c823dfe40f" ?>
118
<?define ShellComponentId = "7adaa2cc-c3f5-4e2e-a38d-5d9c9730444e" ?>
12-
<?else ?>
13-
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
9+
<?else?>
1410
<?define ShellExtId = "{310AAB39-76FE-401B-8A7F-0F578C5F6AB5}" ?>
1511
<?define ShellUpgradeCode = "8c4b5dae-dba9-4445-8584-3d156a48da27" ?>
1612
<?define ShellComponentId = "00ad9482-2770-4dc7-b564-f68268d3f457" ?>
17-
<?endif ?>
13+
<?endif?>
1814

19-
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
20-
<Product Name="EstEID Shell Extension" UpgradeCode="$(var.ShellUpgradeCode)"
21-
Id="*" Language="1033" Version="$(var.MSI_VERSION)" Codepage="1251" Manufacturer="RIA">
22-
<Package Keywords="Installer" InstallerVersion="405" Compressed="yes" InstallScope="perMachine"/>
23-
<MediaTemplate EmbedCab="yes" CompressionLevel="high"/>
15+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
16+
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
17+
<Package Name="EstEID Shell Extension" UpgradeCode="$(var.ShellUpgradeCode)"
18+
Language="1033" Version="$(var.MSI_VERSION)" Codepage="1251" Manufacturer="RIA" InstallerVersion="500">
19+
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
2420
<MajorUpgrade AllowSameVersionUpgrades="yes" Schedule="afterInstallInitialize" DowngradeErrorMessage=
25-
"A newer version of [ProductName] is already installed. If you are trying to downgrade, please uninstall the newer version first."/>
26-
<Condition Message="[ProductName] requires Windows 7 or higher.">
27-
<![CDATA[Installed OR (VersionNT >= 601)]]>
28-
</Condition>
29-
<UIRef Id="WixUI_Minimal2" />
21+
"A newer version of [ProductName] is already installed. If you are trying to downgrade, please uninstall the newer version first." />
22+
<Launch Condition="Installed OR (VersionNT &gt;= 601)" Message="[ProductName] requires Windows 7 or higher." />
23+
<ui:WixUI Id="WixUI_Minimal2" />
3024

31-
<Directory Id="TARGETDIR" Name="SourceDir">
32-
<Directory Id='$(var.PlatformProgramFilesFolder)'>
33-
<Directory Id="APPLICATIONFOLDER" Name="DigiDoc4 Client">
34-
<Component Id="Application" Guid="$(var.ShellComponentId)">
35-
<!--Does not work with multiple files -->
36-
<!--RegistryValue Root='HKCR' Key='*\shell\[ProductName]' Type='string' Value='Sign with [ProductName]' />
37-
<RegistryValue Root='HKCR' Key='*\shell\[ProductName]' Name="Icon" Type='string' Value='"[APPLICATIONFOLDER]qdigidocclient.exe",0' />
38-
<RegistryValue Root='HKCR' Key='*\shell\[ProductName]\command' Type='string' Value='"[APPLICATIONFOLDER]qdigidocclient.exe" "%1"' /-->
39-
<File Source="$(var.ShellExt)"/>
40-
<RegistryKey Root="HKCR" Key="CLSID\$(var.ShellExtId)\InprocServer32">
41-
<RegistryValue Type="string" Value="[APPLICATIONFOLDER]EsteidShellExtension.dll"/>
42-
<RegistryValue Type="string" Name="ThreadingModel" Value="Apartment" />
43-
</RegistryKey>
44-
<RegistryValue Root="HKCR" Key="*\shellex\ContextMenuHandlers\DigiDoc4ShellExtension$(sys.BUILDARCH)"
45-
Value="$(var.ShellExtId)" Type="string" />
46-
<RegistryValue Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved"
47-
Name="$(var.ShellExtId)" Value="DigiDoc4 Shell Extension" Type="string" />
48-
</Component>
49-
</Directory>
25+
<StandardDirectory Id="ProgramFiles6432Folder">
26+
<Directory Id="INSTALLFOLDER" Name="DigiDoc4 Client">
27+
<Component Id="Application" Guid="$(var.ShellComponentId)">
28+
<!--Does not work with multiple files -->
29+
<!--RegistryValue Root='HKCR' Key='*\shell\[ProductName]' Type='string' Value='Sign with [ProductName]' />
30+
<RegistryValue Root='HKCR' Key='*\shell\[ProductName]' Name="Icon" Type='string' Value='"[INSTALLFOLDER]qdigidoc4.exe",0' />
31+
<RegistryValue Root='HKCR' Key='*\shell\[ProductName]\command' Type='string' Value='"[INSTALLFOLDER]qdigidoc4.exe" "%1"' /-->
32+
<File Source="$(var.ShellExt)" />
33+
<RegistryKey Root="HKCR" Key="CLSID\$(var.ShellExtId)\InprocServer32">
34+
<RegistryValue Type="string" Value="[INSTALLFOLDER]EsteidShellExtension.dll" />
35+
<RegistryValue Type="string" Name="ThreadingModel" Value="Apartment" />
36+
</RegistryKey>
37+
<RegistryValue Root="HKCR" Key="*\shellex\ContextMenuHandlers\DigiDoc4ShellExtension$(sys.BUILDARCH)"
38+
Value="$(var.ShellExtId)" Type="string" />
39+
<RegistryValue Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved"
40+
Name="$(var.ShellExtId)" Value="DigiDoc4 Shell Extension" Type="string" />
41+
</Component>
5042
</Directory>
51-
</Directory>
52-
53-
<Feature Id="InstallDigidoc" Level="1" Title="Digidoc4 Client Shell Extension" Display="expand" ConfigurableDirectory="APPLICATIONFOLDER">
54-
<ComponentRef Id="Application"/>
55-
</Feature>
56-
</Product>
43+
</StandardDirectory>
44+
</Package>
5745
</Wix>

qdigidoc4.wxs

Lines changed: 40 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
2424
<Icon Id="qdigidoc4.ico" SourceFile="$(var.ico_path)" />
2525
<Property Id="ARPPRODUCTICON" Value="qdigidoc4.ico" />
26-
<Property Id="APPLICATIONNAME" Value="qdigidoc4" />
2726
<Property Id="DESKTOP_SHORTCUT" Value="0" />
2827
<MajorUpgrade AllowSameVersionUpgrades="yes" Schedule="afterInstallInitialize" DowngradeErrorMessage=
2928
"A newer version of [ProductName] is already installed. If you are trying to downgrade, please uninstall the newer version first." />
@@ -33,17 +32,17 @@
3332
<!-- Desktop shortcut -->
3433
<StandardDirectory Id="DesktopFolder">
3534
<Component Id="DesktopShortcut4" Guid="7B821ED0-4838-4290-997C-AA4119F99DAD" Transitive="yes" Condition="DESKTOP_SHORTCUT = 1">
36-
<Shortcut Id="ClientDesktopShortcut4" Name="DigiDoc4" Target="[!qdigidoc4.exe]" WorkingDirectory="APPLICATIONFOLDER" />
37-
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[APPLICATIONNAME]" Name="DesktopShortcut4" Value="1" Type="integer" KeyPath="yes" />
35+
<Shortcut Id="ClientDesktopShortcut4" Name="DigiDoc4" Target="[!qdigidoc4.exe]" WorkingDirectory="INSTALLFOLDER" />
36+
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\qdigidoc4" Name="DesktopShortcut4" Value="1" Type="integer" KeyPath="yes" />
3837
</Component>
3938
</StandardDirectory>
4039

4140
<StandardDirectory Id="ProgramFiles6432Folder">
42-
<Directory Id="APPLICATIONFOLDER" Name="DigiDoc4 Client" FileSource="$(var.libs_path)">
43-
<Component Id="Application4" Guid="316B00EB-7519-476F-BCA5-7C8C1A0DF5AB" Transitive="yes">
41+
<Directory Id="INSTALLFOLDER" Name="!(bind.Property.ProductName)" FileSource="$(var.libs_path)">
42+
<Component Id="Application4">
4443
<File Id="qdigidoc4.exe" Source="$(var.client_path)" KeyPath="yes">
4544
<Shortcut Id="ClientStartMenu4" Advertise="yes" Name="DigiDoc4" Icon="qdigidoc4.ico"
46-
Directory="ProgramMenuFolder" WorkingDirectory="APPLICATIONFOLDER" />
45+
Directory="ProgramMenuFolder" WorkingDirectory="INSTALLFOLDER" />
4746
</File>
4847
<ProgId Id="qdigidoc4.adoc" Description="DigiDoc signed document" Icon="qdigidoc4.exe" IconIndex="1">
4948
<Extension Id="adoc" ContentType="application/vnd.lt.archyvai.adoc-2008">
@@ -96,87 +95,52 @@
9695
</Extension>
9796
</ProgId>
9897
</Component>
99-
<Component Id="Base" Guid="6976e89e-e815-444a-9b1f-5ee63cfe230d">
100-
<File Name="zlib$(var.qt_suffix)1.dll" />
101-
<File Name="xerces-c_3_2$(var.qt_suffix).dll" />
102-
<File Name="XalanMessages_1_12$(var.qt_suffix).dll" />
103-
<File Name="Xalan-C_1_12$(var.qt_suffix).dll" />
104-
<File Name="xsec_2_0$(var.qt_suffix).dll" />
105-
<File Name="digidocpp$(var.qt_suffix).dll" />
106-
<File Name="digidoc-tool.exe" />
107-
<File Name="digidocpp.conf" />
98+
<File Name="zlib$(var.qt_suffix)1.dll" />
99+
<File Name="xerces-c_3_2$(var.qt_suffix).dll" />
100+
<File Name="XalanMessages_1_12$(var.qt_suffix).dll" />
101+
<File Name="Xalan-C_1_12$(var.qt_suffix).dll" />
102+
<File Name="xsec_2_0$(var.qt_suffix).dll" />
103+
<File Name="digidocpp$(var.qt_suffix).dll" />
104+
<File Name="digidoc-tool.exe" />
105+
<File Name="digidocpp.conf" />
108106
<?ifdef var.qt_path ?>
109-
<File Source="$(var.VCPATH)\msvcp140$(var.qt_suffix).dll" />
110-
<File Source="$(var.VCPATH)\vcruntime140$(var.qt_suffix).dll" />
111-
<?if $(sys.BUILDARCH) = x64 ?>
112-
<File Source="$(var.VCPATH)\msvcp140_1$(var.qt_suffix).dll" />
113-
<File Source="$(var.VCPATH)\msvcp140_2$(var.qt_suffix).dll" />
114-
<File Source="$(var.VCPATH)\vcruntime140_1$(var.qt_suffix).dll" />
107+
<File Name="libcrypto-3$(var.OpenSSLSuffix).dll" />
108+
<File Name="libssl-3$(var.OpenSSLSuffix).dll" />
109+
<File Source="$(var.VCPATH)\msvcp140$(var.qt_suffix).dll" />
110+
<File Source="$(var.VCPATH)\msvcp140_1$(var.qt_suffix).dll" />
111+
<File Source="$(var.VCPATH)\msvcp140_2$(var.qt_suffix).dll" />
112+
<File Source="$(var.VCPATH)\vcruntime140$(var.qt_suffix).dll" />
113+
<?if $(sys.BUILDARCH) != x86 ?>
114+
<File Source="$(var.VCPATH)\vcruntime140_1$(var.qt_suffix).dll" />
115115
<?endif?>
116-
<File Name="libcrypto-3$(var.OpenSSLSuffix).dll" />
117-
<File Name="libssl-3$(var.OpenSSLSuffix).dll" />
118-
<File Source="$(var.qt_path)\Qt6Core$(var.qt_suffix).dll" />
119-
<File Source="$(var.qt_path)\Qt6Gui$(var.qt_suffix).dll" />
120-
<File Source="$(var.qt_path)\Qt6Network$(var.qt_suffix).dll" />
121-
<File Source="$(var.qt_path)\Qt6PrintSupport$(var.qt_suffix).dll" />
122-
<File Source="$(var.qt_path)\Qt6Svg$(var.qt_suffix).dll" />
123-
<File Source="$(var.qt_path)\Qt6Widgets$(var.qt_suffix).dll" />
124-
<File Source="$(var.qt_path)\D3DCompiler_47.dll" />
125-
<File Source="$(var.qt_path)\opengl32sw.dll" />
126-
<File Source="$(var.qt_path)\Qt6SvgWidgets$(var.qt_suffix).dll" />
116+
<File Source="$(var.qt_path)\Qt6Core$(var.qt_suffix).dll" />
117+
<File Source="$(var.qt_path)\Qt6Gui$(var.qt_suffix).dll" />
118+
<File Source="$(var.qt_path)\Qt6Network$(var.qt_suffix).dll" />
119+
<File Source="$(var.qt_path)\Qt6PrintSupport$(var.qt_suffix).dll" />
120+
<File Source="$(var.qt_path)\Qt6Svg$(var.qt_suffix).dll" />
121+
<File Source="$(var.qt_path)\Qt6Widgets$(var.qt_suffix).dll" />
122+
<File Source="$(var.qt_path)\D3DCompiler_47.dll" />
123+
<File Source="$(var.qt_path)\opengl32sw.dll" />
124+
<File Source="$(var.qt_path)\Qt6SvgWidgets$(var.qt_suffix).dll" />
127125
<?endif?>
128-
</Component>
129-
<Directory Id="SchemaFolder" Name="schema" FileSource="$(var.libs_path)\schema">
130-
<Component Id="Schemas" Guid="caf25ecf-70d0-46e4-9b82-21df3c2da235">
131-
<File Name="xml.xsd" />
132-
<File Name="conf.xsd" />
133-
<File Name="OpenDocument_manifest.xsd" />
134-
<File Name="OpenDocument_manifest_v1_2.xsd" />
135-
<File Name="xmldsig-core-schema.xsd" />
136-
<File Name="XAdES01903v132-201601.xsd" />
137-
<File Name="XAdES01903v132-201601-relaxed.xsd" />
138-
<File Name="XAdES01903v141-201601.xsd" />
139-
<File Name="ts_119612v020201_201601xsd.xsd" />
140-
<File Name="en_31916201v010101.xsd" />
141-
<File Name="OpenDocument_dsig.xsd" />
142-
</Component>
126+
<Directory Name="schema">
127+
<Files Include="$(var.libs_path)\schema\*.xsd" />
143128
</Directory>
144129
<?ifdef var.qt_path ?>
145-
<Directory Id="platforms" Name="platforms">
146-
<Component Id="qwindows.dll">
147-
<File Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
148-
</Component>
130+
<Directory Name="platforms">
131+
<File Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
149132
</Directory>
150-
<Directory Id="tls" Name="tls">
151-
<Component Id="qopensslbackend.dll">
152-
<File Source="$(var.qt_path)\..\plugins\tls\qopensslbackend$(var.qt_suffix).dll" />
153-
</Component>
133+
<Directory Name="tls">
134+
<File Source="$(var.qt_path)\..\plugins\tls\qopensslbackend$(var.qt_suffix).dll" />
154135
</Directory>
155-
<Directory Id="styles" Name="styles">
156-
<Component Id="qwindowsvistastyle.dll">
157-
<File Source="$(var.qt_path)\..\plugins\styles\qwindowsvistastyle$(var.qt_suffix).dll" />
158-
</Component>
136+
<Directory Name="styles">
137+
<File Source="$(var.qt_path)\..\plugins\styles\qwindowsvistastyle$(var.qt_suffix).dll" />
159138
</Directory>
160-
<Directory Id="imageformats" Name="imageformats">
161-
<Component Id="imageformats.dll">
162-
<File Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
163-
</Component>
139+
<Directory Name="imageformats">
140+
<File Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
164141
</Directory>
165142
<?endif?>
166143
</Directory>
167144
</StandardDirectory>
168-
169-
<Feature Id="InstallDigidoc" Level="1" Title="DigiDoc4 Client" Display="expand" ConfigurableDirectory="APPLICATIONFOLDER">
170-
<ComponentRef Id="DesktopShortcut4" />
171-
<ComponentRef Id="Application4" />
172-
<ComponentRef Id="Base" />
173-
<ComponentRef Id="Schemas" />
174-
<?ifdef var.qt_path ?>
175-
<ComponentRef Id="qwindows.dll" />
176-
<ComponentRef Id="qwindowsvistastyle.dll" />
177-
<ComponentRef Id="qopensslbackend.dll" />
178-
<ComponentRef Id="imageformats.dll" />
179-
<?endif?>
180-
</Feature>
181145
</Package>
182146
</Wix>

0 commit comments

Comments
 (0)