diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-08-18 09:48:13 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-08-18 09:48:13 +0000 |
commit | 3360efbd43af2ac9f153311cbd455d6175a62e22 (patch) | |
tree | f8d5f510f7d9f9c77ab6e6d7b495cae51279a054 /solenv/bin | |
parent | cab57d71c09acbeca6a417b19b98b336af5eb94a (diff) |
INTEGRATION: CWS native180 (1.13.168); FILE MERGED
2008/08/05 14:00:01 is 1.13.168.1: #i91954# prepare products for msp usage
Diffstat (limited to 'solenv/bin')
-rw-r--r-- | solenv/bin/modules/installer/windows/component.pm | 56 |
1 files changed, 47 insertions, 9 deletions
diff --git a/solenv/bin/modules/installer/windows/component.pm b/solenv/bin/modules/installer/windows/component.pm index 39a715976cea..1cddc98cf6af 100644 --- a/solenv/bin/modules/installer/windows/component.pm +++ b/solenv/bin/modules/installer/windows/component.pm @@ -8,7 +8,7 @@ # # $RCSfile: component.pm,v $ # -# $Revision: 1.13 $ +# $Revision: 1.14 $ # # This file is part of OpenOffice.org. # @@ -49,11 +49,16 @@ use installer::windows::language; sub get_component_guid { - my ( $componentname ) = @_; + my ( $componentname, $componentidhashref ) = @_; # At this time only a template my $returnvalue = "\{COMPONENTGUID\}"; + if (( $installer::globals::updatedatabase ) && ( exists($componentidhashref->{$componentname}) )) + { + $returnvalue = $componentidhashref->{$componentname}; + } + # Returning a ComponentID, that is assigned in scp project if ( exists($installer::globals::componentid{$componentname}) ) { @@ -88,7 +93,25 @@ sub get_file_component_directory if (!($found)) { - installer::exiter::exit_program("ERROR: Did not find component in file collection", "get_file_component_directory"); + # This component can be ignored, if it exists in a version with extension "_pff" (this was renamed in file::get_sequence_for_file() ) + my $ignore_this_component = 0; + my $origcomponentname = $componentname; + my $componentname = $componentname . "_pff"; + + for ( my $j = 0; $j <= $#{$filesref}; $j++ ) + { + $onefile = ${$filesref}[$j]; + $component = $onefile->{'componentname'}; + + if ( $component eq $componentname ) + { + $ignore_this_component = 1; + last; + } + } + + if ( $ignore_this_component ) { return "IGNORE_COMP"; } + else { installer::exiter::exit_program("ERROR: Did not find component \"$origcomponentname\" in file collection", "get_file_component_directory"); } } my $localstyles = ""; @@ -310,10 +333,11 @@ sub get_component_condition sub get_component_keypath { - my ($componentname, $itemsref) = @_; + my ($componentname, $itemsref, $componentidkeypathhashref) = @_; my $oneitem; my $found = 0; + my $infoline = ""; for ( my $i = 0; $i <= $#{$itemsref}; $i++ ) { @@ -334,6 +358,19 @@ sub get_component_keypath my $keypath = $oneitem->{'uniquename'}; # "uniquename", not "Name" + # Special handling for updates from existing databases, because KeyPath must not change + if (( $installer::globals::updatedatabase ) && ( exists($componentidkeypathhashref->{$componentname}) )) + { + $keypath = $componentidkeypathhashref->{$componentname}; + # -> check, if this is a valid key path?! + if ( $keypath ne $oneitem->{'uniquename'} ) + { + # Warning: This keypath was changed because of info from old database + $infoline = "WARNING: The KeyPath for component \"$componentname\" was changed from \"$oneitem->{'uniquename'}\" to \"$keypath\" because of information from update database"; + push(@installer::globals::logfileinfo, $infoline); + } + } + # Special handling for components in PREDEFINED_OSSHELLNEWDIR. These components # need as KeyPath a RegistryItem in HKCU if ( $oneitem->{'userregkeypath'} ) { $keypath = $oneitem->{'userregkeypath'}; } @@ -352,7 +389,7 @@ sub get_component_keypath sub create_component_table { - my ($filesref, $registryref, $dirref, $allfilecomponentsref, $allregistrycomponents, $basedir) = @_; + my ($filesref, $registryref, $dirref, $allfilecomponentsref, $allregistrycomponents, $basedir, $componentidhashref, $componentidkeypathhashref) = @_; my @componenttable = (); @@ -370,11 +407,12 @@ sub create_component_table my %onecomponent = (); $onecomponent{'name'} = ${$allfilecomponentsref}[$i]; - $onecomponent{'guid'} = get_component_guid($onecomponent{'name'}); + $onecomponent{'guid'} = get_component_guid($onecomponent{'name'}, $componentidhashref); $onecomponent{'directory'} = get_file_component_directory($onecomponent{'name'}, $filesref, $dirref); + if ( $onecomponent{'directory'} eq "IGNORE_COMP" ) { next; } $onecomponent{'attributes'} = get_file_component_attributes($onecomponent{'name'}, $filesref); $onecomponent{'condition'} = get_file_component_condition($onecomponent{'name'}, $filesref); - $onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $filesref); + $onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $filesref, $componentidkeypathhashref); $oneline = $onecomponent{'name'} . "\t" . $onecomponent{'guid'} . "\t" . $onecomponent{'directory'} . "\t" . $onecomponent{'attributes'} . "\t" . $onecomponent{'condition'} . "\t" . $onecomponent{'keypath'} . "\n"; @@ -389,11 +427,11 @@ sub create_component_table my %onecomponent = (); $onecomponent{'name'} = ${$allregistrycomponents}[$i]; - $onecomponent{'guid'} = get_component_guid($onecomponent{'name'}); + $onecomponent{'guid'} = get_component_guid($onecomponent{'name'}, $componentidhashref); $onecomponent{'directory'} = get_registry_component_directory(); $onecomponent{'attributes'} = get_registry_component_attributes($onecomponent{'name'}); $onecomponent{'condition'} = get_component_condition($onecomponent{'name'}); - $onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $registryref); + $onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $registryref, $componentidkeypathhashref); $oneline = $onecomponent{'name'} . "\t" . $onecomponent{'guid'} . "\t" . $onecomponent{'directory'} . "\t" . $onecomponent{'attributes'} . "\t" . $onecomponent{'condition'} . "\t" . $onecomponent{'keypath'} . "\n"; |