Skip to content

Commit 31cabb2

Browse files
author
Bogdan Degtyariov
committed
Merge branch 'wl15846' into trunk
Change-Id: I355a8b3ded530346bbef6cda9a25760a888857b8
2 parents ce01bf2 + 9377945 commit 31cabb2

File tree

4 files changed

+130
-290
lines changed

4 files changed

+130
-290
lines changed

packaging/WiX/CMakeLists.txt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2010, 2020, Oracle and/or its affiliates.
1+
# Copyright (c) 2010, 2023, Oracle and/or its affiliates.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License, version 2.0,
@@ -111,8 +111,10 @@ get_filename_component(IS64BIT ${IS64BIT} NAME)
111111

112112
if(IS64BIT MATCHES "lib64")
113113
set(IS64BIT true)
114+
set(BITNESS "always64")
114115
else()
115116
set(IS64BIT false)
117+
set(BITNESS "always32")
116118
endif()
117119

118120
#
@@ -228,16 +230,12 @@ set(WIX_INCLUDES "" CACHE STRING "output var" FORCE)
228230

229231
include(wix_setup.cmake)
230232

231-
set(EXTRA_CANDLE_ARGS $ENV{EXTRA_CANDLE_ARGS})
232-
set(EXTRA_LIGHT_ARGS $ENV{EXTRA_LIGHT_ARGS})
233-
234-
file(REMOVE connector-cpp.wixobj)
233+
set(EXTRA_WIX_ARGS $ENV{EXTRA_WIX_ARGS})
235234

236235
add_custom_target(MSI
237-
COMMAND ${CANDLE_EXECUTABLE} -ext WixUtilExtension connector-cpp.wxs ${EXTRA_CANDLE_ARGS}
238-
COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension -ext WixUtilExtension
239-
connector-cpp.wixobj -out ${CMAKE_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.msi
240-
${EXTRA_LIGHT_ARGS}
236+
COMMAND ${WIX_EXECUTABLE} build -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -arch ${PLATFORM} connector-cpp.wxs
237+
-out ${CMAKE_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.msi
238+
${EXTRA_WIX_ARGS}
241239
)
242240

243241

@@ -334,7 +332,7 @@ function(set_wix_components)
334332
generate_guid(GUID)
335333

336334
out("<DirectoryRef Id='${d_id}'>")
337-
out(" <Component Id='${c_id}' Guid='${GUID}' Win64='${IS64BIT}'>")
335+
out(" <Component Id='${c_id}' Guid='${GUID}' Bitness='${BITNESS}'>")
338336

339337
foreach(F ${FILES${C}${d_suffix}})
340338
get_file_id(${d_suffix}_${F} id path)

packaging/WiX/connector-cpp.wxs.in

Lines changed: 56 additions & 183 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
2-
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
1+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
32

43
<!--
5-
Copyright (c) 2010, 2020, Oracle and/or its affiliates.
4+
Copyright (c) 2010, 2023, Oracle and/or its affiliates.
65

76
This program is free software; you can redistribute it and/or modify
87
it under the terms of the GNU General Public License, version 2.0,
@@ -25,261 +24,135 @@
2524
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2625
-->
2726

28-
<Product
29-
Id="*"
30-
UpgradeCode="@UPGRADE_CODE@"
31-
Name="@PRODUCT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@"
32-
Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
33-
Language="1033"
34-
Manufacturer="@MANUFACTURER@">
27+
<Package UpgradeCode="@UPGRADE_CODE@" Name="@PRODUCT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@" Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@" Language="1033" Manufacturer="@MANUFACTURER@" InstallerVersion="200"><SummaryInformation Keywords="Installer" Description="@PRODUCT_DESCRIPTION@" Manufacturer="@MANUFACTURER@" />
3528

36-
<Package Id='*'
37-
Keywords='Installer'
38-
Description="@PRODUCT_DESCRIPTION@"
39-
Manufacturer='@MANUFACTURER@'
40-
InstallerVersion='200'
41-
Languages='1033'
42-
Compressed='yes'
43-
SummaryCodepage='1252'
44-
Platform='x64'
45-
InstallScope="perMachine"/>
46-
47-
<Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
29+
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
4830

4931
<!-- Upgrade for 8.0.12 version -->
5032
<?if "@PLATFORM@"="x64"?>
5133
<Upgrade Id="@UPGRADE_CODE_OLD@">
5234
<?if '@PATCH_VERSION@' != '0'?>
53-
<UpgradeVersion
54-
Minimum="@MAJOR_VERSION@.@[email protected]"
55-
IncludeMinimum="yes"
56-
Maximum="@MAJOR_VERSION@.@[email protected]"
57-
IncludeMaximum="no"
58-
Property="OLDERVERSIONBEINGUPGRADED_OLD"
59-
MigrateFeatures="yes"
60-
/>
35+
<UpgradeVersion Minimum="@MAJOR_VERSION@.@[email protected]" IncludeMinimum="yes" Maximum="@MAJOR_VERSION@.@[email protected]" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED_OLD" MigrateFeatures="yes" />
6136
<?endif?>
6237
</Upgrade>
6338
<?endif?>
6439

6540
<!-- Upgrade for 8.0.13+ version -->
6641
<Upgrade Id="@UPGRADE_CODE@">
6742
<?if '@PATCH_VERSION@' != '0'?>
68-
<UpgradeVersion
69-
Minimum="@MAJOR_VERSION@.@[email protected]"
70-
IncludeMinimum="yes"
71-
Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
72-
IncludeMaximum="yes"
73-
Property="OLDERVERSIONBEINGUPGRADED"
74-
MigrateFeatures="yes"
75-
/>
43+
<UpgradeVersion Minimum="@MAJOR_VERSION@.@[email protected]" IncludeMinimum="yes" Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@" IncludeMaximum="yes" Property="OLDERVERSIONBEINGUPGRADED" MigrateFeatures="yes" />
7644
<?endif?>
77-
<UpgradeVersion
78-
Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
79-
IncludeMinimum="no"
80-
OnlyDetect="yes"
81-
Property="NEWERVERSIONDETECTED" />
45+
<UpgradeVersion Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@" IncludeMinimum="no" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />
8246
</Upgrade>
83-
<Condition Message="A later version of [ProductName] is already installed. Setup will now exit.">
84-
NOT NEWERVERSIONDETECTED OR Installed
85-
</Condition>
47+
<Launch Condition="NOT NEWERVERSIONDETECTED OR Installed" Message="A later version of [ProductName] is already installed. Setup will now exit." />
8648
<InstallExecuteSequence>
87-
<RemoveExistingProducts After="InstallInitialize"/>
49+
<RemoveExistingProducts After="InstallInitialize" />
8850
</InstallExecuteSequence>
8951

9052
<?if "@STATIC_MSVCRT@"="OFF" AND "@BUNDLE_RUNTIME_LIBRARIES@"="OFF" ?>
9153
<?if "@PLATFORM@"="x64"?>
9254
<Property Id="VS14REDISTX64">
93-
<RegistrySearch Id="FindRedistVS14"
94-
Root="HKLM"
95-
Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64"
96-
Name="Version"
97-
Type="raw" />
55+
<RegistrySearch Id="FindRedistVS14" Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" Name="Version" Type="raw" />
9856
</Property>
9957
<Property Id="VS14UPGRADE64">
100-
<RegistrySearch Id="FindVS14Upgrade64"
101-
Root="HKLM"
102-
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\09A86F63C932FD435BC8463B1035EC53"
103-
Type="raw" />
58+
<RegistrySearch Id="FindVS14Upgrade64" Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\09A86F63C932FD435BC8463B1035EC53" Type="raw" />
10459
</Property>
105-
<Condition Message="This application requires Visual Studio 2015 x64 Redistributable. Please install the Redistributable then run this installer again.">
106-
Installed OR VS14REDISTX64 OR VS14UPGRADE64
107-
</Condition>
60+
<Launch Condition="Installed OR VS14REDISTX64 OR VS14UPGRADE64" Message="This application requires Visual Studio 2015 x64 Redistributable. Please install the Redistributable then run this installer again." />
10861
<?else?>
10962
<Property Id="VS14REDISTX86">
110-
<RegistrySearch Id="FindRedistVS14"
111-
Win64="no"
112-
Root="HKLM"
113-
Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86"
114-
Name="Version"
115-
Type="raw" />
63+
<RegistrySearch Id="FindRedistVS14" Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" Name="Version" Type="raw" Bitness="always32" />
11664
</Property>
11765
<Property Id="VS14UPGRADE32">
118-
<RegistrySearch Id="FindVS14Upgrade32"
119-
Root="HKLM"
120-
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\15E8B87C56C0E773581D82F286F95E50"
121-
Type="raw" />
66+
<RegistrySearch Id="FindVS14Upgrade32" Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\15E8B87C56C0E773581D82F286F95E50" Type="raw" />
12267
</Property>
123-
<Condition Message="This application requires Visual Studio 2015 x86 Redistributable. Please install the Redistributable then run this installer again.">
124-
Installed OR VS14REDISTX86 OR VS14UPGRADE32
125-
</Condition>
68+
<Launch Condition="Installed OR VS14REDISTX86 OR VS14UPGRADE32" Message="This application requires Visual Studio 2015 x86 Redistributable. Please install the Redistributable then run this installer again." />
12669
<?endif?>
12770
<?endif?>
12871

12972
<!-- Save/restore install location -->
13073
<CustomAction Id="SaveTargetDir" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
13174
<InstallExecuteSequence>
132-
<Custom Action="SaveTargetDir" After="InstallValidate">
133-
NOT
134-
Installed
135-
</Custom>
75+
<Custom Action="SaveTargetDir" After="InstallValidate" Condition="NOT Installed" />
13676
</InstallExecuteSequence>
13777
<InstallUISequence>
13878
<!-- App search is what does FindInstallLocation, and it is dependent on FindRelatedProducts -->
139-
<AppSearch After="FindRelatedProducts"/>
79+
<AppSearch After="FindRelatedProducts" />
14080
</InstallUISequence>
14181

14282
<!-- Find previous installation -->
14383
<Property Id="GETINSTALLDIR">
144-
<RegistrySearch Id="FindInstallLocation"
145-
Root="HKLM"
146-
Win64="@IS64BIT@"
147-
Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"
148-
Name="InstallLocation"
149-
Type="raw" />
84+
<RegistrySearch Id="FindInstallLocation" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]" Name="InstallLocation" Type="raw" Bitness="@BITNESS@" />
15085
</Property>
151-
<CustomAction Id="SetInstall" Property="INSTALLDIR" Value="[GETINSTALLDIR]" />
86+
<CustomAction Id="SetInstall" Property="INSTALLDIR" Value="[GETINSTALLDIR]" />
15287
<InstallUISequence>
153-
<Custom Action="SetInstall" After="AppSearch">GETINSTALLDIR</Custom>
88+
<Custom Action="SetInstall" After="AppSearch" Condition="GETINSTALLDIR" />
15489
</InstallUISequence>
15590
<Property Id="GETINSTALLDIR_OLD">
156-
<RegistrySearch Id="FindInstallLocationOld"
157-
Root="HKLM"
158-
Win64="@IS64BIT@"
159-
Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED_OLD]"
160-
Name="InstallLocation"
161-
Type="raw" />
91+
<RegistrySearch Id="FindInstallLocationOld" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED_OLD]" Name="InstallLocation" Type="raw" Bitness="@BITNESS@" />
16292
</Property>
163-
<CustomAction Id="SetInstallOld" Property="INSTALLDIR" Value="[GETINSTALLDIR_OLD]" />
93+
<CustomAction Id="SetInstallOld" Property="INSTALLDIR" Value="[GETINSTALLDIR_OLD]" />
16494
<InstallUISequence>
165-
<Custom Action="SetInstallOld" After="AppSearch">GETINSTALLDIR_OLD</Custom>
95+
<Custom Action="SetInstallOld" After="AppSearch" Condition="GETINSTALLDIR_OLD" />
16696
</InstallUISequence>
16797
<Property Id="INSTALLDIR2">
168-
<RegistrySearch Id="FindInstallLocation2"
169-
Root="HKLM"
170-
Key="SOFTWARE\MySQL AB\[ProductName]"
171-
Name="Location"
172-
Type="raw" />
98+
<RegistrySearch Id="FindInstallLocation2" Root="HKLM" Key="SOFTWARE\MySQL AB\[ProductName]" Name="Location" Type="raw" />
17399
</Property>
174100
<CustomAction Id="SetInstallDir2" Property="INSTALLDIR" Value="[INSTALLDIR2]" />
175101
<InstallUISequence>
176-
<Custom Action="SetInstallDir2" After="AppSearch">INSTALLDIR2</Custom>
102+
<Custom Action="SetInstallDir2" After="AppSearch" Condition="INSTALLDIR2" />
177103
</InstallUISequence>
178104

