Skip to content

Commit

Permalink
MDEV-26579 - support minor upgrades of the server MSI
Browse files Browse the repository at this point in the history
Connector library version resource should contain the server's numeric
version as FileVersion, when connector will be included into server
installation. Otherwise, file version will match the connectors CPACK
variables.

Prior to this patch, all libraries produced by connector, had a hardcoded
file version 3.0.0.7, which was neither the server's , nor the client's.

Also fix the Translation info in the version resource so it has valid LCID
  • Loading branch information
vaintroub committed Jan 26, 2024
1 parent f1a7276 commit 12cc91a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions cmake/version_info.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ MACRO(SET_VERSION_INFO)
STRING(REPLACE "FILE_DESCRIPTION:" "" FILE_DESCRIPTION ${PROPERTY})
ENDIF()
ENDFOREACH()
# Connector can be packaged with server, so set the "file version"
# to the server version
# In this case, numeric file version should be consistent with server
# Only this way MSI minor upgrade can work.
# The product version string will still refer to Connectors own version
IF((NOT DEFINED MAJOR_VERSION) OR (NOT DEFINED MINOR_VERSION) OR (NOT DEFINED PATCH_VERSION) OR (NOT DEFINED TINY_VERSION))
SET(MAJOR_VERSION ${CPACK_PACKAGE_VERSION_MAJOR})
SET(MINOR_VERSION ${CPACK_PACKAGE_VERSION_MINOR})
SET(PATCH_VERSION ${CPACK_PACKAGE_VERSION_PATCH})
SET(TINY_VERSION ${FILE_VERSION})
ENDIF()
CONFIGURE_FILE(${CC_SOURCE_DIR}/win/resource.rc.in
${CC_BINARY_DIR}/win/${TARGET}.rc)
SET(${TARGET}_RC ${CC_BINARY_DIR}/win/${TARGET}.rc)
Expand Down
8 changes: 4 additions & 4 deletions win/resource.rc.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "winver.h"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,0,0,7
PRODUCTVERSION 3,0,0,0
FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -15,7 +15,7 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000904b0"
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "MariaDB Corporation AB"
VALUE "FileDescription", "@FILE_DESCRIPTION@"
Expand All @@ -28,7 +28,7 @@ BEGIN
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x9, 1200
VALUE "Translation", 0x409, 1200
END
END

0 comments on commit 12cc91a

Please sign in to comment.