configure.ac                                                       |    2 +-
 instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt |    3 ++-
 instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt |    2 ++
 instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt |    1 -
 instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt |    2 ++
 scp2/source/ooo/vc_redist.scp                                      |    6 
++----
 6 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 3441e409ae64c0e149bf130f41837dc03cba1046
Author:     Andras Timar <[email protected]>
AuthorDate: Tue Mar 3 11:16:28 2026 +0100
Commit:     Mike Kaganski <[email protected]>
CommitDate: Tue Mar 3 12:01:49 2026 +0100

    MSI: check VC++ runtime file version before installing merge modules
    
    Replace the registry-based VC runtime detection with a proper file
    version check using the MSI Signature + DrLocator tables. This looks
    for msvcp140.dll with MinVersion 14.29.30133.0 (VS2019 Update 11+)
    in both System64Folder (x64) and SystemFolder/SysWOW64 (x86), so
    each merge module is only installed when a sufficiently recent
    runtime is not already present on the system.
    
    The x86 merge module is needed because the x64 MSI ships 32-bit
    shell extension DLLs (shlxthdl.dll, ooofilt.dll, propertyhdl.dll).
    
    Change-Id: I844d0d4afac5bf46b40a5de6649e80128dce9a86
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200829
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/configure.ac b/configure.ac
index 14dc8117963e..87f50c489e02 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7139,7 +7139,7 @@ find_msms()
     local version="$1"
 
     AC_MSG_CHECKING([for MSVC $version merge modules directory])
-    local my_msm_file="Microsoft_VC${version}_CRT_x86.msm"
+    local my_msm_file="Microsoft_VC${version}_CRT_x64.msm"
     local my_msm_dir
 
     echo "$as_me:$LINENO: searching for $my_msm_file" >&5
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt 
b/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
index 63f28527bf24..d7024e8e9dfc 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
@@ -3,4 +3,5 @@ s72     s72
 AppSearch      Property        Signature_
 WIN81S14       win81s14
 WINMAJORVER    WinMajorVer
-VCRUNTIMEINSTALLED     VCRuntimex64
+VCRUNTIMEINSTALLED     vcrt140x64
+VCRTX86INSTALLED       vcrt140x86
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt 
b/instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt
index 589ab7c52806..bb4190dada32 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt
@@ -2,3 +2,5 @@ Signature_      Parent  Path    Depth
 s72    S72     S255    I2
 DrLocator      Signature_      Parent  Path
 win81s14               [SystemFolder]  
+vcrt140x64             [System64Folder]        
+vcrt140x86             [SystemFolder]  
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt 
b/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
index 0fff53ba1e81..59aed91a014d 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
@@ -2,4 +2,3 @@ Signature_      Root    Key     Name    Type
 s72    i2      s255    S255    I2
 RegLocator     Signature_
 WinMajorVer    2       Software\Microsoft\Windows NT\CurrentVersion    
CurrentMajorVersionNumber       2
-VCRuntimex64   2       SOFTWARE\Microsoft\VisualStudio.0\VC\Runtimes\x64      
Installed       2
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt 
b/instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt
index d5abd9769125..4697455a97d8 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt
@@ -5,3 +5,5 @@ Signature       Signature
 # language, and we need language-independent comparison, we use a value that 
is at
 # least 1 less (see note at https://msdn.microsoft.com/en-us/library/aa371853).
 win81s14       kernel32.dll    6.3.9600.17030                                  
        
+vcrt140x64     msvcp140.dll    14.29.30133.0                                   
        
+vcrt140x86     msvcp140.dll    14.29.30133.0                                   
        
diff --git a/scp2/source/ooo/vc_redist.scp b/scp2/source/ooo/vc_redist.scp
index 31d055a5bfcf..f436570fbf71 100644
--- a/scp2/source/ooo/vc_redist.scp
+++ b/scp2/source/ooo/vc_redist.scp
@@ -35,8 +35,6 @@
     #define WINDOWS_X86_MERGEMODULE gid_MergeModule_Microsoft_VC141_CRT_x86
     #define WINDOWS_X86_MERGEMODULE_FILE "Microsoft_VC141_CRT_x86.msm"
 #else
-    // The next string will result in "malformed par file" error, terminating 
build as expected.
-    // Possibly a new version of CRT was enabled in configure.ac, but not 
handled here yet?
     error: unknown VC redist version WITH_VC_REDIST. Check configure.ac
 #endif
 #endif
@@ -48,13 +46,13 @@ MergeModule WINDOWS_X86_MERGEMODULE
     Feature = gm_Root;
     Name = WINDOWS_X86_MERGEMODULE_FILE;
     RootDir = "TARGETDIR";
-    ComponentCondition = "VC_REDIST=1";
+    ComponentCondition = "VC_REDIST=1 AND NOT VCRTX86INSTALLED";
     Attributes_Add = "0x10";
 End
 
 #endif
 
-#if defined(WINDOWS_X64) && defined(WINDOWS_X64_MERGEMODULE)
+#if defined(WINDOWS_X64_MERGEMODULE)
 
 /* Attributes: msidbComponentAttributesPermanent = 0x10 */
 MergeModule WINDOWS_X64_MERGEMODULE

Reply via email to