179105
<!-- UI -->
180106
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>
181107
<UIRef Id="@WIX_UI@" />
182108
<UIRef Id="WixUI_ErrorProgressText" />
183-
<WixVariable
184-
Id="WixUIBannerBmp"
185-
Value="@SOURCE_DIR@/AdminHeader.jpg" />
186-
<WixVariable
187-
Id="WixUIDialogBmp"
188-
Value="@SOURCE_DIR@/AdminBackground.jpg" />
189-
<Icon
190-
Id="icon.ico"
191-
SourceFile="@SOURCE_DIR@/MySQLConnector.ico"/>
192-
<Property
193-
Id="ARPPRODUCTICON"
194-
Value="icon.ico" />
109+
<WixVariable Id="WixUIBannerBmp" Value="@SOURCE_DIR@/AdminHeader.jpg" />
110+
<WixVariable Id="WixUIDialogBmp" Value="@SOURCE_DIR@/AdminBackground.jpg" />
111+
<Icon Id="icon.ico" SourceFile="@SOURCE_DIR@/MySQLConnector.ico" />
112+
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
195113

196114
<!-- License -->
197-
<WixVariable
198-
Id="WixUILicenseRtf"
199-
Value="@LICENSE_RTF@"/>
115+
<WixVariable Id="WixUILicenseRtf" Value="@LICENSE_RTF@" />
200116

