registry.pm (cdf0e10c) registry.pm (19d58b3a)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#

--- 16 unchanged lines hidden (view full) ---

25#
26#*************************************************************************
27
28package installer::windows::registry;
29
30use installer::files;
31use installer::globals;
32use installer::worker;
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#

--- 16 unchanged lines hidden (view full) ---

25#
26#*************************************************************************
27
28package installer::windows::registry;
29
30use installer::files;
31use installer::globals;
32use installer::worker;
33use installer::windows::msiglobal;
33use installer::windows::idtglobal;
34
35#####################################################
36# Generating the component name from a registryitem
37#####################################################
38
39sub get_registry_component_name
40{

--- 70 unchanged lines hidden (view full) ---

111 }
112
113 if ( exists($installer::globals::allregistrycomponents_{$fullname}) )
114 {
115 $componentname = $installer::globals::allregistrycomponents_{$fullname};
116 }
117 else
118 {
34use installer::windows::idtglobal;
35
36#####################################################
37# Generating the component name from a registryitem
38#####################################################
39
40sub get_registry_component_name
41{

--- 70 unchanged lines hidden (view full) ---

112 }
113
114 if ( exists($installer::globals::allregistrycomponents_{$fullname}) )
115 {
116 $componentname = $installer::globals::allregistrycomponents_{$fullname};
117 }
118 else
119 {
119 if ( length($componentname) > 60 )
120 if ( length($componentname) > 70 )
120 {
121 $componentname = generate_new_short_registrycomponentname($componentname); # This has to be unique for the complete product, not only one package
122 }
123
124 $installer::globals::allregistrycomponents_{$fullname} = $componentname;
125 $installer::globals::allregistrycomponents_in_this_database_{$fullname} = 1;
126 }
127

--- 11 unchanged lines hidden (view full) ---

139# -> no resetting of
140# %installer::globals::allshortregistrycomponents
141# after a package was created.
142#########################################################
143
144sub generate_new_short_registrycomponentname
145{
146 my ($componentname) = @_;
121 {
122 $componentname = generate_new_short_registrycomponentname($componentname); # This has to be unique for the complete product, not only one package
123 }
124
125 $installer::globals::allregistrycomponents_{$fullname} = $componentname;
126 $installer::globals::allregistrycomponents_in_this_database_{$fullname} = 1;
127 }
128

--- 11 unchanged lines hidden (view full) ---

140# -> no resetting of
141# %installer::globals::allshortregistrycomponents
142# after a package was created.
143#########################################################
144
145sub generate_new_short_registrycomponentname
146{
147 my ($componentname) = @_;
147
148 my $shortcomponentname = "";
149 my $counter = 1;
150
148
151 my $startversion = substr($componentname, 0, 60); # taking only the first 60 characters
149 my $startversion = substr($componentname, 0, 60); # taking only the first 60 characters
152 $startversion = $startversion . "_";
150 my $subid = installer::windows::msiglobal::calculate_id($componentname, 9); # taking only the first 9 digits
151 my $shortcomponentname = $startversion . "_" . $subid;
153
152
154 $shortcomponentname = $startversion . $counter;
155
156 while ( exists($installer::globals::allshortregistrycomponents{$shortcomponentname}) )
157 {
158 $counter++;
159 $shortcomponentname = $startversion . $counter;
160 }
153 if ( exists($installer::globals::allshortregistrycomponents{$shortcomponentname}) ) { installer::exiter::exit_program("Failed to create unique component name: \"$shortcomponentname\"", "generate_new_short_registrycomponentname"); }
161
162 $installer::globals::allshortregistrycomponents{$shortcomponentname} = 1;
163
164 return $shortcomponentname;
165}
166
167##############################################################
168# Returning identifier for registry table.

--- 301 unchanged lines hidden ---
154
155 $installer::globals::allshortregistrycomponents{$shortcomponentname} = 1;
156
157 return $shortcomponentname;
158}
159
160##############################################################
161# Returning identifier for registry table.

--- 301 unchanged lines hidden ---