summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-08-10 13:58:57 +0300
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-08-26 11:05:59 +0200
commit989f050f02ee31a771b66e8eaf764e53ad3d8bdc (patch)
tree76985903036c1f43dc9ae1b44509acf1ec0fe35c /solenv
parentd172e9eeff21851670fd5da7c585a9ca46e02253 (diff)
tdf#135579: Don't uninstall vc_redist: make it permanent
Redist is a system component, that includes a varying set of DLLs, and those DLLs are ref-counted. Installing a newer redist - i.e. updating and increasing refcount of existing DLLs - may add new DLLs (with initial refcount 1) in addition to the updated old DLLs that start depending on the newly added ones; at uninstall, the newly added DLLs may get removed because their refcount gets 0, while other redist DLLs are kept at the updated levels - so their dependencies now are not met, and redist gets broken. Just mark the redist components permanent, which, according to [1], "registers an extra system client for the component in the Windows Installer registry settings". A downside is that uninstall doesn't restore the original system state ideally. [1] https://docs.microsoft.com/en-us/windows/win32/msi/component-table Change-Id: I3fe82bcb5844f826f5b1df622273b4e3a1e3c436 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100426 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 0872e8cc87d753e6bdda9fad510a6b71cf96565f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100357 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/bin/modules/installer/windows/mergemodule.pm43
1 files changed, 30 insertions, 13 deletions
diff --git a/solenv/bin/modules/installer/windows/mergemodule.pm b/solenv/bin/modules/installer/windows/mergemodule.pm
index 68bb203f1053..defd59588c95 100644
--- a/solenv/bin/modules/installer/windows/mergemodule.pm
+++ b/solenv/bin/modules/installer/windows/mergemodule.pm
@@ -294,6 +294,7 @@ sub merge_mergemodules_into_msi_database
$onemergemodulehash{'filenumber'} = $filecounter;
$onemergemodulehash{'componentnames'} = \%componentnames;
$onemergemodulehash{'componentcondition'} = $mergemodule->{'ComponentCondition'};
+ $onemergemodulehash{'attributes_add'} = $mergemodule->{'Attributes_Add'};
$onemergemodulehash{'cabfilename'} = $cabfilename;
$onemergemodulehash{'feature'} = $mergemodule->{'Feature'};
$onemergemodulehash{'rootdir'} = $mergemodule->{'RootDir'};
@@ -405,7 +406,7 @@ sub merge_mergemodules_into_msi_database
my $workingtables = "File Media Directory FeatureComponents"; # required tables
# Optional tables can be added now
if ( $mergemodulehash->{'hasmsiassemblies'} ) { $workingtables = $workingtables . " MsiAssembly"; }
- if ( $mergemodulehash->{'componentcondition'} ) { $workingtables = $workingtables . " Component"; }
+ if ( ( $mergemodulehash->{'componentcondition'} ) || ( $mergemodulehash->{'attributes_add'} ) ) { $workingtables = $workingtables . " Component"; }
# Table "Feature" has to be exported, but it is not necessary to import it.
if ( $^O =~ /cygwin/i ) {
@@ -462,7 +463,7 @@ sub merge_mergemodules_into_msi_database
change_msiassembly_table($mergemodulehash, $workdir);
}
- if ( $mergemodulehash->{'componentcondition'} )
+ if ( ( $mergemodulehash->{'componentcondition'} ) || ( $mergemodulehash->{'attributes_add'} ) )
{
installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing Component table");
change_component_table($mergemodulehash, $workdir);
@@ -1368,7 +1369,7 @@ sub change_featurecomponent_table
}
###############################################################################
-# In the components table, the conditions of merge modules should be updated
+# In the components table, the conditions or attributes of merge modules should be updated
###############################################################################
sub change_component_table
@@ -1388,25 +1389,41 @@ sub change_component_table
my $component;
foreach $component ( keys %{$mergemodulehash->{'componentnames'}} )
{
- if ( ${$filecontent}[$i] =~ /^\s*$component/)
+ if ( my ( $comp_, $compid_, $dir_, $attr_, $cond_, $keyp_ ) = ${$filecontent}[$i] =~ /^\s*($component)\t(.*?)\t(.+?)\t(.+?)\t(.*?)\t(.*?)\s*$/)
{
- if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.*?)\t(.+?)\t(.+?)\t(.*?)\t(.*?)\s*$/ )
+ my $newattr_ = ( $attr_ =~ /^\s*0x/ ) ? hex($attr_) : $attr_;
+ if ( $mergemodulehash->{'attributes_add'} )
{
- $infoline = "Adding condition ($mergemodulehash->{'componentcondition'}) from scp2 to component $1\n";
+ $infoline = "Adding attribute(s) ($mergemodulehash->{'attributes_add'}) from scp2 to component $comp_\n";
push( @installer::globals::logfileinfo, $infoline);
- if ($5)
+ if ( $mergemodulehash->{'attributes_add'} =~ /^\s*0x/ )
{
- $infoline = "Old condition: $5\nNew condition: ($5) AND ($mergemodulehash->{'componentcondition'})\n";
- push( @installer::globals::logfileinfo, $infoline);
- ${$filecontent}[$i] = "$1\t$2\t$3\t$4\t($5) AND ($mergemodulehash->{'componentcondition'})\t$6\n";
+ $newattr_ = $newattr_ | hex($mergemodulehash->{'attributes_add'});
}
else
{
- $infoline = "Old condition: <none>\nNew condition: $mergemodulehash->{'componentcondition'}\n";
- push( @installer::globals::logfileinfo, $infoline);
- ${$filecontent}[$i] = "$1\t$2\t$3\t$4\t$mergemodulehash->{'componentcondition'}\t$6\n";
+ $newattr_ = $newattr_ | $mergemodulehash->{'attributes_add'};
}
+ $infoline = "Old attribute(s): $attr_\nNew attribute(s): $newattr_\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ my $newcond_ = $cond_;
+ if ( $mergemodulehash->{'componentcondition'} )
+ {
+ $infoline = "Adding condition ($mergemodulehash->{'componentcondition'}) from scp2 to component $comp_\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ if ($cond_)
+ {
+ $newcond_ = "($cond_) AND ($mergemodulehash->{'componentcondition'})";
+ }
+ else
+ {
+ $newcond_ = "$mergemodulehash->{'componentcondition'}";
+ }
+ $infoline = "Old condition: $cond_\nNew condition: $newcond_\n";
+ push( @installer::globals::logfileinfo, $infoline);
}
+ ${$filecontent}[$i] = "$comp_\t$compid_\t$dir_\t$newattr_\t$newcond_\t$keyp_\n";
}
}
}