201117
<!-- Installation root-->
202-
<Directory Id='TARGETDIR' Name='SourceDir'>
203-
<Directory Id='@PROGRAM_FILES_FOLDER@'>
204-
<Directory Id='directory.MySQL' Name='MySQL'>
205-
<Directory Id='INSTALLDIR' Name='@PRODUCT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@'>
206-
</Directory>
207-
</Directory>
208-
</Directory>
209-
</Directory>
118+
210119

211120
<!-- WIX_FEATURES -->
212-
<Feature Id='XDEVAPI'
213-
Title='New X DevAPI connector'
214-
Description='New X DevAPI connector'
215-
ConfigurableDirectory='INSTALLDIR'
216-
Level='1' >
217-
<Feature Id='XDevAPIDll'
218-
Title='Dll Libraries'
219-
Description='Connector C++ dll libraries and depdnencies'
220-
ConfigurableDirectory='INSTALLDIR'
221-
Level='1'>
222-
<ComponentGroupRef Id='componentgroup.XDevAPIDll'/>
223-
<ComponentGroupRef Id='componentgroup.OpenSSLDll'/>
121+
<Feature Id="XDEVAPI" Title="New X DevAPI connector" Description="New X DevAPI connector" ConfigurableDirectory="INSTALLDIR" Level="1">
122+
<Feature Id="XDevAPIDll" Title="Dll Libraries" Description="Connector C++ dll libraries and depdnencies" ConfigurableDirectory="INSTALLDIR" Level="1">
123+
<ComponentGroupRef Id="componentgroup.XDevAPIDll" />
124+
<ComponentGroupRef Id="componentgroup.OpenSSLDll" />
224125
</Feature>
225-
<Feature Id='XDevAPIDev'
226-
Title='Development Components'
227-
Description='Connector C++ headers, static libraries and import libraries'
228-
ConfigurableDirectory='INSTALLDIR'
229-
Level='4'>
230-
<ComponentGroupRef Id='componentgroup.XDevAPIDev'/>
231-
<ComponentGroupRef Id='componentgroup.OpenSSLDev'/>
126+
<Feature Id="XDevAPIDev" Title="Development Components" Description="Connector C++ headers, static libraries and import libraries" ConfigurableDirectory="INSTALLDIR" Level="4">
127+
<ComponentGroupRef Id="componentgroup.XDevAPIDev" />
128+
<ComponentGroupRef Id="componentgroup.OpenSSLDev" />
232129
</Feature>
233130
</Feature>
234131

235-
<Feature Id='JDBC'
236-
Title='Legacy JDBC API'
237-
Description='Legacy JDBC API connector'
238-
ConfigurableDirectory='INSTALLDIR'
239-
Level='1' >
240-
<Feature Id='JDBCDll'
241-
Title='Dll Libraries'
242-
Description='Installs legacy JDBC API connector dlls'
243-
ConfigurableDirectory='INSTALLDIR'
244-
Level='1'>
245-
<ComponentGroupRef Id='componentgroup.JDBCDll'/>
246-
<ComponentGroupRef Id='componentgroup.OpenSSLDll'/>
132+
<Feature Id="JDBC" Title="Legacy JDBC API" Description="Legacy JDBC API connector" ConfigurableDirectory="INSTALLDIR" Level="1">
133+
<Feature Id="JDBCDll" Title="Dll Libraries" Description="Installs legacy JDBC API connector dlls" ConfigurableDirectory="INSTALLDIR" Level="1">
134+
<ComponentGroupRef Id="componentgroup.JDBCDll" />
135+
<ComponentGroupRef Id="componentgroup.OpenSSLDll" />
247136
</Feature>
248-
<Feature Id='JDBCDev'
249-
Title='Development Components'
250-
Description='Installs legacy JDBC API connector dev files'
251-
ConfigurableDirectory='INSTALLDIR'
252-
Level='4'>
253-
<ComponentGroupRef Id='componentgroup.JDBCDev'/>
254-
<ComponentGroupRef Id='componentgroup.OpenSSLDev'/>
137+
<Feature Id="JDBCDev" Title="Development Components" Description="Installs legacy JDBC API connector dev files" ConfigurableDirectory="INSTALLDIR" Level="4">
138+
<ComponentGroupRef Id="componentgroup.JDBCDev" />
139+
<ComponentGroupRef Id="componentgroup.OpenSSLDev" />
255140
</Feature>
256141
</Feature>
257142

258-
<Feature Id='ALWAYSINSTALL'
259-
Title='ALWAYSINSTALL'
260-
Description='ALWAYSINSTALL'
261-
ConfigurableDirectory='INSTALLDIR'
262-
Level='1' Display='hidden' >
263-
<Feature Id='Readme'
264-
Title='COMPONENT_README_DISPLAY_NAME'
265-
Description='COMPONENT_README_DESCRIPTION'
266-
ConfigurableDirectory='INSTALLDIR'
267-
Level='1'>
268-
<ComponentGroupRef Id='componentgroup.Readme'/>
143+
<Feature Id="ALWAYSINSTALL" Title="ALWAYSINSTALL" Description="ALWAYSINSTALL" ConfigurableDirectory="INSTALLDIR" Level="1" Display="hidden">
144+
<Feature Id="Readme" Title="COMPONENT_README_DISPLAY_NAME" Description="COMPONENT_README_DESCRIPTION" ConfigurableDirectory="INSTALLDIR" Level="1">
145+
<ComponentGroupRef Id="componentgroup.Readme" />
269146
</Feature>
270147
</Feature>
271148

272-
<!-- WIX_DIRECTORIES -->
273-
@WIX_DIRECTORIES@
274-
275-
<!--WIX_COMPONENTS-->
276-
@WIX_COMPONENTS@
277-
278-
<!--WIX_COMPONENTS_GROUPS -->
279-
@WIX_COMPONENT_GROUPS@
280-
281-
<!--WIX_INCLUDES -->
282-
@WIX_INCLUDES@
283-
</Product>
149+
<!-- WIX_DIRECTORIES -->@WIX_DIRECTORIES@<!--WIX_COMPONENTS-->@WIX_COMPONENTS@<!--WIX_COMPONENTS_GROUPS -->@WIX_COMPONENT_GROUPS@<!--WIX_INCLUDES -->@WIX_INCLUDES@
150+
<Directory Id="@PROGRAM_FILES_FOLDER@">
151+
<Directory Id="directory.MySQL" Name="MySQL">
152+
<Directory Id="INSTALLDIR" Name="@PRODUCT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@">
153+
</Directory>
154+
</Directory>
155+
</Directory>
156+
</Package>
284157

285158
</Wix>

0 commit comments

Comments
 (0)