diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-08-10 13:58:57 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-08-10 15:06:14 +0200 |
commit | 0872e8cc87d753e6bdda9fad510a6b71cf96565f (patch) | |
tree | 8abe498a88ae72a2645cfe43908e23040686a68a /solenv/bin/modules/installer | |
parent | f6e9feb5bf7d227b33fe9cd4e61720d6205e5143 (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>
Diffstat (limited to 'solenv/bin/modules/installer')
-rw-r--r-- | solenv/bin/modules/installer/windows/mergemodule.pm | 43 |
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"; } } } |