| Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/file.pm |
| Statements | Executed 7425686 statements in 41.0s |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 15888 | 1 | 1 | 7.57s | 10.6s | installer::windows::file::generate_unique_filename_for_filetable |
| 385 | 1 | 1 | 4.81s | 4.81s | installer::windows::file::CORE:readline (opcode) |
| 15946 | 2 | 1 | 4.17s | 4.17s | installer::windows::file::CORE:open (opcode) |
| 15888 | 1 | 1 | 2.42s | 2.42s | installer::windows::file::CORE:ftfile (opcode) |
| 1 | 1 | 1 | 2.26s | 69.5s | installer::windows::file::create_files_table |
| 791014 | 16 | 1 | 2.24s | 2.24s | installer::windows::file::CORE:subst (opcode) |
| 15888 | 1 | 1 | 1.86s | 1.86s | installer::windows::file::CORE:ftsize (opcode) |
| 773459 | 11 | 1 | 1.54s | 1.54s | installer::windows::file::CORE:match (opcode) |
| 15888 | 1 | 1 | 785ms | 2.33s | installer::windows::file::get_file_component_name |
| 2532 | 1 | 1 | 661ms | 661ms | installer::windows::file::generate_new_short_componentname |
| 15888 | 1 | 1 | 283ms | 8.01s | installer::windows::file::generate_filename_for_filetable |
| 15888 | 1 | 1 | 243ms | 4.52s | installer::windows::file::get_filesize |
| 1 | 1 | 1 | 205ms | 226ms | installer::windows::file::assign_sequencenumbers_to_files |
| 15888 | 1 | 1 | 183ms | 233ms | installer::windows::file::get_language_for_file |
| 15888 | 1 | 1 | 178ms | 5.45s | installer::windows::file::get_fileversion |
| 1 | 1 | 1 | 178ms | 191ms | installer::windows::file::assign_cab_to_files |
| 15888 | 1 | 1 | 125ms | 125ms | installer::windows::file::get_tree_condition_for_component |
| 15888 | 1 | 1 | 121ms | 121ms | installer::windows::file::get_sequence_for_file |
| 5 | 1 | 1 | 45.1ms | 45.1ms | installer::windows::file::get_component_from_assigned_file |
| 15888 | 2 | 1 | 36.1ms | 36.1ms | installer::windows::file::CORE:unpack (opcode) |
| 15946 | 2 | 1 | 32.1ms | 32.1ms | installer::windows::file::CORE:binmode (opcode) |
| 851 | 6 | 1 | 24.4ms | 24.4ms | installer::windows::file::CORE:sort (opcode) |
| 15561 | 1 | 1 | 19.5ms | 19.5ms | installer::windows::file::CORE:pack (opcode) |
| 385 | 1 | 1 | 13.7ms | 13.7ms | installer::windows::file::CORE:close (opcode) |
| 1 | 1 | 1 | 6.89ms | 8.81ms | installer::windows::file::BEGIN@30 |
| 1 | 1 | 1 | 1.30ms | 1.76ms | installer::windows::file::BEGIN@37 |
| 385 | 1 | 1 | 492µs | 492µs | installer::windows::file::CORE:regcomp (opcode) |
| 8 | 1 | 1 | 103µs | 146µs | installer::windows::file::generate_registry_keypath |
| 1 | 1 | 1 | 18µs | 21µs | installer::windows::file::BEGIN@31 |
| 1 | 1 | 1 | 15µs | 17µs | installer::windows::file::BEGIN@40 |
| 1 | 1 | 1 | 15µs | 43µs | installer::windows::file::BEGIN@34 |
| 1 | 1 | 1 | 14µs | 17µs | installer::windows::file::BEGIN@32 |
| 1 | 1 | 1 | 14µs | 16µs | installer::windows::file::BEGIN@36 |
| 1 | 1 | 1 | 14µs | 16µs | installer::windows::file::BEGIN@38 |
| 1 | 1 | 1 | 14µs | 16µs | installer::windows::file::BEGIN@39 |
| 1 | 1 | 1 | 14µs | 16µs | installer::windows::file::BEGIN@33 |
| 1 | 1 | 1 | 14µs | 16µs | installer::windows::file::BEGIN@35 |
| 0 | 0 | 0 | 0s | 0s | installer::windows::file::check_file_sequences |
| 0 | 0 | 0 | 0s | 0s | installer::windows::file::collect_shortnames_from_old_database |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 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 | # | ||||
| 9 | # This file is part of OpenOffice.org. | ||||
| 10 | # | ||||
| 11 | # OpenOffice.org is free software: you can redistribute it and/or modify | ||||
| 12 | # it under the terms of the GNU Lesser General Public License version 3 | ||||
| 13 | # only, as published by the Free Software Foundation. | ||||
| 14 | # | ||||
| 15 | # OpenOffice.org is distributed in the hope that it will be useful, | ||||
| 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
| 18 | # GNU Lesser General Public License version 3 for more details | ||||
| 19 | # (a copy is included in the LICENSE file that accompanied this code). | ||||
| 20 | # | ||||
| 21 | # You should have received a copy of the GNU Lesser General Public License | ||||
| 22 | # version 3 along with OpenOffice.org. If not, see | ||||
| 23 | # <http://www.openoffice.org/license.html> | ||||
| 24 | # for a copy of the LGPLv3 License. | ||||
| 25 | # | ||||
| 26 | #************************************************************************* | ||||
| 27 | |||||
| 28 | package installer::windows::file; | ||||
| 29 | |||||
| 30 | 2 | 2.76ms | 2 | 8.86ms | # spent 8.81ms (6.89+1.92) within installer::windows::file::BEGIN@30 which was called:
# once (6.89ms+1.92ms) by installer::BEGIN@68 at line 30 # spent 8.81ms making 1 call to installer::windows::file::BEGIN@30
# spent 48µs making 1 call to Exporter::import |
| 31 | 2 | 54µs | 2 | 24µs | # spent 21µs (18+3) within installer::windows::file::BEGIN@31 which was called:
# once (18µs+3µs) by installer::BEGIN@68 at line 31 # spent 21µs making 1 call to installer::windows::file::BEGIN@31
# spent 3µs making 1 call to UNIVERSAL::import |
| 32 | 2 | 53µs | 2 | 20µs | # spent 17µs (14+3) within installer::windows::file::BEGIN@32 which was called:
# once (14µs+3µs) by installer::BEGIN@68 at line 32 # spent 17µs making 1 call to installer::windows::file::BEGIN@32
# spent 3µs making 1 call to UNIVERSAL::import |
| 33 | 2 | 52µs | 2 | 19µs | # spent 16µs (14+3) within installer::windows::file::BEGIN@33 which was called:
# once (14µs+3µs) by installer::BEGIN@68 at line 33 # spent 16µs making 1 call to installer::windows::file::BEGIN@33
# spent 2µs making 1 call to UNIVERSAL::import |
| 34 | 2 | 53µs | 2 | 72µs | # spent 43µs (15+28) within installer::windows::file::BEGIN@34 which was called:
# once (15µs+28µs) by installer::BEGIN@68 at line 34 # spent 43µs making 1 call to installer::windows::file::BEGIN@34
# spent 28µs making 1 call to Exporter::import |
| 35 | 2 | 52µs | 2 | 19µs | # spent 16µs (14+3) within installer::windows::file::BEGIN@35 which was called:
# once (14µs+3µs) by installer::BEGIN@68 at line 35 # spent 16µs making 1 call to installer::windows::file::BEGIN@35
# spent 3µs making 1 call to UNIVERSAL::import |
| 36 | 2 | 53µs | 2 | 19µs | # spent 16µs (14+2) within installer::windows::file::BEGIN@36 which was called:
# once (14µs+2µs) by installer::BEGIN@68 at line 36 # spent 16µs making 1 call to installer::windows::file::BEGIN@36
# spent 2µs making 1 call to UNIVERSAL::import |
| 37 | 2 | 1.21ms | 2 | 1.76ms | # spent 1.76ms (1.30+458µs) within installer::windows::file::BEGIN@37 which was called:
# once (1.30ms+458µs) by installer::BEGIN@68 at line 37 # spent 1.76ms making 1 call to installer::windows::file::BEGIN@37
# spent 3µs making 1 call to UNIVERSAL::import |
| 38 | 2 | 53µs | 2 | 19µs | # spent 16µs (14+2) within installer::windows::file::BEGIN@38 which was called:
# once (14µs+2µs) by installer::BEGIN@68 at line 38 # spent 16µs making 1 call to installer::windows::file::BEGIN@38
# spent 2µs making 1 call to UNIVERSAL::import |
| 39 | 2 | 52µs | 2 | 18µs | # spent 16µs (14+2) within installer::windows::file::BEGIN@39 which was called:
# once (14µs+2µs) by installer::BEGIN@68 at line 39 # spent 16µs making 1 call to installer::windows::file::BEGIN@39
# spent 2µs making 1 call to UNIVERSAL::import |
| 40 | 2 | 8.64ms | 2 | 19µs | # spent 17µs (15+2) within installer::windows::file::BEGIN@40 which was called:
# once (15µs+2µs) by installer::BEGIN@68 at line 40 # spent 17µs making 1 call to installer::windows::file::BEGIN@40
# spent 2µs making 1 call to UNIVERSAL::import |
| 41 | |||||
| 42 | ########################################################################## | ||||
| 43 | # Assigning one cabinet file to each file. This is requrired, | ||||
| 44 | # if cabinet files shall be equivalent to packages. | ||||
| 45 | ########################################################################## | ||||
| 46 | |||||
| 47 | sub assign_cab_to_files | ||||
| 48 | # spent 191ms (178+13.4) within installer::windows::file::assign_cab_to_files which was called:
# once (178ms+13.4ms) by installer::run at line 1487 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
| 49 | 1 | 2µs | my ( $filesref ) = @_; | ||
| 50 | |||||
| 51 | 1 | 2µs | my $infoline = ""; | ||
| 52 | |||||
| 53 | 1 | 17.5ms | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||
| 54 | { | ||||
| 55 | 15888 | 15.5ms | if ( ! exists(${$filesref}[$i]->{'modules'}) ) { installer::exiter::exit_program("ERROR: No module assignment found for ${$filesref}[$i]->{'gid'} !", "assign_cab_to_files"); } | ||
| 56 | 15888 | 13.9ms | my $module = ${$filesref}[$i]->{'modules'}; | ||
| 57 | # If modules contains a list of modules, only taking the first one. | ||||
| 58 | 15888 | 55.8ms | 15888 | 10.2ms | if ( $module =~ /^\s*(.*?)\,/ ) { $module = $1; } # spent 10.2ms making 15888 calls to installer::windows::file::CORE:match, avg 641ns/call |
| 59 | |||||
| 60 | 15888 | 12.3ms | if ( ! exists($installer::globals::allcabinetassigns{$module}) ) { installer::exiter::exit_program("ERROR: No cabinet file assigned to module \"$module\" (${$filesref}[$i]->{'gid'}) !", "assign_cab_to_files"); } | ||
| 61 | 15888 | 27.3ms | ${$filesref}[$i]->{'assignedcabinetfile'} = $installer::globals::allcabinetassigns{$module}; | ||
| 62 | |||||
| 63 | # Counting the files in each cabinet file | ||||
| 64 | 15888 | 22.2ms | if ( ! exists($installer::globals::cabfilecounter{${$filesref}[$i]->{'assignedcabinetfile'}}) ) | ||
| 65 | { | ||||
| 66 | $installer::globals::cabfilecounter{${$filesref}[$i]->{'assignedcabinetfile'}} = 1; | ||||
| 67 | } | ||||
| 68 | else | ||||
| 69 | { | ||||
| 70 | 15042 | 13.9ms | $installer::globals::cabfilecounter{${$filesref}[$i]->{'assignedcabinetfile'}}++; | ||
| 71 | } | ||||
| 72 | } | ||||
| 73 | |||||
| 74 | # logging the number of files in each cabinet file | ||||
| 75 | |||||
| 76 | 1 | 2µs | $infoline = "\nCabinet file content:\n"; | ||
| 77 | 1 | 3µs | push(@installer::globals::logfileinfo, $infoline); | ||
| 78 | 1 | 500ns | my $cabfile; | ||
| 79 | 1 | 1.19ms | 1 | 799µs | foreach $cabfile ( sort keys %installer::globals::cabfilecounter ) # spent 799µs making 1 call to installer::windows::file::CORE:sort |
| 80 | { | ||||
| 81 | 846 | 1.28ms | $infoline = "$cabfile : $installer::globals::cabfilecounter{$cabfile} files\n"; | ||
| 82 | 846 | 1.17ms | push(@installer::globals::logfileinfo, $infoline); | ||
| 83 | } | ||||
| 84 | |||||
| 85 | # assigning startsequencenumbers for each cab file | ||||
| 86 | |||||
| 87 | 1 | 2µs | my $offset = 1; | ||
| 88 | 1 | 1.02ms | 1 | 804µs | foreach $cabfile ( sort keys %installer::globals::cabfilecounter ) # spent 804µs making 1 call to installer::windows::file::CORE:sort |
| 89 | { | ||||
| 90 | 846 | 483µs | my $filecount = $installer::globals::cabfilecounter{$cabfile}; | ||
| 91 | 846 | 427µs | $installer::globals::cabfilecounter{$cabfile} = $offset; | ||
| 92 | 846 | 308µs | $offset = $offset + $filecount; | ||
| 93 | |||||
| 94 | 846 | 1.01ms | $installer::globals::lastsequence{$cabfile} = $offset - 1; | ||
| 95 | } | ||||
| 96 | |||||
| 97 | # logging the start sequence numbers | ||||
| 98 | |||||
| 99 | 1 | 1µs | $infoline = "\nCabinet file start sequences:\n"; | ||
| 100 | 1 | 1µs | push(@installer::globals::logfileinfo, $infoline); | ||
| 101 | 1 | 981µs | 1 | 791µs | foreach $cabfile ( sort keys %installer::globals::cabfilecounter ) # spent 791µs making 1 call to installer::windows::file::CORE:sort |
| 102 | { | ||||
| 103 | 846 | 847µs | $infoline = "$cabfile : $installer::globals::cabfilecounter{$cabfile}\n"; | ||
| 104 | 846 | 1.10ms | push(@installer::globals::logfileinfo, $infoline); | ||
| 105 | } | ||||
| 106 | |||||
| 107 | # logging the last sequence numbers | ||||
| 108 | |||||
| 109 | 1 | 1µs | $infoline = "\nCabinet file last sequences:\n"; | ||
| 110 | 1 | 1µs | push(@installer::globals::logfileinfo, $infoline); | ||
| 111 | 1 | 964µs | 1 | 794µs | foreach $cabfile ( sort keys %installer::globals::lastsequence ) # spent 794µs making 1 call to installer::windows::file::CORE:sort |
| 112 | { | ||||
| 113 | 846 | 1.23ms | $infoline = "$cabfile : $installer::globals::lastsequence{$cabfile}\n"; | ||
| 114 | 846 | 1.10ms | push(@installer::globals::logfileinfo, $infoline); | ||
| 115 | } | ||||
| 116 | } | ||||
| 117 | |||||
| 118 | ########################################################################## | ||||
| 119 | # Assigning sequencenumbers to files. This is requrired, | ||||
| 120 | # if cabinet files shall be equivalent to packages. | ||||
| 121 | ########################################################################## | ||||
| 122 | |||||
| 123 | sub assign_sequencenumbers_to_files | ||||
| 124 | # spent 226ms (205+21.2) within installer::windows::file::assign_sequencenumbers_to_files which was called:
# once (205ms+21.2ms) by installer::run at line 1488 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
| 125 | 1 | 3µs | my ( $filesref ) = @_; | ||
| 126 | |||||
| 127 | 1 | 2µs | my %directaccess = (); | ||
| 128 | 1 | 1µs | my %allassigns = (); | ||
| 129 | |||||
| 130 | 1 | 16.8ms | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||
| 131 | { | ||||
| 132 | 15888 | 10.0ms | my $onefile = ${$filesref}[$i]; | ||
| 133 | |||||
| 134 | # Keeping order in cabinet files | ||||
| 135 | # -> collecting all files in one cabinet file | ||||
| 136 | # -> sorting files and assigning numbers | ||||
| 137 | |||||
| 138 | # Saving counter $i for direct access into files array | ||||
| 139 | # "destination" of the file is a unique identifier ('Name' is not unique!) | ||||
| 140 | 15888 | 19.4ms | if ( exists($directaccess{$onefile->{'destination'}}) ) { installer::exiter::exit_program("ERROR: 'destination' at file not unique: $onefile->{'destination'}", "assign_sequencenumbers_to_files"); } | ||
| 141 | 15888 | 28.7ms | $directaccess{$onefile->{'destination'}} = $i; | ||
| 142 | |||||
| 143 | 15888 | 11.2ms | my $cabfilename = $onefile->{'assignedcabinetfile'}; | ||
| 144 | # collecting files in cabinet files | ||||
| 145 | 15888 | 18.1ms | if ( ! exists($allassigns{$cabfilename}) ) | ||
| 146 | { | ||||
| 147 | 846 | 389µs | my %onecabfile = (); | ||
| 148 | 846 | 1.13ms | $onecabfile{$onefile->{'destination'}} = 1; | ||
| 149 | 846 | 1.10ms | $allassigns{$cabfilename} = \%onecabfile; | ||
| 150 | } | ||||
| 151 | else | ||||
| 152 | { | ||||
| 153 | 15042 | 23.5ms | $allassigns{$cabfilename}->{$onefile->{'destination'}} = 1; | ||
| 154 | } | ||||
| 155 | } | ||||
| 156 | |||||
| 157 | # Sorting each hash and assigning numbers | ||||
| 158 | # The destination of the file determines the sort order, not the filename! | ||||
| 159 | 1 | 500ns | my $cabfile; | ||
| 160 | 1 | 12.5ms | 1 | 795µs | foreach $cabfile ( sort keys %allassigns ) # spent 795µs making 1 call to installer::windows::file::CORE:sort |
| 161 | { | ||||
| 162 | 846 | 883µs | my $counter = $installer::globals::cabfilecounter{$cabfile}; | ||
| 163 | 846 | 280µs | my $dest; | ||
| 164 | 846 | 30.9ms | 846 | 20.4ms | foreach $dest ( sort keys %{$allassigns{$cabfile}} ) # <- sorting the destination! # spent 20.4ms making 846 calls to installer::windows::file::CORE:sort, avg 24µs/call |
| 165 | { | ||||
| 166 | 15888 | 9.82ms | my $directaccessnumber = $directaccess{$dest}; | ||
| 167 | 15888 | 28.2ms | ${$filesref}[$directaccessnumber]->{'assignedsequencenumber'} = $counter; | ||
| 168 | 15888 | 12.8ms | $counter++; | ||
| 169 | } | ||||
| 170 | } | ||||
| 171 | } | ||||
| 172 | |||||
| 173 | ######################################################### | ||||
| 174 | # Create a shorter version of a long component name, | ||||
| 175 | # because maximum length in msi database is 72. | ||||
| 176 | # Attention: In multi msi installation sets, the short | ||||
| 177 | # names have to be unique over all packages, because | ||||
| 178 | # this string is used to create the globally unique id | ||||
| 179 | # -> no resetting of | ||||
| 180 | # %installer::globals::allshortcomponents | ||||
| 181 | # after a package was created. | ||||
| 182 | ######################################################### | ||||
| 183 | |||||
| 184 | sub generate_new_short_componentname | ||||
| 185 | # spent 661ms within installer::windows::file::generate_new_short_componentname which was called 2532 times, avg 261µs/call:
# 2532 times (661ms+0s) by installer::windows::file::get_file_component_name at line 285, avg 261µs/call | ||||
| 186 | 2532 | 2.47ms | my ($componentname) = @_; | ||
| 187 | |||||
| 188 | 2532 | 1.61ms | my $shortcomponentname = ""; | ||
| 189 | 2532 | 1.18ms | my $counter = 1; | ||
| 190 | |||||
| 191 | 2532 | 3.61ms | my $startversion = substr($componentname, 0, 60); # taking only the first 60 characters | ||
| 192 | 2532 | 1.26ms | $startversion = $startversion . "_"; | ||
| 193 | |||||
| 194 | 2532 | 2.04ms | $shortcomponentname = $startversion . $counter; | ||
| 195 | |||||
| 196 | 2532 | 4.31ms | while ( exists($installer::globals::allshortcomponents{$shortcomponentname}) ) | ||
| 197 | { | ||||
| 198 | 335779 | 117ms | $counter++; | ||
| 199 | 335779 | 515ms | $shortcomponentname = $startversion . $counter; | ||
| 200 | } | ||||
| 201 | |||||
| 202 | 2532 | 5.56ms | $installer::globals::allshortcomponents{$shortcomponentname} = 1; | ||
| 203 | |||||
| 204 | 2532 | 14.4ms | return $shortcomponentname; | ||
| 205 | } | ||||
| 206 | |||||
| 207 | ############################################### | ||||
| 208 | # Generating the component name from a file | ||||
| 209 | ############################################### | ||||
| 210 | |||||
| 211 | sub get_file_component_name | ||||
| 212 | # spent 2.33s (785ms+1.55) within installer::windows::file::get_file_component_name which was called 15888 times, avg 147µs/call:
# 15888 times (785ms+1.55s) by installer::windows::file::create_files_table at line 887, avg 147µs/call | ||||
| 213 | 15888 | 15.0ms | my ($fileref, $filesref) = @_; | ||
| 214 | |||||
| 215 | 15888 | 8.11ms | my $componentname = ""; | ||
| 216 | |||||
| 217 | # Special handling for files with ASSIGNCOMPOMENT | ||||
| 218 | |||||
| 219 | 15888 | 7.14ms | my $styles = ""; | ||
| 220 | 15888 | 13.2ms | if ( $fileref->{'Styles'} ) { $styles = $fileref->{'Styles'}; } | ||
| 221 | 15888 | 84.7ms | 15893 | 59.5ms | if ( $styles =~ /\bASSIGNCOMPOMENT\b/ ) # spent 45.1ms making 5 calls to installer::windows::file::get_component_from_assigned_file, avg 9.03ms/call
# spent 14.4ms making 15888 calls to installer::windows::file::CORE:match, avg 903ns/call |
| 222 | { | ||||
| 223 | $componentname = get_component_from_assigned_file($fileref->{'AssignComponent'}, $filesref); | ||||
| 224 | } | ||||
| 225 | else | ||||
| 226 | { | ||||
| 227 | # In this function exists the rule to create components from files | ||||
| 228 | # Rule: | ||||
| 229 | # Two files get the same componentid, if: | ||||
| 230 | # both have the same destination directory. | ||||
| 231 | # both have the same "gid" -> both were packed in the same zip file | ||||
| 232 | # All other files are included into different components! | ||||
| 233 | |||||
| 234 | # my $componentname = $fileref->{'gid'} . "_" . $fileref->{'Dir'}; | ||||
| 235 | |||||
| 236 | # $fileref->{'Dir'} is not sufficient! All files in a zip file have the same $fileref->{'Dir'}, | ||||
| 237 | # but can be in different subdirectories. | ||||
| 238 | # Solution: destination=share\Scripts\beanshell\Capitalise\capitalise.bsh | ||||
| 239 | # in which the filename (capitalise.bsh) has to be removed and all backslashes (slashes) are | ||||
| 240 | # converted into underline. | ||||
| 241 | |||||
| 242 | 15883 | 26.3ms | my $destination = $fileref->{'destination'}; | ||
| 243 | 15883 | 45.4ms | 15883 | 424ms | installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination); # spent 424ms making 15883 calls to installer::pathanalyzer::get_path_from_fullqualifiedname, avg 27µs/call |
| 244 | 15883 | 140ms | 15883 | 82.5ms | $destination =~ s/\s//g; # spent 82.5ms making 15883 calls to installer::windows::file::CORE:subst, avg 5µs/call |
| 245 | 15883 | 59.6ms | 15883 | 11.8ms | $destination =~ s/\\/\_/g; # spent 11.8ms making 15883 calls to installer::windows::file::CORE:subst, avg 743ns/call |
| 246 | 15883 | 176ms | 15883 | 124ms | $destination =~ s/\//\_/g; # spent 124ms making 15883 calls to installer::windows::file::CORE:subst, avg 8µs/call |
| 247 | 15883 | 132ms | 15883 | 78.4ms | $destination =~ s/\_\s*$//g; # removing ending underline # spent 78.4ms making 15883 calls to installer::windows::file::CORE:subst, avg 5µs/call |
| 248 | |||||
| 249 | 15883 | 30.4ms | $componentname = $fileref->{'gid'} . "__" . $destination; | ||
| 250 | |||||
| 251 | # Files with different languages, need to be packed into different components. | ||||
| 252 | # Then the installation of the language specific component is determined by a language condition. | ||||
| 253 | |||||
| 254 | 15883 | 14.6ms | if ( $fileref->{'ismultilingual'} ) | ||
| 255 | { | ||||
| 256 | 7000 | 6.88ms | my $officelanguage = $fileref->{'specificlanguage'}; | ||
| 257 | 7000 | 6.90ms | $componentname = $componentname . "_" . $officelanguage; | ||
| 258 | } | ||||
| 259 | |||||
| 260 | 15883 | 13.7ms | $componentname = lc($componentname); # componentnames always lowercase | ||
| 261 | |||||
| 262 | 15883 | 88.0ms | 15883 | 35.4ms | $componentname =~ s/\-/\_/g; # converting "-" to "_" # spent 35.4ms making 15883 calls to installer::windows::file::CORE:subst, avg 2µs/call |
| 263 | 15883 | 121ms | 15883 | 69.8ms | $componentname =~ s/\./\_/g; # converting "-" to "_" # spent 69.8ms making 15883 calls to installer::windows::file::CORE:subst, avg 4µs/call |
| 264 | |||||
| 265 | # Attention: Maximum length for the componentname is 72 | ||||
| 266 | # %installer::globals::allcomponents_in_this_database : resetted for each database | ||||
| 267 | # %installer::globals::allcomponents : not resetted for each database | ||||
| 268 | # Component strings must be unique for the complete product, because they are used for | ||||
| 269 | # the creation of the globally unique identifier. | ||||
| 270 | |||||
| 271 | 15883 | 10.5ms | my $fullname = $componentname; # This can be longer than 72 | ||
| 272 | |||||
| 273 | 15883 | 28.2ms | if (( exists($installer::globals::allcomponents{$fullname}) ) && ( ! exists($installer::globals::allcomponents_in_this_database{$fullname}) )) | ||
| 274 | { | ||||
| 275 | # This is not allowed: One component cannot be installed with different packages. | ||||
| 276 | installer::exiter::exit_program("ERROR: Component \"$fullname\" is already included into another package. This is not allowed.", "get_file_component_name"); | ||||
| 277 | } | ||||
| 278 | |||||
| 279 | 15883 | 31.4ms | if ( exists($installer::globals::allcomponents{$fullname}) ) | ||
| 280 | { | ||||
| 281 | $componentname = $installer::globals::allcomponents{$fullname}; | ||||
| 282 | } | ||||
| 283 | else | ||||
| 284 | { | ||||
| 285 | 9015 | 14.7ms | 2532 | 661ms | if ( length($componentname) > 60 ) # spent 661ms making 2532 calls to installer::windows::file::generate_new_short_componentname, avg 261µs/call |
| 286 | { | ||||
| 287 | # Using md5sum needs much time | ||||
| 288 | # chomp(my $shorter = `echo $componentname | md5sum | sed -e "s/ .*//g"`); | ||||
| 289 | # $componentname = "comp_$shorter"; | ||||
| 290 | $componentname = generate_new_short_componentname($componentname); # This has to be unique for the complete product, not only one package | ||||
| 291 | } | ||||
| 292 | |||||
| 293 | 9015 | 23.1ms | $installer::globals::allcomponents{$fullname} = $componentname; | ||
| 294 | 9015 | 14.0ms | $installer::globals::allcomponents_in_this_database{$fullname} = 1; | ||
| 295 | } | ||||
| 296 | |||||
| 297 | # $componentname =~ s/gid_file_/g_f_/g; | ||||
| 298 | # $componentname =~ s/_extra_/_e_/g; | ||||
| 299 | # $componentname =~ s/_config_/_c_/g; | ||||
| 300 | # $componentname =~ s/_org_openoffice_/_o_o_/g; | ||||
| 301 | # $componentname =~ s/_program_/_p_/g; | ||||
| 302 | # $componentname =~ s/_typedetection_/_td_/g; | ||||
| 303 | # $componentname =~ s/_linguistic_/_l_/g; | ||||
| 304 | # $componentname =~ s/_module_/_m_/g; | ||||
| 305 | # $componentname =~ s/_optional_/_opt_/g; | ||||
| 306 | # $componentname =~ s/_packages/_pack/g; | ||||
| 307 | # $componentname =~ s/_menubar/_mb/g; | ||||
| 308 | # $componentname =~ s/_common_/_cm_/g; | ||||
| 309 | # $componentname =~ s/_export_/_exp_/g; | ||||
| 310 | # $componentname =~ s/_table_/_tb_/g; | ||||
| 311 | # $componentname =~ s/_sofficecfg_/_sc_/g; | ||||
| 312 | # $componentname =~ s/_soffice_cfg_/_sc_/g; | ||||
| 313 | # $componentname =~ s/_startmodulecommands_/_smc_/g; | ||||
| 314 | # $componentname =~ s/_drawimpresscommands_/_dic_/g; | ||||
| 315 | # $componentname =~ s/_basiccommands_/_bac_/g; | ||||
| 316 | # $componentname =~ s/_basicidecommands_/_baic_/g; | ||||
| 317 | # $componentname =~ s/_genericcommands_/_genc_/g; | ||||
| 318 | # $componentname =~ s/_bibliographycommands_/_bibc_/g; | ||||
| 319 | # $componentname =~ s/_gentiumbookbasicbolditalic_/_gbbbi_/g; | ||||
| 320 | # $componentname =~ s/_share_/_s_/g; | ||||
| 321 | # $componentname =~ s/_extension_/_ext_/g; | ||||
| 322 | # $componentname =~ s/_extensions_/_exs_/g; | ||||
| 323 | # $componentname =~ s/_modules_/_ms_/g; | ||||
| 324 | # $componentname =~ s/_uiconfig_zip_/_ucz_/g; | ||||
| 325 | # $componentname =~ s/_productivity_/_pr_/g; | ||||
| 326 | # $componentname =~ s/_wizard_/_wz_/g; | ||||
| 327 | # $componentname =~ s/_import_/_im_/g; | ||||
| 328 | # $componentname =~ s/_javascript_/_js_/g; | ||||
| 329 | # $componentname =~ s/_template_/_tpl_/g; | ||||
| 330 | # $componentname =~ s/_tplwizletter_/_twl_/g; | ||||
| 331 | # $componentname =~ s/_beanshell_/_bs_/g; | ||||
| 332 | # $componentname =~ s/_presentation_/_bs_/g; | ||||
| 333 | # $componentname =~ s/_columns_/_cls_/g; | ||||
| 334 | # $componentname =~ s/_python_/_py_/g; | ||||
| 335 | |||||
| 336 | # $componentname =~ s/_tools/_ts/g; | ||||
| 337 | # $componentname =~ s/_transitions/_trs/g; | ||||
| 338 | # $componentname =~ s/_scriptbinding/_scrb/g; | ||||
| 339 | # $componentname =~ s/_spreadsheet/_ssh/g; | ||||
| 340 | # $componentname =~ s/_publisher/_pub/g; | ||||
| 341 | # $componentname =~ s/_presenter/_pre/g; | ||||
| 342 | # $componentname =~ s/_registry/_reg/g; | ||||
| 343 | |||||
| 344 | # $componentname =~ s/screen/sc/g; | ||||
| 345 | # $componentname =~ s/wordml/wm/g; | ||||
| 346 | # $componentname =~ s/openoffice/oo/g; | ||||
| 347 | } | ||||
| 348 | |||||
| 349 | 15888 | 77.5ms | return $componentname; | ||
| 350 | } | ||||
| 351 | |||||
| 352 | #################################################################### | ||||
| 353 | # Returning the component name for a defined file gid. | ||||
| 354 | # This is necessary for files with flag ASSIGNCOMPOMENT | ||||
| 355 | #################################################################### | ||||
| 356 | |||||
| 357 | sub get_component_from_assigned_file | ||||
| 358 | # spent 45.1ms within installer::windows::file::get_component_from_assigned_file which was called 5 times, avg 9.03ms/call:
# 5 times (45.1ms+0s) by installer::windows::file::get_file_component_name at line 221, avg 9.03ms/call | ||||
| 359 | 5 | 8µs | my ($gid, $filesref) = @_; | ||
| 360 | |||||
| 361 | 5 | 45.0ms | my ($onefile) = grep {$_->{gid} eq $gid} @{$filesref}; | ||
| 362 | 5 | 7µs | if (! defined $onefile) { | ||
| 363 | installer::exiter::exit_program("ERROR: Could not find file $gid in list of files!", "get_component_from_assigned_file"); | ||||
| 364 | } | ||||
| 365 | |||||
| 366 | 5 | 11µs | my $componentname = ""; | ||
| 367 | 5 | 15µs | if ( $onefile->{'componentname'} ) { $componentname = $onefile->{'componentname'}; } | ||
| 368 | else { installer::exiter::exit_program("ERROR: No component defined for file: $gid", "get_component_from_assigned_file"); } | ||||
| 369 | |||||
| 370 | 5 | 122µs | return $componentname; | ||
| 371 | } | ||||
| 372 | |||||
| 373 | #################################################################### | ||||
| 374 | # Generating the special filename for the database file File.idt | ||||
| 375 | # Sample: CONTEXTS, CONTEXTS1 | ||||
| 376 | # This name has to be unique. | ||||
| 377 | # In most cases this is simply the filename. | ||||
| 378 | #################################################################### | ||||
| 379 | |||||
| 380 | sub generate_unique_filename_for_filetable | ||||
| 381 | # spent 10.6s (7.57+3.08) within installer::windows::file::generate_unique_filename_for_filetable which was called 15888 times, avg 670µs/call:
# 15888 times (7.57s+3.08s) by installer::windows::file::create_files_table at line 888, avg 670µs/call | ||||
| 382 | 15888 | 20.1ms | my ($fileref, $component, $uniquefilenamehashref) = @_; | ||
| 383 | |||||
| 384 | # This new filename has to be saved into $fileref, because this is needed to find the source. | ||||
| 385 | # The filename sbasic.idx/OFFSETS is changed to OFFSETS, but OFFSETS is not unique. | ||||
| 386 | # In this procedure names like OFFSETS5 are produced. And exactly this string has to be added to | ||||
| 387 | # the array of all files. | ||||
| 388 | |||||
| 389 | 15888 | 8.22ms | my $uniquefilename = ""; | ||
| 390 | 15888 | 6.98ms | my $counter = 0; | ||
| 391 | |||||
| 392 | 15888 | 20.6ms | if ( $fileref->{'Name'} ) { $uniquefilename = $fileref->{'Name'}; } | ||
| 393 | |||||
| 394 | 15888 | 41.8ms | 15888 | 174ms | installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$uniquefilename); # making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs # spent 174ms making 15888 calls to installer::pathanalyzer::make_absolute_filename_to_relative_filename, avg 11µs/call |
| 395 | |||||
| 396 | # Reading unique filename with help of "Component_" in File table from old database | ||||
| 397 | 15888 | 10.1ms | if (( $installer::globals::updatedatabase ) && ( exists($uniquefilenamehashref->{"$component/$uniquefilename"}) )) | ||
| 398 | { | ||||
| 399 | $uniquefilename = $uniquefilenamehashref->{"$component/$uniquefilename"}; # syntax of $value: ($uniquename;$shortname) | ||||
| 400 | if ( $uniquefilename =~ /^\s*(.*?)\;\s*(.*?)\s*$/ ) { $uniquefilename = $1; } | ||||
| 401 | $lcuniquefilename = lc($uniquefilename); | ||||
| 402 | $installer::globals::alluniquefilenames{$uniquefilename} = 1; | ||||
| 403 | $installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1; | ||||
| 404 | return $uniquefilename; | ||||
| 405 | } | ||||
| 406 | elsif (( $installer::globals::prepare_winpatch ) && ( exists($installer::globals::savedmapping{"$component/$uniquefilename"}) )) | ||||
| 407 | { | ||||
| 408 | # If we have a FTK mapping for this component/file, use it. | ||||
| 409 | $installer::globals::savedmapping{"$component/$uniquefilename"} =~ m/^(.*);/; | ||||
| 410 | $uniquefilename = $1; | ||||
| 411 | $lcuniquefilename = lc($uniquefilename); | ||||
| 412 | $installer::globals::alluniquefilenames{$uniquefilename} = 1; | ||||
| 413 | $installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1; | ||||
| 414 | return $uniquefilename; | ||||
| 415 | } | ||||
| 416 | |||||
| 417 | 15888 | 76.1ms | 15888 | 24.0ms | $uniquefilename =~ s/\-/\_/g; # no "-" allowed # spent 24.0ms making 15888 calls to installer::windows::file::CORE:subst, avg 2µs/call |
| 418 | 15888 | 56.3ms | 15888 | 8.06ms | $uniquefilename =~ s/\@/\_/g; # no "@" allowed # spent 8.06ms making 15888 calls to installer::windows::file::CORE:subst, avg 507ns/call |
| 419 | 15888 | 55.0ms | 15888 | 8.06ms | $uniquefilename =~ s/\$/\_/g; # no "$" allowed # spent 8.06ms making 15888 calls to installer::windows::file::CORE:subst, avg 507ns/call |
| 420 | 15888 | 67.2ms | 15888 | 17.4ms | $uniquefilename =~ s/^\s*\./\_/g; # no "." at the beginning allowed allowed # spent 17.4ms making 15888 calls to installer::windows::file::CORE:subst, avg 1µs/call |
| 421 | 15888 | 63.7ms | 15888 | 14.0ms | $uniquefilename =~ s/^\s*\d/\_d/g; # no number at the beginning allowed allowed (even file "0.gif", replacing to "_d.gif") # spent 14.0ms making 15888 calls to installer::windows::file::CORE:subst, avg 882ns/call |
| 422 | 15888 | 54.9ms | 15888 | 8.24ms | $uniquefilename =~ s/org_openoffice_/ooo_/g; # shorten the unique file name # spent 8.24ms making 15888 calls to installer::windows::file::CORE:subst, avg 518ns/call |
| 423 | |||||
| 424 | 15888 | 13.3ms | my $lcuniquefilename = lc($uniquefilename); # only lowercase names | ||
| 425 | |||||
| 426 | 15888 | 7.43ms | my $newname = 0; | ||
| 427 | |||||
| 428 | 15888 | 24.8ms | if ( ! exists($installer::globals::alllcuniquefilenames{$lcuniquefilename}) && | ||
| 429 | ! exists($installer::globals::savedrevmapping{$lcuniquefilename}) ) | ||||
| 430 | { | ||||
| 431 | 10059 | 18.0ms | $installer::globals::alluniquefilenames{$uniquefilename} = 1; | ||
| 432 | 10059 | 9.52ms | $installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1; | ||
| 433 | 10059 | 5.39ms | $newname = 1; | ||
| 434 | } | ||||
| 435 | |||||
| 436 | 15888 | 8.88ms | if ( ! $newname ) | ||
| 437 | { | ||||
| 438 | # adding a number until the name is really unique: OFFSETS, OFFSETS1, OFFSETS2, ... | ||||
| 439 | # But attention: Making "abc.xcu" to "abc1.xcu" | ||||
| 440 | |||||
| 441 | 5829 | 3.29ms | my $uniquefilenamebase = $uniquefilename; | ||
| 442 | |||||
| 443 | do | ||||
| 444 | 5829 | 594ms | { | ||
| 445 | 653296 | 251ms | $counter++; | ||
| 446 | |||||
| 447 | 653296 | 3.41s | 653296 | 1.07s | if ( $uniquefilenamebase =~ /\./ ) # spent 1.07s making 653296 calls to installer::windows::file::CORE:match, avg 2µs/call |
| 448 | { | ||||
| 449 | 599004 | 275ms | $uniquefilename = $uniquefilenamebase; | ||
| 450 | 599004 | 3.92s | 599004 | 1.76s | $uniquefilename =~ s/\./$counter\./; # spent 1.76s making 599004 calls to installer::windows::file::CORE:subst, avg 3µs/call |
| 451 | } | ||||
| 452 | else | ||||
| 453 | { | ||||
| 454 | 54292 | 33.8ms | $uniquefilename = $uniquefilenamebase . $counter; | ||
| 455 | } | ||||
| 456 | |||||
| 457 | 653296 | 278ms | $newname = 0; | ||
| 458 | 653296 | 393ms | $lcuniquefilename = lc($uniquefilename); # only lowercase names | ||
| 459 | |||||
| 460 | 653296 | 633ms | if ( ! exists($installer::globals::alllcuniquefilenames{$lcuniquefilename}) && | ||
| 461 | ! exists($installer::globals::savedrevmapping{$lcuniquefilename}) ) | ||||
| 462 | { | ||||
| 463 | 5829 | 11.7ms | $installer::globals::alluniquefilenames{$uniquefilename} = 1; | ||
| 464 | 5829 | 5.97ms | $installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1; | ||
| 465 | 5829 | 2.70ms | $newname = 1; | ||
| 466 | } | ||||
| 467 | } | ||||
| 468 | until ( $newname ) | ||||
| 469 | } | ||||
| 470 | |||||
| 471 | 15888 | 84.5ms | return $uniquefilename; | ||
| 472 | } | ||||
| 473 | |||||
| 474 | #################################################################### | ||||
| 475 | # Generating the special file column for the database file File.idt | ||||
| 476 | # Sample: NAMETR~1.TAB|.nametranslation.table | ||||
| 477 | # The first part has to be 8.3 conform. | ||||
| 478 | #################################################################### | ||||
| 479 | |||||
| 480 | sub generate_filename_for_filetable | ||||
| 481 | # spent 8.01s (283ms+7.73) within installer::windows::file::generate_filename_for_filetable which was called 15888 times, avg 504µs/call:
# 15888 times (283ms+7.73s) by installer::windows::file::create_files_table at line 897, avg 504µs/call | ||||
| 482 | 15888 | 16.6ms | my ($fileref, $shortnamesref, $uniquefilenamehashref) = @_; | ||
| 483 | |||||
| 484 | 15888 | 8.57ms | my $returnstring = ""; | ||
| 485 | |||||
| 486 | 15888 | 12.0ms | my $filename = $fileref->{'Name'}; | ||
| 487 | |||||
| 488 | 15888 | 38.8ms | 15888 | 162ms | installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$filename); # making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs # spent 162ms making 15888 calls to installer::pathanalyzer::make_absolute_filename_to_relative_filename, avg 10µs/call |
| 489 | |||||
| 490 | 15888 | 6.75ms | my $shortstring; | ||
| 491 | |||||
| 492 | # Reading short string with help of "FileName" in File table from old database | ||||
| 493 | 15888 | 18.4ms | if (( $installer::globals::updatedatabase ) && ( exists($uniquefilenamehashref->{"$fileref->{'componentname'}/$filename"}) )) | ||
| 494 | { | ||||
| 495 | my $value = $uniquefilenamehashref->{"$fileref->{'componentname'}/$filename"}; # syntax of $value: ($uniquename;$shortname) | ||||
| 496 | if ( $value =~ /^\s*(.*?)\;\s*(.*?)\s*$/ ) { $shortstring = $2; } # already collected in function "collect_shortnames_from_old_database" | ||||
| 497 | else { $shortstring = $filename; } | ||||
| 498 | } | ||||
| 499 | elsif (( $installer::globals::prepare_winpatch ) && ( exists($installer::globals::savedmapping{"$fileref->{'componentname'}/$filename"}) )) | ||||
| 500 | { | ||||
| 501 | $installer::globals::savedmapping{"$fileref->{'componentname'}/$filename"} =~ m/.*;(.*)/; | ||||
| 502 | if ($1 ne '') | ||||
| 503 | { | ||||
| 504 | $shortstring = $1; | ||||
| 505 | } | ||||
| 506 | else | ||||
| 507 | { | ||||
| 508 | $shortstring = installer::windows::idtglobal::make_eight_three_conform_with_hash($filename, "file", $shortnamesref); | ||||
| 509 | } | ||||
| 510 | } | ||||
| 511 | else | ||||
| 512 | { | ||||
| 513 | 15888 | 54.2ms | 15888 | 7.57s | $shortstring = installer::windows::idtglobal::make_eight_three_conform_with_hash($filename, "file", $shortnamesref); # spent 7.57s making 15888 calls to installer::windows::idtglobal::make_eight_three_conform_with_hash, avg 476µs/call |
| 514 | } | ||||
| 515 | |||||
| 516 | 23224 | 21.2ms | if ( $shortstring eq $filename ) { $returnstring = $filename; } # nothing changed | ||
| 517 | else {$returnstring = $shortstring . "\|" . $filename; } | ||||
| 518 | |||||
| 519 | 15888 | 71.2ms | return $returnstring; | ||
| 520 | } | ||||
| 521 | |||||
| 522 | ######################################### | ||||
| 523 | # Returning the filesize of a file | ||||
| 524 | ######################################### | ||||
| 525 | |||||
| 526 | sub get_filesize | ||||
| 527 | # spent 4.52s (243ms+4.28) within installer::windows::file::get_filesize which was called 15888 times, avg 285µs/call:
# 15888 times (243ms+4.28s) by installer::windows::file::create_files_table at line 899, avg 285µs/call | ||||
| 528 | 15888 | 13.6ms | my ($fileref) = @_; | ||
| 529 | |||||
| 530 | 15888 | 16.7ms | my $file = $fileref->{'sourcepath'}; | ||
| 531 | |||||
| 532 | 15888 | 5.89ms | my $filesize; | ||
| 533 | |||||
| 534 | 15888 | 4.44s | 31776 | 4.28s | if ( -f $file ) # test of existence. For instance services.rdb does not always exist # spent 2.42s making 15888 calls to installer::windows::file::CORE:ftfile, avg 152µs/call
# spent 1.86s making 15888 calls to installer::windows::file::CORE:ftsize, avg 117µs/call |
| 535 | { | ||||
| 536 | $filesize = ( -s $file ); # file size can be "0" | ||||
| 537 | } | ||||
| 538 | else | ||||
| 539 | { | ||||
| 540 | $filesize = -1; | ||||
| 541 | } | ||||
| 542 | |||||
| 543 | 15888 | 82.0ms | return $filesize; | ||
| 544 | } | ||||
| 545 | |||||
| 546 | ############################################# | ||||
| 547 | # Returning the file version, if required | ||||
| 548 | # Sample: "8.0.1.8976"; | ||||
| 549 | ############################################# | ||||
| 550 | |||||
| 551 | sub get_fileversion | ||||
| 552 | # spent 5.45s (178ms+5.27) within installer::windows::file::get_fileversion which was called 15888 times, avg 343µs/call:
# 15888 times (178ms+5.27s) by installer::windows::file::create_files_table at line 901, avg 343µs/call | ||||
| 553 | 15888 | 23.1ms | my ($onefile, $allvariables, $styles) = @_; | ||
| 554 | |||||
| 555 | 15888 | 9.07ms | my $fileversion = ""; | ||
| 556 | |||||
| 557 | 15888 | 114ms | 15888 | 48.9ms | if ( $onefile->{'Name'} =~ /\.bin$|\.com$|\.dll$|\.exe$|\.pyd$/ ) # spent 48.9ms making 15888 calls to installer::windows::file::CORE:match, avg 3µs/call |
| 558 | { | ||||
| 559 | 385 | 84.3ms | 385 | 81.4ms | open (EXE, "<$onefile->{'sourcepath'}"); # spent 81.4ms making 385 calls to installer::windows::file::CORE:open, avg 212µs/call |
| 560 | 385 | 2.47ms | 385 | 919µs | binmode EXE; # spent 919µs making 385 calls to installer::windows::file::CORE:binmode, avg 2µs/call |
| 561 | 1155 | 4.82s | 385 | 4.81s | {local $/ = undef; $exedata = <EXE>;} # spent 4.81s making 385 calls to installer::windows::file::CORE:readline, avg 12.5ms/call |
| 562 | 385 | 15.8ms | 385 | 13.7ms | close EXE; # spent 13.7ms making 385 calls to installer::windows::file::CORE:close, avg 36µs/call |
| 563 | |||||
| 564 | 385 | 497µs | my $binaryfileversion = "(V\x00S\x00_\x00V\x00E\x00R\x00S\x00I\x00O\x00N\x00_\x00I\x00N\x00F\x00O\x00\x00\x00\x00\x00\xbd\x04\xef\xfe\x00\x00\x01\x00)(........)"; | ||
| 565 | |||||
| 566 | 385 | 311ms | 770 | 306ms | if ($exedata =~ /$binaryfileversion/ms) # spent 306ms making 385 calls to installer::windows::file::CORE:match, avg 794µs/call
# spent 492µs making 385 calls to installer::windows::file::CORE:regcomp, avg 1µs/call |
| 567 | { | ||||
| 568 | 327 | 4.46ms | 327 | 1.84ms | my ($header, $subversion, $version, $vervariant, $microversion) = ($1,unpack( "vvvv", $2)); # spent 1.84ms making 327 calls to installer::windows::file::CORE:unpack, avg 6µs/call |
| 569 | 327 | 1.36ms | $fileversion = $version . "." . $subversion . "." . $microversion . "." . $vervariant; | ||
| 570 | } | ||||
| 571 | } | ||||
| 572 | |||||
| 573 | 15888 | 74.0ms | return $fileversion; | ||
| 574 | } | ||||
| 575 | |||||
| 576 | ############################################# | ||||
| 577 | # Returning the sequence for a file | ||||
| 578 | ############################################# | ||||
| 579 | |||||
| 580 | sub get_sequence_for_file | ||||
| 581 | # spent 121ms within installer::windows::file::get_sequence_for_file which was called 15888 times, avg 8µs/call:
# 15888 times (121ms+0s) by installer::windows::file::create_files_table at line 913, avg 8µs/call | ||||
| 582 | 15888 | 22.8ms | my ($number, $onefile, $fileentry, $allupdatesequenceshashref, $allupdatecomponentshashref, $allupdatefileorderhashref, $allfilecomponents) = @_; | ||
| 583 | |||||
| 584 | 15888 | 7.96ms | my $sequence = ""; | ||
| 585 | 15888 | 7.09ms | my $infoline = ""; | ||
| 586 | 15888 | 18.5ms | my $pffcomponentname = $onefile->{'componentname'} . "_pff"; | ||
| 587 | |||||
| 588 | 15888 | 14.0ms | if ( $installer::globals::updatedatabase ) | ||
| 589 | { | ||||
| 590 | if (( exists($allupdatesequenceshashref->{$onefile->{'uniquename'}}) ) && | ||||
| 591 | (( $onefile->{'componentname'} eq $allupdatecomponentshashref->{$onefile->{'uniquename'}} ) || | ||||
| 592 | ( $pffcomponentname eq $allupdatecomponentshashref->{$onefile->{'uniquename'}} ))) | ||||
| 593 | { | ||||
| 594 | # The second condition is necessary to find shifted files, that have same "uniquename", but are now | ||||
| 595 | # located in another directory. This can be seen at the component name. | ||||
| 596 | $sequence = $allupdatesequenceshashref->{$onefile->{'uniquename'}}; | ||||
| 597 | $onefile->{'assignedsequencenumber'} = $sequence; | ||||
| 598 | # Collecting all used sequences, to guarantee, that no number is unused | ||||
| 599 | $installer::globals::allusedupdatesequences{$sequence} = 1; | ||||
| 600 | # Special help for files, that already have a "pff" component name (for example after ServicePack 1) | ||||
| 601 | if ( $pffcomponentname eq $allupdatecomponentshashref->{$onefile->{'uniquename'}} ) | ||||
| 602 | { | ||||
| 603 | $infoline = "Warning: Special handling for component \"$pffcomponentname\". This file was added after the final, but before this ServicePack.\n"; | ||||
| 604 | push(@installer::globals::logfileinfo, $infoline); | ||||
| 605 | $onefile->{'componentname'} = $pffcomponentname; # pff for "post final file" | ||||
| 606 | $fileentry->{'Component_'} = $onefile->{'componentname'}; | ||||
| 607 | if ( ! exists($allfilecomponents->{$fileentry->{'Component_'}}) ) { $allfilecomponents->{$fileentry->{'Component_'}} = 1; } | ||||
| 608 | } | ||||
| 609 | } | ||||
| 610 | else | ||||
| 611 | { | ||||
| 612 | $installer::globals::updatesequencecounter++; | ||||
| 613 | $sequence = $installer::globals::updatesequencecounter; | ||||
| 614 | $onefile->{'assignedsequencenumber'} = $sequence; | ||||
| 615 | # $onefile->{'assignedcabinetfile'} = $installer::globals::pffcabfilename; # assigning to cabinet file for "post final files" | ||||
| 616 | # Collecting all new files | ||||
| 617 | $installer::globals::newupdatefiles{$sequence} = $onefile; | ||||
| 618 | # Saving in sequence hash | ||||
| 619 | $allupdatefileorderhashref->{$sequence} = $onefile->{'uniquename'}; | ||||
| 620 | |||||
| 621 | # If the new file is part of an existing component, this must be changed now. All files | ||||
| 622 | # of one component have to be included in one cabinet file. But because the order must | ||||
| 623 | # not change, all new files have to be added to new components. | ||||
| 624 | # $onefile->{'componentname'} = $file{'Component_'}; | ||||
| 625 | |||||
| 626 | $onefile->{'componentname'} = $onefile->{'componentname'} . "_pff"; # pff for "post final file" | ||||
| 627 | $fileentry->{'Component_'} = $onefile->{'componentname'}; | ||||
| 628 | if ( ! exists($allfilecomponents->{$fileentry->{'Component_'}}) ) { $allfilecomponents->{$fileentry->{'Component_'}} = 1; } | ||||
| 629 | $onefile->{'PostFinalFile'} = 1; | ||||
| 630 | # $installer::globals::pfffileexists = 1; | ||||
| 631 | # The sequence for this file has changed. It has to be inserted at the end of the files collector. | ||||
| 632 | $installer::globals::insert_file_at_end = 1; | ||||
| 633 | $installer::globals::newfilescollector{$sequence} = $onefile; # Adding new files to the end of the filescollector | ||||
| 634 | $installer::globals::newfilesexist = 1; | ||||
| 635 | } | ||||
| 636 | } | ||||
| 637 | else | ||||
| 638 | { | ||||
| 639 | 15888 | 7.97ms | $sequence = $number; | ||
| 640 | # my $sequence = $number + 1; | ||||
| 641 | |||||
| 642 | # Idea: Each component is packed into a cab file. | ||||
| 643 | # This requires that all files in one cab file have sequences directly follwing each other, | ||||
| 644 | # for instance from 1456 to 1466. Then in the media table the LastSequence for this cab file | ||||
| 645 | # is 1466. | ||||
| 646 | # Because all files belonging to one component are directly behind each other in the file | ||||
| 647 | # collector, it is possible to use simply an increasing number as sequence value. | ||||
| 648 | # If files belonging to one component are not directly behind each other in the files collector | ||||
| 649 | # this mechanism will no longer work. | ||||
| 650 | } | ||||
| 651 | |||||
| 652 | 15888 | 73.8ms | return $sequence; | ||
| 653 | } | ||||
| 654 | |||||
| 655 | ############################################# | ||||
| 656 | # Returning the Windows language of a file | ||||
| 657 | ############################################# | ||||
| 658 | |||||
| 659 | sub get_language_for_file | ||||
| 660 | # spent 233ms (183+50.6) within installer::windows::file::get_language_for_file which was called 15888 times, avg 15µs/call:
# 15888 times (183ms+50.6ms) by installer::windows::file::create_files_table at line 903, avg 15µs/call | ||||
| 661 | 15888 | 14.2ms | my ($fileref) = @_; | ||
| 662 | |||||
| 663 | 15888 | 8.77ms | my $language = ""; | ||
| 664 | |||||
| 665 | 15888 | 13.5ms | if ( $fileref->{'specificlanguage'} ) { $language = $fileref->{'specificlanguage'}; } | ||
| 666 | |||||
| 667 | 15888 | 18.1ms | if ( $language eq "" ) | ||
| 668 | { | ||||
| 669 | 8888 | 3.98ms | $language = 0; # language independent | ||
| 670 | # If this is not a font, the return value should be "0" (Check ICE 60) | ||||
| 671 | 8888 | 4.92ms | my $styles = ""; | ||
| 672 | 8888 | 8.22ms | if ( $fileref->{'Styles'} ) { $styles = $fileref->{'Styles'}; } | ||
| 673 | 8888 | 41.8ms | 8888 | 8.86ms | if ( $styles =~ /\bFONT\b/ ) { $language = ""; } # spent 8.86ms making 8888 calls to installer::windows::file::CORE:match, avg 997ns/call |
| 674 | } | ||||
| 675 | else | ||||
| 676 | { | ||||
| 677 | 7000 | 20.9ms | 7000 | 41.7ms | $language = installer::windows::language::get_windows_language($language); # spent 41.7ms making 7000 calls to installer::windows::language::get_windows_language, avg 6µs/call |
| 678 | } | ||||
| 679 | |||||
| 680 | 15888 | 65.9ms | return $language; | ||
| 681 | } | ||||
| 682 | |||||
| 683 | #################################################################### | ||||
| 684 | # Creating a new KeyPath for components in TemplatesFolder. | ||||
| 685 | #################################################################### | ||||
| 686 | |||||
| 687 | sub generate_registry_keypath | ||||
| 688 | # spent 146µs (103+43) within installer::windows::file::generate_registry_keypath which was called 8 times, avg 18µs/call:
# 8 times (103µs+43µs) by installer::windows::file::create_files_table at line 1020, avg 18µs/call | ||||
| 689 | 8 | 7µs | my ($onefile) = @_; | ||
| 690 | |||||
| 691 | 8 | 7µs | my $keypath = $onefile->{'Name'}; | ||
| 692 | 8 | 78µs | 8 | 43µs | $keypath =~ s/\.//g; # spent 43µs making 8 calls to installer::windows::file::CORE:subst, avg 5µs/call |
| 693 | 8 | 8µs | $keypath = lc($keypath); | ||
| 694 | 8 | 17µs | $keypath = "userreg_" . $keypath; | ||
| 695 | |||||
| 696 | 8 | 45µs | return $keypath; | ||
| 697 | } | ||||
| 698 | |||||
| 699 | #################################################################### | ||||
| 700 | # Check, if in an update process files are missing. No removal | ||||
| 701 | # of files allowed for Windows Patch creation. | ||||
| 702 | # Also logging all new files, that have to be included in extra | ||||
| 703 | # components and cab files. | ||||
| 704 | #################################################################### | ||||
| 705 | |||||
| 706 | sub check_file_sequences | ||||
| 707 | { | ||||
| 708 | my ($allupdatefileorderhashref, $allupdatecomponentorderhashref) = @_; | ||||
| 709 | |||||
| 710 | # All used sequences stored in %installer::globals::allusedupdatesequences | ||||
| 711 | # Maximum sequence number of old database stored in $installer::globals::updatelastsequence | ||||
| 712 | # All new files stored in %installer::globals::newupdatefiles | ||||
| 713 | |||||
| 714 | my $infoline = ""; | ||||
| 715 | |||||
| 716 | my @missing_sequences = (); | ||||
| 717 | my @really_missing_sequences = (); | ||||
| 718 | |||||
| 719 | for ( my $i = 1; $i <= $installer::globals::updatelastsequence; $i++ ) | ||||
| 720 | { | ||||
| 721 | if ( ! exists($installer::globals::allusedupdatesequences{$i}) ) { push(@missing_sequences, $i); } | ||||
| 722 | } | ||||
| 723 | |||||
| 724 | if ( $#missing_sequences > -1 ) | ||||
| 725 | { | ||||
| 726 | # Missing sequences can also be caused by files included in merge modules. This files are added later into the file table. | ||||
| 727 | # Therefore now it is time to check the content of the merge modules. | ||||
| 728 | |||||
| 729 | for ( my $j = 0; $j <= $#missing_sequences; $j++ ) | ||||
| 730 | { | ||||
| 731 | my $filename = $allupdatefileorderhashref->{$missing_sequences[$j]}; | ||||
| 732 | |||||
| 733 | # Is this a file from a merge module? Then this is no error. | ||||
| 734 | if ( ! exists($installer::globals::mergemodulefiles{$filename}) ) | ||||
| 735 | { | ||||
| 736 | push(@really_missing_sequences, $missing_sequences[$j]); | ||||
| 737 | } | ||||
| 738 | } | ||||
| 739 | } | ||||
| 740 | |||||
| 741 | if ( $#really_missing_sequences > -1 ) | ||||
| 742 | { | ||||
| 743 | my $errorstring = ""; | ||||
| 744 | for ( my $j = 0; $j <= $#really_missing_sequences; $j++ ) | ||||
| 745 | { | ||||
| 746 | my $filename = $allupdatefileorderhashref->{$really_missing_sequences[$j]}; | ||||
| 747 | my $comp = $allupdatecomponentorderhashref->{$really_missing_sequences[$j]}; | ||||
| 748 | $errorstring = "$errorstring$filename (Sequence: $really_missing_sequences[$j], Component: \"$comp\")\n"; | ||||
| 749 | } | ||||
| 750 | |||||
| 751 | $infoline = "ERROR: Files are removed compared with update database.\nThe following files are missing:\n$errorstring"; | ||||
| 752 | push(@installer::globals::logfileinfo, $infoline); | ||||
| 753 | installer::exiter::exit_program($infoline, "check_file_sequences"); | ||||
| 754 | } | ||||
| 755 | |||||
| 756 | # Searching for new files | ||||
| 757 | |||||
| 758 | my $counter = 0; | ||||
| 759 | |||||
| 760 | foreach my $key ( keys %installer::globals::newupdatefiles ) | ||||
| 761 | { | ||||
| 762 | my $onefile = $installer::globals::newupdatefiles{$key}; | ||||
| 763 | $counter++; | ||||
| 764 | if ( $counter == 1 ) | ||||
| 765 | { | ||||
| 766 | $infoline = "\nNew files compared to the update database:\n"; | ||||
| 767 | push(@installer::globals::logfileinfo, $infoline); | ||||
| 768 | } | ||||
| 769 | |||||
| 770 | $infoline = "$onefile->{'Name'} ($onefile->{'gid'}) Sequence: $onefile->{'assignedsequencenumber'}\n"; | ||||
| 771 | push(@installer::globals::logfileinfo, $infoline); | ||||
| 772 | } | ||||
| 773 | |||||
| 774 | if ( $counter == 0 ) | ||||
| 775 | { | ||||
| 776 | $infoline = "Info: No new file compared with update database!\n"; | ||||
| 777 | push(@installer::globals::logfileinfo, $infoline); | ||||
| 778 | } | ||||
| 779 | |||||
| 780 | } | ||||
| 781 | |||||
| 782 | ################################################################### | ||||
| 783 | # Collecting further conditions for the component table. | ||||
| 784 | # This is used by multilayer products, to enable installation | ||||
| 785 | # of separate layers. | ||||
| 786 | ################################################################### | ||||
| 787 | |||||
| 788 | sub get_tree_condition_for_component | ||||
| 789 | # spent 125ms within installer::windows::file::get_tree_condition_for_component which was called 15888 times, avg 8µs/call:
# 15888 times (125ms+0s) by installer::windows::file::create_files_table at line 952, avg 8µs/call | ||||
| 790 | 15888 | 17.5ms | my ($onefile, $componentname) = @_; | ||
| 791 | |||||
| 792 | 15888 | 83.1ms | if ( $onefile->{'destination'} ) | ||
| 793 | { | ||||
| 794 | 15888 | 11.5ms | my $dest = $onefile->{'destination'}; | ||
| 795 | |||||
| 796 | # Comparing the destination path with | ||||
| 797 | # $installer::globals::hostnametreestyles{$hostname} = $treestyle; | ||||
| 798 | # (-> hostname is the key, the style the value!) | ||||
| 799 | |||||
| 800 | 15888 | 47.3ms | foreach my $hostname ( keys %installer::globals::hostnametreestyles ) | ||
| 801 | { | ||||
| 802 | if (( $dest eq $hostname ) || ( $dest =~ /^\s*\Q$hostname\E\\/ )) | ||||
| 803 | { | ||||
| 804 | # the value is the style | ||||
| 805 | my $style = $installer::globals::hostnametreestyles{$hostname}; | ||||
| 806 | # the condition is saved in %installer::globals::treestyles | ||||
| 807 | my $condition = $installer::globals::treestyles{$style}; | ||||
| 808 | # Saving condition to be added in table Property | ||||
| 809 | $installer::globals::usedtreeconditions{$condition} = 1; | ||||
| 810 | $condition = $condition . "=1"; | ||||
| 811 | # saving this condition | ||||
| 812 | $installer::globals::treeconditions{$componentname} = $condition; | ||||
| 813 | |||||
| 814 | # saving also at the file, for usage in fileinfo | ||||
| 815 | $onefile->{'layer'} = $installer::globals::treelayername{$style}; | ||||
| 816 | } | ||||
| 817 | } | ||||
| 818 | } | ||||
| 819 | } | ||||
| 820 | |||||
| 821 | ############################################ | ||||
| 822 | # Collecting all short names, that are | ||||
| 823 | # already used by the old database | ||||
| 824 | ############################################ | ||||
| 825 | |||||
| 826 | sub collect_shortnames_from_old_database | ||||
| 827 | { | ||||
| 828 | my ($uniquefilenamehashref, $shortnameshashref) = @_; | ||||
| 829 | |||||
| 830 | foreach my $key ( keys %{$uniquefilenamehashref} ) | ||||
| 831 | { | ||||
| 832 | my $value = $uniquefilenamehashref->{$key}; # syntax of $value: ($uniquename;$shortname) | ||||
| 833 | |||||
| 834 | if ( $value =~ /^\s*(.*?)\;\s*(.*?)\s*$/ ) | ||||
| 835 | { | ||||
| 836 | my $shortstring = $2; | ||||
| 837 | $shortnameshashref->{$shortstring} = 1; # adding the shortname to the array of all shortnames | ||||
| 838 | } | ||||
| 839 | } | ||||
| 840 | } | ||||
| 841 | |||||
| 842 | ############################################ | ||||
| 843 | # Creating the file File.idt dynamically | ||||
| 844 | ############################################ | ||||
| 845 | |||||
| 846 | sub create_files_table | ||||
| 847 | # spent 69.5s (2.26+67.2) within installer::windows::file::create_files_table which was called:
# once (2.26s+67.2s) by installer::run at line 1496 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
| 848 | 1 | 8µs | my ($filesref, $dirref, $allfilecomponentsref, $basedir, $allvariables, $uniquefilenamehashref, $allupdatesequenceshashref, $allupdatecomponentshashref, $allupdatefileorderhashref) = @_; | ||
| 849 | |||||
| 850 | 1 | 7µs | 1 | 219µs | installer::logger::include_timestamp_into_logfile("Performance Info: File Table start"); # spent 219µs making 1 call to installer::logger::include_timestamp_into_logfile |
| 851 | |||||
| 852 | # Structure of the files table: | ||||
| 853 | # File Component_ FileName FileSize Version Language Attributes Sequence | ||||
| 854 | # In this function, all components are created. | ||||
| 855 | # | ||||
| 856 | # $allfilecomponentsref is empty at the beginning | ||||
| 857 | |||||
| 858 | 1 | 500ns | my $infoline; | ||
| 859 | |||||
| 860 | 1 | 1µs | my @allfiles = (); | ||
| 861 | 1 | 500ns | my @filetable = (); | ||
| 862 | 1 | 500ns | my @filehashtable = (); | ||
| 863 | 1 | 2µs | my %allfilecomponents = (); | ||
| 864 | 1 | 500ns | my $counter = 0; | ||
| 865 | |||||
| 866 | 1 | 23µs | 2 | 3.12s | if ( $^O =~ /cygwin/i ) { installer::worker::generate_cygwin_paths($filesref); } # spent 3.12s making 1 call to installer::worker::generate_cygwin_paths
# spent 7µs making 1 call to installer::windows::file::CORE:match |
| 867 | |||||
| 868 | # The filenames must be collected because of uniqueness | ||||
| 869 | # 01-44-~1.DAT, 01-44-~2.DAT, ... | ||||
| 870 | 1 | 2µs | my %shortnames = (); | ||
| 871 | |||||
| 872 | 1 | 500ns | if ( $installer::globals::updatedatabase ) { collect_shortnames_from_old_database($uniquefilenamehashref, \%shortnames); } | ||
| 873 | |||||
| 874 | 1 | 7µs | 1 | 28µs | installer::windows::idtglobal::write_idt_header(\@filetable, "file"); # spent 28µs making 1 call to installer::windows::idtglobal::write_idt_header |
| 875 | 1 | 3µs | 1 | 17µs | installer::windows::idtglobal::write_idt_header(\@filehashtable, "filehash"); # spent 17µs making 1 call to installer::windows::idtglobal::write_idt_header |
| 876 | 1 | 3µs | 1 | 16µs | installer::windows::idtglobal::write_idt_header(\@installer::globals::removefiletable, "removefile"); # spent 16µs making 1 call to installer::windows::idtglobal::write_idt_header |
| 877 | |||||
| 878 | 1 | 28.3ms | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||
| 879 | { | ||||
| 880 | 15888 | 13.3ms | my %file = (); | ||
| 881 | |||||
| 882 | 15888 | 14.5ms | my $onefile = ${$filesref}[$i]; | ||
| 883 | |||||
| 884 | 15888 | 8.08ms | my $styles = ""; | ||
| 885 | 15888 | 21.2ms | if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; } | ||
| 886 | |||||
| 887 | 15888 | 58.3ms | 15888 | 2.33s | $file{'Component_'} = get_file_component_name($onefile, $filesref); # spent 2.33s making 15888 calls to installer::windows::file::get_file_component_name, avg 147µs/call |
| 888 | 15888 | 59.1ms | 15888 | 10.6s | $file{'File'} = generate_unique_filename_for_filetable($onefile, $file{'Component_'}, $uniquefilenamehashref); # spent 10.6s making 15888 calls to installer::windows::file::generate_unique_filename_for_filetable, avg 670µs/call |
| 889 | |||||
| 890 | 15888 | 22.3ms | $onefile->{'uniquename'} = $file{'File'}; | ||
| 891 | 15888 | 20.7ms | $onefile->{'componentname'} = $file{'Component_'}; | ||
| 892 | |||||
| 893 | # Collecting all components | ||||
| 894 | |||||
| 895 | 15888 | 27.8ms | if ( ! exists($allfilecomponents{$file{'Component_'}}) ) { $allfilecomponents{$file{'Component_'}} = 1; } | ||
| 896 | |||||
| 897 | 15888 | 57.4ms | 15888 | 8.01s | $file{'FileName'} = generate_filename_for_filetable($onefile, \%shortnames, $uniquefilenamehashref); # spent 8.01s making 15888 calls to installer::windows::file::generate_filename_for_filetable, avg 504µs/call |
| 898 | |||||
| 899 | 15888 | 58.4ms | 15888 | 4.52s | $file{'FileSize'} = get_filesize($onefile); # spent 4.52s making 15888 calls to installer::windows::file::get_filesize, avg 285µs/call |
| 900 | |||||
| 901 | 15888 | 63.7ms | 15888 | 5.45s | $file{'Version'} = get_fileversion($onefile, $allvariables, $styles); # spent 5.45s making 15888 calls to installer::windows::file::get_fileversion, avg 343µs/call |
| 902 | |||||
| 903 | 15888 | 53.2ms | 15888 | 233ms | $file{'Language'} = get_language_for_file($onefile); # spent 233ms making 15888 calls to installer::windows::file::get_language_for_file, avg 15µs/call |
| 904 | |||||
| 905 | 15888 | 67.1ms | 15888 | 10.5ms | if ( $styles =~ /\bDONT_PACK\b/ ) { $file{'Attributes'} = "8192"; } # spent 10.5ms making 15888 calls to installer::windows::file::CORE:match, avg 662ns/call |
| 906 | 15888 | 23.0ms | else { $file{'Attributes'} = "16384"; } | ||
| 907 | |||||
| 908 | # $file{'Attributes'} = "16384"; # Sourcefile is packed | ||||
| 909 | # $file{'Attributes'} = "8192"; # Sourcefile is unpacked | ||||
| 910 | |||||
| 911 | 15888 | 8.32ms | $installer::globals::insert_file_at_end = 0; | ||
| 912 | 15888 | 7.57ms | $counter++; | ||
| 913 | 15888 | 68.7ms | 15888 | 121ms | $file{'Sequence'} = get_sequence_for_file($counter, $onefile, \%file, $allupdatesequenceshashref, $allupdatecomponentshashref, $allupdatefileorderhashref, \%allfilecomponents); # spent 121ms making 15888 calls to installer::windows::file::get_sequence_for_file, avg 8µs/call |
| 914 | |||||
| 915 | 15888 | 15.8ms | $onefile->{'sequencenumber'} = $file{'Sequence'}; | ||
| 916 | |||||
| 917 | 15888 | 78.7ms | my $oneline = $file{'File'} . "\t" . $file{'Component_'} . "\t" . $file{'FileName'} . "\t" | ||
| 918 | . $file{'FileSize'} . "\t" . $file{'Version'} . "\t" . $file{'Language'} . "\t" | ||||
| 919 | . $file{'Attributes'} . "\t" . $file{'Sequence'} . "\n"; | ||||
| 920 | |||||
| 921 | 15888 | 20.0ms | push(@filetable, $oneline); | ||
| 922 | |||||
| 923 | 15888 | 70.6ms | 15888 | 15.9ms | if ( $file{'File'} =~ /\.py$/ ) # spent 15.9ms making 15888 calls to installer::windows::file::CORE:match, avg 1000ns/call |
| 924 | { | ||||
| 925 | 688 | 818µs | my %removefile = (); | ||
| 926 | |||||
| 927 | 688 | 1.60ms | $removefile{'FileKey'} = "remove_" . $file{'File'} . "c"; | ||
| 928 | 688 | 854µs | $removefile{'Component_'} = $file{'Component_'}; | ||
| 929 | 688 | 835µs | $removefile{'FileName'} = $file{'FileName'}; | ||
| 930 | 688 | 6.12ms | 688 | 2.91ms | $removefile{'FileName'} =~ s/\.py$/.pyc/; # spent 2.91ms making 688 calls to installer::windows::file::CORE:subst, avg 4µs/call |
| 931 | 688 | 4.52ms | 688 | 1.62ms | $removefile{'FileName'} =~ s/\.PY\|/.PYC|/; # spent 1.62ms making 688 calls to installer::windows::file::CORE:subst, avg 2µs/call |
| 932 | 688 | 4.82ms | 688 | 17.3s | $removefile{'DirProperty'} = installer::windows::component::get_file_component_directory($file{'Component_'}, $filesref, $dirref); # spent 17.3s making 688 calls to installer::windows::component::get_file_component_directory, avg 25.2ms/call |
| 933 | 688 | 895µs | $removefile{'InstallMode'} = 2; # msiInstallStateAbsent | ||
| 934 | 688 | 4.68ms | $oneline = $removefile{'FileKey'} . "\t" . $removefile{'Component_'} . "\t" . $removefile{'FileName'} . "\t" | ||
| 935 | . $removefile{'DirProperty'} . "\t" . $removefile{'InstallMode'} . "\n"; | ||||
| 936 | |||||
| 937 | 688 | 4.93ms | push(@installer::globals::removefiletable, $oneline); | ||
| 938 | } | ||||
| 939 | |||||
| 940 | 15888 | 13.8ms | if ( ! $installer::globals::insert_file_at_end ) { push(@allfiles, $onefile); } | ||
| 941 | |||||
| 942 | # Collecting all component conditions | ||||
| 943 | 15888 | 11.7ms | if ( $onefile->{'ComponentCondition'} ) | ||
| 944 | { | ||||
| 945 | if ( ! exists($installer::globals::componentcondition{$file{'Component_'}})) | ||||
| 946 | { | ||||
| 947 | $installer::globals::componentcondition{$file{'Component_'}} = $onefile->{'ComponentCondition'}; | ||||
| 948 | } | ||||
| 949 | } | ||||
| 950 | |||||
| 951 | # Collecting also all tree conditions for multilayer products | ||||
| 952 | 15888 | 52.7ms | 15888 | 125ms | get_tree_condition_for_component($onefile, $file{'Component_'}); # spent 125ms making 15888 calls to installer::windows::file::get_tree_condition_for_component, avg 8µs/call |
| 953 | |||||
| 954 | # Collecting all component names, that have flag VERSION_INDEPENDENT_COMP_ID | ||||
| 955 | # This should be all components with constant API, for example URE | ||||
| 956 | 15888 | 59.2ms | 15888 | 9.54ms | if ( $styles =~ /\bVERSION_INDEPENDENT_COMP_ID\b/ ) # spent 9.54ms making 15888 calls to installer::windows::file::CORE:match, avg 600ns/call |
| 957 | { | ||||
| 958 | $installer::globals::base_independent_components{$onefile->{'componentname'}} = 1; | ||||
| 959 | } | ||||
| 960 | |||||
| 961 | # Collecting all component ids, that are defined at files in scp project (should not be used anymore) | ||||
| 962 | 15888 | 10.4ms | if ( $onefile->{'CompID'} ) | ||
| 963 | { | ||||
| 964 | if ( ! exists($installer::globals::componentid{$onefile->{'componentname'}})) | ||||
| 965 | { | ||||
| 966 | $installer::globals::componentid{$onefile->{'componentname'}} = $onefile->{'CompID'}; | ||||
| 967 | } | ||||
| 968 | else | ||||
| 969 | { | ||||
| 970 | if ( $installer::globals::componentid{$onefile->{'componentname'}} ne $onefile->{'CompID'} ) | ||||
| 971 | { | ||||
| 972 | installer::exiter::exit_program("ERROR: There is already a ComponentID for component \"$onefile->{'componentname'}\" : \"$installer::globals::componentid{$onefile->{'componentname'}}\" . File \"$onefile->{'gid'}\" uses \"$onefile->{'CompID'}\" !", "create_files_table"); | ||||
| 973 | } | ||||
| 974 | } | ||||
| 975 | |||||
| 976 | # Also checking vice versa. Is this ComponentID already used? If yes, is the componentname the same? | ||||
| 977 | |||||
| 978 | if ( ! exists($installer::globals::comparecomponentname{$onefile->{'CompID'}})) | ||||
| 979 | { | ||||
| 980 | $installer::globals::comparecomponentname{$onefile->{'CompID'}} = $onefile->{'componentname'}; | ||||
| 981 | } | ||||
| 982 | else | ||||
| 983 | { | ||||
| 984 | if ( $installer::globals::comparecomponentname{$onefile->{'CompID'}} ne $onefile->{'componentname'} ) | ||||
| 985 | { | ||||
| 986 | installer::exiter::exit_program("ERROR: There is already a component for ComponentID \"$onefile->{'CompID'}\" : \"$installer::globals::comparecomponentname{$onefile->{'CompID'}}\" . File \"$onefile->{'gid'}\" has same component id but is included in component \"$onefile->{'componentname'}\" !", "create_files_table"); | ||||
| 987 | } | ||||
| 988 | } | ||||
| 989 | } | ||||
| 990 | |||||
| 991 | 15888 | 17.2ms | unless ( $file{'Version'} ) | ||
| 992 | { | ||||
| 993 | 15561 | 12.9ms | my $path = $onefile->{'sourcepath'}; | ||
| 994 | 15561 | 112ms | 15561 | 49.8ms | if ( $^O =~ /cygwin/i ) { $path = $onefile->{'cyg_sourcepath'}; } # spent 49.8ms making 15561 calls to installer::windows::file::CORE:match, avg 3µs/call |
| 995 | |||||
| 996 | 15561 | 4.18s | 15561 | 4.08s | open(FILE, $path) or die "ERROR: Can't open $path for creating file hash"; # spent 4.08s making 15561 calls to installer::windows::file::CORE:open, avg 262µs/call |
| 997 | 15561 | 86.6ms | 15561 | 31.1ms | binmode(FILE); # spent 31.1ms making 15561 calls to installer::windows::file::CORE:binmode, avg 2µs/call |
| 998 | 15561 | 76.9ms | 15561 | 19.5ms | my $hashinfo = pack("l", 20); # spent 19.5ms making 15561 calls to installer::windows::file::CORE:pack, avg 1µs/call |
| 999 | 15561 | 11.4s | 46683 | 11.1s | $hashinfo .= Digest::MD5->new->addfile(*FILE)->digest; # spent 10.9s making 15561 calls to Digest::MD5::addfile, avg 703µs/call
# spent 78.1ms making 15561 calls to Digest::MD5::new, avg 5µs/call
# spent 48.7ms making 15561 calls to Digest::MD5::digest, avg 3µs/call |
| 1000 | |||||
| 1001 | 15561 | 112ms | 31122 | 72.6ms | my @i = unpack ('x[l]l4', $hashinfo); # spent 38.3ms making 15561 calls to Digest::MD5::DESTROY, avg 2µs/call
# spent 34.3ms making 15561 calls to installer::windows::file::CORE:unpack, avg 2µs/call |
| 1002 | 15561 | 97.7ms | $oneline = $file{'File'} . "\t" . | ||
| 1003 | "0" . "\t" . | ||||
| 1004 | $i[0] . "\t" . | ||||
| 1005 | $i[1] . "\t" . | ||||
| 1006 | $i[2] . "\t" . | ||||
| 1007 | $i[3] . "\n"; | ||||
| 1008 | 15561 | 57.4ms | push (@filehashtable, $oneline); | ||
| 1009 | } | ||||
| 1010 | |||||
| 1011 | # Saving the sequence number in a hash with uniquefilename as key. | ||||
| 1012 | # This is used for better performance in "save_packorder" | ||||
| 1013 | 15888 | 38.4ms | $installer::globals::uniquefilenamesequence{$onefile->{'uniquename'}} = $onefile->{'sequencenumber'}; | ||
| 1014 | |||||
| 1015 | 15888 | 9.23ms | my $destdir = ""; | ||
| 1016 | 15888 | 16.0ms | if ( $onefile->{'Dir'} ) { $destdir = $onefile->{'Dir'}; } | ||
| 1017 | |||||
| 1018 | 15888 | 81.8ms | if ( $onefile->{'needs_user_registry_key'} ) | ||
| 1019 | { | ||||
| 1020 | 8 | 30µs | 8 | 146µs | my $keypath = generate_registry_keypath($onefile); # spent 146µs making 8 calls to installer::windows::file::generate_registry_keypath, avg 18µs/call |
| 1021 | 8 | 13µs | $onefile->{'userregkeypath'} = $keypath; | ||
| 1022 | 8 | 8µs | push(@installer::globals::userregistrycollector, $onefile); | ||
| 1023 | 8 | 7µs | $installer::globals::addeduserregitrykeys = 1; | ||
| 1024 | } | ||||
| 1025 | } | ||||
| 1026 | |||||
| 1027 | # putting content from %allfilecomponents to $allfilecomponentsref for later usage | ||||
| 1028 | 9016 | 14.4ms | foreach $localkey (keys %allfilecomponents ) { push( @{$allfilecomponentsref}, $localkey); } | ||
| 1029 | |||||
| 1030 | 1 | 5µs | my $filetablename = $basedir . $installer::globals::separator . "File.idt"; | ||
| 1031 | 1 | 12µs | 1 | 9.63ms | installer::files::save_file($filetablename ,\@filetable); # spent 9.63ms making 1 call to installer::files::save_file |
| 1032 | 1 | 6µs | $infoline = "\nCreated idt file: $filetablename\n"; | ||
| 1033 | 1 | 4µs | push(@installer::globals::logfileinfo, $infoline); | ||
| 1034 | |||||
| 1035 | 1 | 10µs | 1 | 213µs | installer::logger::include_timestamp_into_logfile("Performance Info: File Table end"); # spent 213µs making 1 call to installer::logger::include_timestamp_into_logfile |
| 1036 | |||||
| 1037 | 1 | 4µs | my $filehashtablename = $basedir . $installer::globals::separator . "MsiFileHash.idt"; | ||
| 1038 | 1 | 5µs | 1 | 7.12ms | installer::files::save_file($filehashtablename ,\@filehashtable); # spent 7.12ms making 1 call to installer::files::save_file |
| 1039 | 1 | 8µs | $infoline = "\nCreated idt file: $filehashtablename\n"; | ||
| 1040 | 1 | 4µs | push(@installer::globals::logfileinfo, $infoline); | ||
| 1041 | |||||
| 1042 | # Now the new files can be added to the files collector (only in update packaging processes) | ||||
| 1043 | 1 | 500ns | if ( $installer::globals::newfilesexist ) | ||
| 1044 | { | ||||
| 1045 | foreach my $seq (sort keys %installer::globals::newfilescollector) { push(@allfiles, $installer::globals::newfilescollector{$seq}) } | ||||
| 1046 | } | ||||
| 1047 | |||||
| 1048 | 1 | 26.0ms | return \@allfiles; | ||
| 1049 | } | ||||
| 1050 | |||||
| 1051 | 1 | 8µs | 1; | ||
sub installer::windows::file::CORE:binmode; # opcode | |||||
# spent 13.7ms within installer::windows::file::CORE:close which was called 385 times, avg 36µs/call:
# 385 times (13.7ms+0s) by installer::windows::file::get_fileversion at line 562, avg 36µs/call | |||||
# spent 2.42s within installer::windows::file::CORE:ftfile which was called 15888 times, avg 152µs/call:
# 15888 times (2.42s+0s) by installer::windows::file::get_filesize at line 534, avg 152µs/call | |||||
# spent 1.86s within installer::windows::file::CORE:ftsize which was called 15888 times, avg 117µs/call:
# 15888 times (1.86s+0s) by installer::windows::file::get_filesize at line 534, avg 117µs/call | |||||
# spent 1.54s within installer::windows::file::CORE:match which was called 773459 times, avg 2µs/call:
# 653296 times (1.07s+0s) by installer::windows::file::generate_unique_filename_for_filetable at line 447, avg 2µs/call
# 15888 times (48.9ms+0s) by installer::windows::file::get_fileversion at line 557, avg 3µs/call
# 15888 times (15.9ms+0s) by installer::windows::file::create_files_table at line 923, avg 1000ns/call
# 15888 times (14.4ms+0s) by installer::windows::file::get_file_component_name at line 221, avg 903ns/call
# 15888 times (10.5ms+0s) by installer::windows::file::create_files_table at line 905, avg 662ns/call
# 15888 times (10.2ms+0s) by installer::windows::file::assign_cab_to_files at line 58, avg 641ns/call
# 15888 times (9.54ms+0s) by installer::windows::file::create_files_table at line 956, avg 600ns/call
# 15561 times (49.8ms+0s) by installer::windows::file::create_files_table at line 994, avg 3µs/call
# 8888 times (8.86ms+0s) by installer::windows::file::get_language_for_file at line 673, avg 997ns/call
# 385 times (306ms+0s) by installer::windows::file::get_fileversion at line 566, avg 794µs/call
# once (7µs+0s) by installer::windows::file::create_files_table at line 866 | |||||
# spent 4.17s within installer::windows::file::CORE:open which was called 15946 times, avg 261µs/call:
# 15561 times (4.08s+0s) by installer::windows::file::create_files_table at line 996, avg 262µs/call
# 385 times (81.4ms+0s) by installer::windows::file::get_fileversion at line 559, avg 212µs/call | |||||
# spent 19.5ms within installer::windows::file::CORE:pack which was called 15561 times, avg 1µs/call:
# 15561 times (19.5ms+0s) by installer::windows::file::create_files_table at line 998, avg 1µs/call | |||||
# spent 4.81s within installer::windows::file::CORE:readline which was called 385 times, avg 12.5ms/call:
# 385 times (4.81s+0s) by installer::windows::file::get_fileversion at line 561, avg 12.5ms/call | |||||
# spent 492µs within installer::windows::file::CORE:regcomp which was called 385 times, avg 1µs/call:
# 385 times (492µs+0s) by installer::windows::file::get_fileversion at line 566, avg 1µs/call | |||||
# spent 24.4ms within installer::windows::file::CORE:sort which was called 851 times, avg 29µs/call:
# 846 times (20.4ms+0s) by installer::windows::file::assign_sequencenumbers_to_files at line 164, avg 24µs/call
# once (804µs+0s) by installer::windows::file::assign_cab_to_files at line 88
# once (799µs+0s) by installer::windows::file::assign_cab_to_files at line 79
# once (795µs+0s) by installer::windows::file::assign_sequencenumbers_to_files at line 160
# once (794µs+0s) by installer::windows::file::assign_cab_to_files at line 111
# once (791µs+0s) by installer::windows::file::assign_cab_to_files at line 101 | |||||
# spent 2.24s within installer::windows::file::CORE:subst which was called 791014 times, avg 3µs/call:
# 599004 times (1.76s+0s) by installer::windows::file::generate_unique_filename_for_filetable at line 450, avg 3µs/call
# 15888 times (24.0ms+0s) by installer::windows::file::generate_unique_filename_for_filetable at line 417, avg 2µs/call
# 15888 times (17.4ms+0s) by installer::windows::file::generate_unique_filename_for_filetable at line 420, avg 1µs/call
# 15888 times (14.0ms+0s) by installer::windows::file::generate_unique_filename_for_filetable at line 421, avg 882ns/call
# 15888 times (8.24ms+0s) by installer::windows::file::generate_unique_filename_for_filetable at line 422, avg 518ns/call
# 15888 times (8.06ms+0s) by installer::windows::file::generate_unique_filename_for_filetable at line 418, avg 507ns/call
# 15888 times (8.06ms+0s) by installer::windows::file::generate_unique_filename_for_filetable at line 419, avg 507ns/call
# 15883 times (124ms+0s) by installer::windows::file::get_file_component_name at line 246, avg 8µs/call
# 15883 times (82.5ms+0s) by installer::windows::file::get_file_component_name at line 244, avg 5µs/call
# 15883 times (78.4ms+0s) by installer::windows::file::get_file_component_name at line 247, avg 5µs/call
# 15883 times (69.8ms+0s) by installer::windows::file::get_file_component_name at line 263, avg 4µs/call
# 15883 times (35.4ms+0s) by installer::windows::file::get_file_component_name at line 262, avg 2µs/call
# 15883 times (11.8ms+0s) by installer::windows::file::get_file_component_name at line 245, avg 743ns/call
# 688 times (2.91ms+0s) by installer::windows::file::create_files_table at line 930, avg 4µs/call
# 688 times (1.62ms+0s) by installer::windows::file::create_files_table at line 931, avg 2µs/call
# 8 times (43µs+0s) by installer::windows::file::generate_registry_keypath at line 692, avg 5µs/call | |||||
sub installer::windows::file::CORE:unpack; # opcode |