summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-04-12 15:18:58 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-04-12 22:51:40 +0200
commit1f8a3657216e44796cb94087450552aa977ebdae (patch)
treee49575bc45ddf7c9f7a449b34174b1fe7c52895d
parent915533369ed5eec66b641fb961616cc76151ad8d (diff)
tdf#108580 related: improve existing redist detection
This uses VC Runtime upgrade code (checked using Upgrade table) to find installed redist, instead of checking registry keys that change between versions (while the runtime is still compatible, as with 2015 and 2017). Also, it checks if UCRT is present. Now, if either VC Runtime or UCRT is absent, we try to install the redist. This would allow to install UCRT in scenarios when first install was attempted on a system not suitable for UCRT (like Win7 w/o SP1, or Win8.1 w/o April 2014 update rollup), where VC Runtime gets installed, but UCRT is still missing. We use the ucrtbase.dll version to check that; and as the expected version is 10.x, we take into account that Win10 lies about versions. Change-Id: I864dfc09cf1bdc775501729fa2a27dc98295588c Reviewed-on: https://gerrit.libreoffice.org/52794 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt4
-rw-r--r--instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt2
-rw-r--r--instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt2
-rw-r--r--instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt2
-rw-r--r--instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt9
-rw-r--r--scp2/source/ooo/vc_redist.scp6
-rw-r--r--solenv/bin/modules/installer/windows/upgrade.pm12
7 files changed, 27 insertions, 10 deletions
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
index 60793dd69ded..23c2a77c9f5d 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
@@ -5,6 +5,6 @@ INSTALLLOCATION installuser
INSTALLLOCATION installuser_
INSTALLLOCATION installmachine
INSTALLLOCATION installmachine_
-VCREDISTINSTALLED_X86 VCREDISTINSTALLED_X86
-VCREDISTINSTALLED_X64 VCREDISTINSTALLED_X64
WIN81S14 win81s14
+UCRT_DETECTED ucrt_detected
+UCRT_DETECTED ucrt_on_win10
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt
index 589ab7c52806..399011e166ca 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]
+ucrt_detected [SystemFolder]
+ucrt_on_win10 [SystemFolder]
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
index f8eeaf25c105..2b633b8eb37a 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
@@ -44,7 +44,7 @@ ProgressType3 installs
Quickstarterlinkname QUICKSTARTERLINKNAMETEMPLATE
RebootYesNo Yes
ReinstallModeText omus
-SecureCustomProperties NEWPRODUCTS;OLDPRODUCTS
+SecureCustomProperties NEWPRODUCTS;OLDPRODUCTS;VCRUNTIME_DETECTED
SetupType Typical
SELECT_WORD 0
SELECT_EXCEL 0
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
index 7e59ef3c6663..c082322086ad 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
@@ -5,5 +5,3 @@ installuser 1 Software\LibreOffice\Layers\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION]
installuser_ 1 Software\LibreOffice\Layers_\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION] INSTALLLOCATION 2
installmachine 2 Software\LibreOffice\Layers\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION] INSTALLLOCATION 2
installmachine_ 2 Software\LibreOffice\Layers_\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION] INSTALLLOCATION 2
-VCREDISTINSTALLED_X86 2 Software\Microsoft\VisualStudio\14.0\VC\Runtimes\x86 Version 2
-VCREDISTINSTALLED_X64 2 Software\Microsoft\VisualStudio\14.0\VC\Runtimes\x64 Version 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..53615298dc6d 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/Signatur.idt
@@ -5,3 +5,12 @@ 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
+ucrt_detected ucrtbase.dll 10.0.10240.0
+# The great feature of all recent Windows is that they make it incredibly hard to find their
+# actual versions. Win 10 makes the next step in that direction: not only it tells you that
+# its version is 6.3 (VersionNT is 603), but also it disallows you to get real version of a
+# file during installation, if the version is greater than 6.3. So, for ucrt DLLs versioned
+# by MS as 10.0.x.y, it returns 6.3.x.y, pretending to have a lower version than on Win8.1.
+# Here we check for this, knowing that we get a version below 7.0 for UCRT that never had a
+# version below 10.0, then it's Win10+ that is lying to us.
+ucrt_on_win10 ucrtbase.dll 7.0.0.0
diff --git a/scp2/source/ooo/vc_redist.scp b/scp2/source/ooo/vc_redist.scp
index 9b414b8e39fa..921a9433e820 100644
--- a/scp2/source/ooo/vc_redist.scp
+++ b/scp2/source/ooo/vc_redist.scp
@@ -93,11 +93,7 @@ WindowsCustomAction gid_Customaction_InstallVCRedist
Source = VCREDIST_EXE_NAME;
Target = "/repair /norestart /passive";
Inbinarytable = 1;
-#if defined WINDOWS_X64
- Assignment1 = ("InstallUISequence", "Not Installed And ( Not VCREDISTINSTALLED_X64 Or VCREDISTINSTALLED_X64 < \"v14.0.24215.0\" )", "behind_ExecuteAction");
-#else
- Assignment1 = ("InstallUISequence", "Not Installed And ( Not VCREDISTINSTALLED_X86 Or VCREDISTINSTALLED_X86 < \"v14.0.24215.0\" )", "behind_ExecuteAction");
-#endif
+ Assignment1 = ("InstallUISequence", "Not Installed And Not ( VCRUNTIME_DETECTED And UCRT_DETECTED ) And VC_REDIST = 1", "behind_ExecuteAction");
End
#endif
diff --git a/solenv/bin/modules/installer/windows/upgrade.pm b/solenv/bin/modules/installer/windows/upgrade.pm
index 54838212404c..9e0d7ea79fb7 100644
--- a/solenv/bin/modules/installer/windows/upgrade.pm
+++ b/solenv/bin/modules/installer/windows/upgrade.pm
@@ -45,6 +45,18 @@ sub create_upgrade_table
$newline = $installer::globals::upgradecode . "\t" . $installer::globals::msiproductversion . "\t" . "\t" . "\t" . "2" . "\t" . "\t" . "NEWPRODUCTS" . "\n";
push(@upgradetable, $newline);
+ # Detecting if VC Runtime is installed on system
+ $newline = "VCRUNTIME_UPGRADE_CODE" . "\t" . "14.0.24215" . "\t" . "15.0.0" . "\t" . "" . "\t" . "258" . "\t" . "" . "\t" . "VCRUNTIME_DETECTED";
+ if ( $installer::globals::cpuname eq 'X86_64' )
+ {
+ $newline =~ s/VCRUNTIME_UPGRADE_CODE/{36F68A90-239C-34DF-B58C-64B30153CE35}/;
+ }
+ else
+ {
+ $newline =~ s/VCRUNTIME_UPGRADE_CODE/{65E5BD06-6392-3027-8C26-853107D3CF1A}/;
+ }
+ push(@upgradetable, $newline);
+
# Saving the file
my $upgradetablename = $basedir . $installer::globals::separator . "Upgrade.idt";