Kaydet (Commit) 1f8a3657 authored tarafından Mike Kaganski's avatar Mike Kaganski

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/52794Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 91553336
......@@ -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
......@@ -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]
......@@ -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
......
......@@ -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
......@@ -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
......@@ -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
......@@ -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";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment