summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt1
-rw-r--r--scp2/source/ooo/vc_redist.scp4
-rwxr-xr-xsolenv/bin/modules/installer/windows/mergemodule.pm56
3 files changed, 60 insertions, 1 deletions
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
index edc952694014..846368de01a9 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
@@ -60,3 +60,4 @@ STR_MS_POWERPOINT_TEMPLATE OOO_STR_MS_POWERPOINT_TEMPLATE
STR_MS_POWERPOINT_SHOW OOO_STR_MS_POWERPOINT_SHOW
STR_INSTALLATION_WIZARD OOO_STR_INSTALLATION_WIZARD
UpgradeCode UPGRADECODETEMPLATE
+VC_REDIST 1
diff --git a/scp2/source/ooo/vc_redist.scp b/scp2/source/ooo/vc_redist.scp
index a01f891b72b7..5ec433cf2b3d 100644
--- a/scp2/source/ooo/vc_redist.scp
+++ b/scp2/source/ooo/vc_redist.scp
@@ -33,12 +33,14 @@ MergeModule gid_MergeModule_Microsoft_VC90_CRT_x86
Feature = gm_Root;
Name = "Microsoft_VC90_CRT_x86.msm";
RootDir = "TARGETDIR";
+ ComponentCondition = "VC_REDIST=1";
End
MergeModule gid_MergeModule_policy_9_0_Microsoft_VC90_CRT_x86
Feature = gm_Root;
Name = "policy_9_0_Microsoft_VC90_CRT_x86.msm";
RootDir = "TARGETDIR";
+ ComponentCondition = "VC_REDIST=1";
End
#if defined(BUILD_X64)
@@ -47,12 +49,14 @@ MergeModule gid_MergeModule_Microsoft_VC90_CRT_x86_x64
Feature = gm_Root;
Name = "Microsoft_VC90_CRT_x86_x64.msm";
RootDir = "TARGETDIR";
+ ComponentCondition = "(VC_REDIST=1) AND VersionNT64";
End
MergeModule gid_MergeModule_policy_9_0_Microsoft_VC90_CRT_x86_x64
Feature = gm_Root;
Name = "policy_9_0_Microsoft_VC90_CRT_x86_x64.msm";
RootDir = "TARGETDIR";
+ ComponentCondition = "(VC_REDIST=1) AND VersionNT64";
End
#endif
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.