diff options
author | Andras Timar <atimar@suse.com> | 2012-05-14 22:08:38 +0200 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-05-14 23:08:45 +0200 |
commit | 80a921e88a036d42b4b884bb3e0b651fc083c1cd (patch) | |
tree | ef5e94acc2d70acb2bd5c8e61199e38b5a7d7e4c /solenv | |
parent | 2c4fbc8785aff024e22f657c735d5cdafe5b9a70 (diff) |
fdo#46519 workaround of MSI installer error 1935
In some circumstances installation of embedded VC++ runtime
fails with error code 1935. This usually occurs, when there are
many different versions of VC++ runtimes installed on the computer,
including beta versions. We can workaround this Microsoft bug, if we
don't install our VC++ runtime. A new property was introduced. It is
called VC_REDIST, and installation of VC++ runtime depends on its
value. (BTW the solution is general, ComponentCondition can be used
for any merge module, now we have only the VC++ runtime merge module.)
When the user experiences error code 1935, he should try to install
LibreOffice with the following command line:
msiexec /i <msi file name> VC_REDIST=0
The patch fixes another minor issue. 64-bit VC++ runtime will
not be installed on 32-bit systems any more.
Change-Id: I I6c5e066c6e60b011235e6019a8a35c9e953209bc
Diffstat (limited to 'solenv')
-rwxr-xr-x | solenv/bin/modules/installer/windows/mergemodule.pm | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/solenv/bin/modules/installer/windows/mergemodule.pm b/solenv/bin/modules/installer/windows/mergemodule.pm index b9591c417994..7faa4b5368ce 100755 --- a/solenv/bin/modules/installer/windows/mergemodule.pm +++ b/solenv/bin/modules/installer/windows/mergemodule.pm @@ -302,6 +302,7 @@ sub merge_mergemodules_into_msi_database $onemergemodulehash{'cabinetfile'} = $workdir . $installer::globals::separator . $cabinetfile; $onemergemodulehash{'filenumber'} = $filecounter; $onemergemodulehash{'componentnames'} = \%componentnames; + $onemergemodulehash{'componentcondition'} = $mergemodule->{'ComponentCondition'}; $onemergemodulehash{'cabfilename'} = $cabfilename; $onemergemodulehash{'feature'} = $mergemodule->{'Feature'}; $onemergemodulehash{'rootdir'} = $mergemodule->{'RootDir'}; @@ -404,6 +405,7 @@ sub merge_mergemodules_into_msi_database if ( -f "FeatureC.idt" ) { installer::systemactions::rename_one_file("FeatureC.idt", "old.FeatureC.idt.$counter"); } if ( -f "MsiAssembly.idt" ) { installer::systemactions::rename_one_file("MsiAssembly.idt", "old.MsiAssembly.idt.$counter"); } if ( -f "MsiAssem.idt" ) { installer::systemactions::rename_one_file("MsiAssem.idt", "old.MsiAssem.idt.$counter"); } + if ( -f "Componen.idt" ) { installer::systemactions::rename_one_file("Componen.idt", "old.Componen.idt.$counter"); } # Extracting tables @@ -412,6 +414,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"; } # Table "Feature" has to be exported, but it is not necessary to import it. if ( $^O =~ /cygwin/i ) { @@ -451,8 +454,9 @@ sub merge_mergemodules_into_msi_database if ( -f "Directory.idt" ) { installer::systemactions::rename_one_file("Directory.idt", "Director.idt"); } if ( -f "FeatureComponents.idt" ) { installer::systemactions::rename_one_file("FeatureComponents.idt", "FeatureC.idt"); } if ( -f "MsiAssembly.idt" ) { installer::systemactions::rename_one_file("MsiAssembly.idt", "MsiAssem.idt"); } + if ( -f "Component.idt" ) { installer::systemactions::rename_one_file("Component.idt", "Componen.idt"); } - # Changing content of tables: File, Media, Directory, FeatureComponent, MsiAssembly + # Changing content of tables: File, Media, Directory, FeatureComponent, MsiAssembly, Component installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing Media table"); change_media_table($mergemodulehash, $workdir, $mergemodulegid, $allupdatelastsequences, $allupdatediskids); installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing File table"); @@ -467,6 +471,12 @@ sub merge_mergemodules_into_msi_database change_msiassembly_table($mergemodulehash, $workdir); } + if ( $mergemodulehash->{'componentcondition'} ) + { + installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing Component table"); + change_component_table($mergemodulehash, $workdir); + } + # msidb.exe does not merge InstallExecuteSequence, AdminExecuteSequence and AdvtExecuteSequence. Instead it creates # new tables ModuleInstallExecuteSequence, ModuleAdminExecuteSequence and ModuleAdvtExecuteSequence that need to be # merged into the three ExecuteSequences with the following process (also into InstallUISequence.idt). @@ -1365,6 +1375,50 @@ sub change_featurecomponent_table installer::files::save_file($idtfilename, $filecontent); } +############################################################################### +# In the components table, the conditions of merge modules should be updated +############################################################################### + +sub change_component_table +{ + my ($mergemodulehash, $workdir) = @_; + + my $infoline = "Changing content of table \"Component\"\n"; + push( @installer::globals::logfileinfo, $infoline); + + my $idtfilename = "Componen.idt"; + if ( ! -f $idtfilename ) { installer::exiter::exit_program("ERROR: Could not find file \"$idtfilename\" in \"$workdir\" !", "change_component_table"); } + + my $filecontent = installer::files::read_file($idtfilename); + + for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) + { + my $component; + foreach $component ( keys %{$mergemodulehash->{'componentnames'}} ) + { + if ( ${$filecontent}[$i] =~ /^\s*$component/) + { + if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.*?)\t(.+?)\t(.+?)\t(.*?)\t(.*?)\s*$/ ) + { + $infoline = "Adding condition ($5) from scp to component $1\n"; + push( @installer::globals::logfileinfo, $infoline); + if ($5) + { + ${$filecontent}[$i] = "$1\t$2\t$3\t$4\t($5) AND ($mergemodulehash->{'componentcondition'})\t$6\n"; + } + else + { + ${$filecontent}[$i] = "$1\t$2\t$3\t$4\t$mergemodulehash->{'componentcondition'}\t$6\n"; + } + } + } + } + } + + # saving file + installer::files::save_file($idtfilename, $filecontent); +} + ######################################################################### # In the directory table, the directory parent has to be changed, # if it is not TARGETDIR. |