From 4f6363922f6da07edfb3998b56f6a55e5ff409cf Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 12 Apr 2018 15:18:58 +0300 Subject: 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. Reviewed-on: https://gerrit.libreoffice.org/52794 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit 1f8a3657216e44796cb94087450552aa977ebdae) Conflicts: instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt Change-Id: I864dfc09cf1bdc775501729fa2a27dc98295588c --- solenv/bin/modules/installer/windows/upgrade.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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"; -- cgit