Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm |
Statements | Executed 2673947550 statements in 6494s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
58752 | 3 | 2 | 3373s | 4070s | get_language_block_from_language_file | installer::windows::idtglobal::
105730 | 3 | 1 | 2196s | 2196s | get_next_free_number | installer::windows::idtglobal::
485110314 | 7 | 1 | 385s | 385s | CORE:regcomp (opcode) | installer::windows::idtglobal::
492176334 | 23 | 1 | 321s | 321s | CORE:match (opcode) | installer::windows::idtglobal::
4360 | 1 | 1 | 115s | 115s | set_custom_action | installer::windows::idtglobal::
109 | 1 | 1 | 29.1s | 65.0s | setencoding | installer::windows::idtglobal::
58752 | 3 | 2 | 24.0s | 29.1s | get_language_string_from_language_block | installer::windows::idtglobal::
3706 | 1 | 1 | 12.5s | 12.8s | add_custom_action_to_install_table | installer::windows::idtglobal::
375961 | 6 | 4 | 10.7s | 13.5s | shorten_feature_gid | installer::windows::idtglobal::
9988397 | 43 | 1 | 7.65s | 7.65s | CORE:subst (opcode) | installer::windows::idtglobal::
14217 | 6 | 1 | 6.78s | 6.78s | get_next_free_number_with_hash | installer::windows::idtglobal::
872 | 1 | 1 | 5.04s | 4106s | translate_idtfile | installer::windows::idtglobal::
202522 | 4 | 2 | 4.44s | 2201s | make_eight_three_conform | installer::windows::idtglobal::
2943 | 1 | 1 | 1.02s | 1.34s | get_customaction_position | installer::windows::idtglobal::
15888 | 1 | 1 | 610ms | 7.57s | make_eight_three_conform_with_hash | installer::windows::idtglobal::
4251 | 4 | 1 | 461ms | 716ms | fill_assignment_hash | installer::windows::idtglobal::
109 | 1 | 1 | 447ms | 132s | addcustomactions | installer::windows::idtglobal::
327 | 3 | 1 | 423ms | 2.04s | set_positions_in_table | installer::windows::idtglobal::
109 | 1 | 1 | 164ms | 358ms | set_multilanguageonly_condition | installer::windows::idtglobal::
327 | 1 | 1 | 129ms | 170ms | get_last_position_in_sequencetable | installer::windows::idtglobal::
4251 | 1 | 1 | 121ms | 923ms | create_customaction_assignment_hash | installer::windows::idtglobal::
109 | 1 | 1 | 31.7ms | 26.6s | prepare_language_idt_directory | installer::windows::idtglobal::
218 | 2 | 1 | 27.0ms | 27.0ms | CORE:ftdir (opcode) | installer::windows::idtglobal::
4 | 1 | 1 | 25.8ms | 43.9ms | setbidiattributes | installer::windows::idtglobal::
872 | 1 | 1 | 16.7ms | 22.6ms | get_languagefilename | installer::windows::idtglobal::
449 | 17 | 14 | 12.4ms | 12.4ms | write_idt_header | installer::windows::idtglobal::
545 | 1 | 1 | 10.5ms | 20.3ms | connect_custom_action_to_control | installer::windows::idtglobal::
218 | 2 | 1 | 9.35ms | 9.35ms | CORE:sort (opcode) | installer::windows::idtglobal::
1 | 1 | 1 | 417µs | 516µs | BEGIN@30 | installer::windows::idtglobal::
1 | 1 | 1 | 19µs | 21µs | BEGIN@34 | installer::windows::idtglobal::
1 | 1 | 1 | 18µs | 20µs | BEGIN@37 | installer::windows::idtglobal::
1 | 1 | 1 | 17µs | 20µs | BEGIN@31 | installer::windows::idtglobal::
1 | 1 | 1 | 17µs | 19µs | BEGIN@36 | installer::windows::idtglobal::
1 | 1 | 1 | 17µs | 19µs | BEGIN@39 | installer::windows::idtglobal::
1 | 1 | 1 | 15µs | 18µs | BEGIN@35 | installer::windows::idtglobal::
1 | 1 | 1 | 15µs | 17µs | BEGIN@38 | installer::windows::idtglobal::
1 | 1 | 1 | 14µs | 16µs | BEGIN@32 | installer::windows::idtglobal::
1 | 1 | 1 | 13µs | 15µs | BEGIN@33 | installer::windows::idtglobal::
0 | 0 | 0 | 0s | 0s | add_licensefile_to_database | installer::windows::idtglobal::
0 | 0 | 0 | 0s | 0s | connect_condition_to_control | installer::windows::idtglobal::
0 | 0 | 0 | 0s | 0s | get_code_from_code_block | installer::windows::idtglobal::
0 | 0 | 0 | 0s | 0s | get_free_number_in_uisequence_table | installer::windows::idtglobal::
0 | 0 | 0 | 0s | 0s | get_position_in_sequencetable | installer::windows::idtglobal::
0 | 0 | 0 | 0s | 0s | get_rtflicensefilesource | installer::windows::idtglobal::
0 | 0 | 0 | 0s | 0s | include_subdir_into_componenttable | installer::windows::idtglobal::
0 | 0 | 0 | 0s | 0s | include_subdirname_into_directory_table | installer::windows::idtglobal::
0 | 0 | 0 | 0s | 0s | make_string_licensetext | installer::windows::idtglobal::
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::idtglobal; | ||||
29 | |||||
30 | 2 | 64µs | 2 | 615µs | # spent 516µs (417+99) within installer::windows::idtglobal::BEGIN@30 which was called:
# once (417µs+99µs) by installer::windows::assembly::BEGIN@33 at line 30 # spent 516µs making 1 call to installer::windows::idtglobal::BEGIN@30
# spent 99µs making 1 call to Exporter::import |
31 | 2 | 56µs | 2 | 23µs | # spent 20µs (17+3) within installer::windows::idtglobal::BEGIN@31 which was called:
# once (17µs+3µs) by installer::windows::assembly::BEGIN@33 at line 31 # spent 20µs making 1 call to installer::windows::idtglobal::BEGIN@31
# spent 3µs making 1 call to UNIVERSAL::import |
32 | 2 | 53µs | 2 | 18µs | # spent 16µs (14+2) within installer::windows::idtglobal::BEGIN@32 which was called:
# once (14µs+2µs) by installer::windows::assembly::BEGIN@33 at line 32 # spent 16µs making 1 call to installer::windows::idtglobal::BEGIN@32
# spent 2µs making 1 call to UNIVERSAL::import |
33 | 2 | 54µs | 2 | 17µs | # spent 15µs (13+2) within installer::windows::idtglobal::BEGIN@33 which was called:
# once (13µs+2µs) by installer::windows::assembly::BEGIN@33 at line 33 # spent 15µs making 1 call to installer::windows::idtglobal::BEGIN@33
# spent 2µs making 1 call to UNIVERSAL::import |
34 | 2 | 53µs | 2 | 23µs | # spent 21µs (19+2) within installer::windows::idtglobal::BEGIN@34 which was called:
# once (19µs+2µs) by installer::windows::assembly::BEGIN@33 at line 34 # spent 21µs making 1 call to installer::windows::idtglobal::BEGIN@34
# spent 2µs making 1 call to UNIVERSAL::import |
35 | 2 | 53µs | 2 | 20µs | # spent 18µs (15+3) within installer::windows::idtglobal::BEGIN@35 which was called:
# once (15µs+3µs) by installer::windows::assembly::BEGIN@33 at line 35 # spent 18µs making 1 call to installer::windows::idtglobal::BEGIN@35
# spent 2µs making 1 call to UNIVERSAL::import |
36 | 2 | 55µs | 2 | 21µs | # spent 19µs (17+2) within installer::windows::idtglobal::BEGIN@36 which was called:
# once (17µs+2µs) by installer::windows::assembly::BEGIN@33 at line 36 # spent 19µs making 1 call to installer::windows::idtglobal::BEGIN@36
# spent 2µs making 1 call to UNIVERSAL::import |
37 | 2 | 58µs | 2 | 22µs | # spent 20µs (18+2) within installer::windows::idtglobal::BEGIN@37 which was called:
# once (18µs+2µs) by installer::windows::assembly::BEGIN@33 at line 37 # spent 20µs making 1 call to installer::windows::idtglobal::BEGIN@37
# spent 2µs making 1 call to UNIVERSAL::import |
38 | 2 | 52µs | 2 | 20µs | # spent 17µs (15+3) within installer::windows::idtglobal::BEGIN@38 which was called:
# once (15µs+3µs) by installer::windows::assembly::BEGIN@33 at line 38 # spent 17µs making 1 call to installer::windows::idtglobal::BEGIN@38
# spent 3µs making 1 call to UNIVERSAL::import |
39 | 2 | 16.9ms | 2 | 21µs | # spent 19µs (17+2) within installer::windows::idtglobal::BEGIN@39 which was called:
# once (17µs+2µs) by installer::windows::assembly::BEGIN@33 at line 39 # spent 19µs making 1 call to installer::windows::idtglobal::BEGIN@39
# spent 2µs making 1 call to UNIVERSAL::import |
40 | |||||
41 | ############################################################## | ||||
42 | # Shorten the gid for a feature. | ||||
43 | # Attention: Maximum length is 38 | ||||
44 | ############################################################## | ||||
45 | |||||
46 | sub shorten_feature_gid | ||||
47 | # spent 13.5s (10.7+2.72) within installer::windows::idtglobal::shorten_feature_gid which was called 375961 times, avg 36µs/call:
# 169277 times (4.86s+1.20s) by installer::windows::feature::get_feature_gid at line 51 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/feature.pm, avg 36µs/call
# 169277 times (4.73s+1.22s) by installer::windows::feature::get_feature_parent at line 76 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/feature.pm, avg 35µs/call
# 17801 times (520ms+139ms) by installer::windows::featurecomponent::create_featurecomponent_table_from_registry_collector at line 120 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/featurecomponent.pm, avg 37µs/call
# 15890 times (457ms+110ms) by installer::windows::featurecomponent::create_featurecomponent_table_from_files_collector at line 74 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/featurecomponent.pm, avg 36µs/call
# 3706 times (164ms+59.8ms) by installer::windows::idtglobal::add_custom_action_to_install_table at line 1135, avg 60µs/call
# 10 times (291µs+94µs) by installer::windows::assembly::get_msiassembly_feature at line 53 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/assembly.pm, avg 38µs/call | ||||
48 | 375961 | 239ms | my ($stringref) = @_; | ||
49 | |||||
50 | 375961 | 2.28s | 375961 | 928ms | $$stringref =~ s/gid_Module_/gm_/; # spent 928ms making 375961 calls to installer::windows::idtglobal::CORE:subst, avg 2µs/call |
51 | 375961 | 1.29s | 375961 | 208ms | $$stringref =~ s/_Extension_/_ex_/; # spent 208ms making 375961 calls to installer::windows::idtglobal::CORE:subst, avg 554ns/call |
52 | 375961 | 1.48s | 375961 | 402ms | $$stringref =~ s/_Root_/_r_/; # spent 402ms making 375961 calls to installer::windows::idtglobal::CORE:subst, avg 1µs/call |
53 | 375961 | 1.28s | 375961 | 225ms | $$stringref =~ s/_Prg_/_p_/; # spent 225ms making 375961 calls to installer::windows::idtglobal::CORE:subst, avg 599ns/call |
54 | 375961 | 1.25s | 375961 | 204ms | $$stringref =~ s/_Optional_/_o_/; # spent 204ms making 375961 calls to installer::windows::idtglobal::CORE:subst, avg 541ns/call |
55 | 375961 | 1.24s | 375961 | 193ms | $$stringref =~ s/_Tools_/_tl_/; # spent 193ms making 375961 calls to installer::windows::idtglobal::CORE:subst, avg 513ns/call |
56 | 375961 | 1.24s | 375961 | 187ms | $$stringref =~ s/_Wrt_Flt_/_w_f_/; # spent 187ms making 375961 calls to installer::windows::idtglobal::CORE:subst, avg 498ns/call |
57 | 375961 | 1.24s | 375961 | 192ms | $$stringref =~ s/_Javafilter_/_jf_/; # spent 192ms making 375961 calls to installer::windows::idtglobal::CORE:subst, avg 512ns/call |
58 | 375961 | 2.59s | 375961 | 183ms | $$stringref =~ s/_Productivity_/_pr_/; # spent 183ms making 375961 calls to installer::windows::idtglobal::CORE:subst, avg 487ns/call |
59 | } | ||||
60 | |||||
61 | ############################################ | ||||
62 | # Getting the next free number, that | ||||
63 | # can be added. | ||||
64 | # Sample: 01-44-~1.DAT, 01-44-~2.DAT, ... | ||||
65 | ############################################ | ||||
66 | |||||
67 | sub get_next_free_number | ||||
68 | # spent 2196s within installer::windows::idtglobal::get_next_free_number which was called 105730 times, avg 20.8ms/call:
# 45889 times (61.9s+0s) by installer::windows::idtglobal::make_eight_three_conform at line 224, avg 1.35ms/call
# 35643 times (701s+0s) by installer::windows::idtglobal::make_eight_three_conform at line 233, avg 19.7ms/call
# 24198 times (1433s+0s) by installer::windows::idtglobal::make_eight_three_conform at line 240, avg 59.2ms/call | ||||
69 | 105730 | 129ms | my ($name, $shortnamesref) = @_; | ||
70 | |||||
71 | 105730 | 48.6ms | my $counter = 0; | ||
72 | 105730 | 40.2ms | my $dontsave = 0; | ||
73 | 105730 | 36.7ms | my $alreadyexists; | ||
74 | 105730 | 47.5ms | my ($newname, $shortname); | ||
75 | |||||
76 | do | ||||
77 | 105730 | 5.81s | { | ||
78 | 6044268 | 2.16s | $alreadyexists = 0; | ||
79 | 6044268 | 2.41s | $counter++; | ||
80 | 6044268 | 3.88s | $newname = $name . $counter; | ||
81 | |||||
82 | 6044268 | 1081s | for ( my $i = 0; $i <= $#{$shortnamesref}; $i++ ) | ||
83 | { | ||||
84 | 1004218090 | 544s | $shortname = ${$shortnamesref}[$i]; | ||
85 | |||||
86 | 1004218090 | 550s | if ( uc($shortname) eq uc($newname) ) # case insensitive | ||
87 | { | ||||
88 | 5938538 | 2.38s | $alreadyexists = 1; | ||
89 | 5938538 | 3.17s | last; | ||
90 | } | ||||
91 | } | ||||
92 | } | ||||
93 | until (!($alreadyexists)); | ||||
94 | |||||
95 | 105730 | 94.5ms | if (( $counter > 9 ) && ( length($name) > 6 )) { $dontsave = 1; } | ||
96 | 105730 | 55.1ms | if (( $counter > 99 ) && ( length($name) > 5 )) { $dontsave = 1; } | ||
97 | |||||
98 | 105730 | 137ms | if (!($dontsave)) | ||
99 | { | ||||
100 | push(@{$shortnamesref}, $newname); # adding the new shortname to the array of shortnames | ||||
101 | } | ||||
102 | |||||
103 | 105730 | 968ms | return $counter | ||
104 | } | ||||
105 | |||||
106 | ############################################ | ||||
107 | # Getting the next free number, that | ||||
108 | # can be added. | ||||
109 | # Sample: 01-44-~1.DAT, 01-44-~2.DAT, ... | ||||
110 | ############################################ | ||||
111 | |||||
112 | sub get_next_free_number_with_hash | ||||
113 | # spent 6.78s within installer::windows::idtglobal::get_next_free_number_with_hash which was called 14217 times, avg 477µs/call:
# 6229 times (237ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 303, avg 38µs/call
# 4612 times (1.23s+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 312, avg 267µs/call
# 2496 times (5.11s+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 321, avg 2.05ms/call
# 337 times (15.1ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 350, avg 45µs/call
# 321 times (95.1ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 359, avg 296µs/call
# 222 times (84.2ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 368, avg 379µs/call | ||||
114 | 14217 | 17.0ms | my ($name, $shortnamesref, $ext) = @_; | ||
115 | |||||
116 | 14217 | 6.30ms | my $counter = 0; | ||
117 | 14217 | 5.28ms | my $dontsave = 0; | ||
118 | 14217 | 5.14ms | my $saved = 0; | ||
119 | 14217 | 5.07ms | my $alreadyexists; | ||
120 | 14217 | 6.64ms | my ($newname, $shortname); | ||
121 | |||||
122 | do | ||||
123 | 14217 | 1.77s | { | ||
124 | 1958319 | 703ms | $alreadyexists = 0; | ||
125 | 1958319 | 690ms | $counter++; | ||
126 | 1958319 | 1.17s | $newname = $name . $counter; | ||
127 | 1958319 | 943ms | $newname = uc($newname); # case insensitive, always upper case | ||
128 | 1958319 | 1.36s | if ( exists($shortnamesref->{$newname}) || | ||
129 | exists($installer::globals::savedrev83mapping{$newname.$ext}) ) | ||||
130 | { | ||||
131 | $alreadyexists = 1; | ||||
132 | } | ||||
133 | } | ||||
134 | until (!($alreadyexists)); | ||||
135 | |||||
136 | 14217 | 9.74ms | if (( $counter > 9 ) && ( length($name) > 6 )) { $dontsave = 1; } | ||
137 | 14217 | 6.60ms | if (( $counter > 99 ) && ( length($name) > 5 )) { $dontsave = 1; } | ||
138 | |||||
139 | 14217 | 8.02ms | if (!($dontsave)) | ||
140 | { | ||||
141 | 6566 | 12.8ms | $shortnamesref->{$newname} = 1; # adding the new shortname to the array of shortnames, always uppercase | ||
142 | 6566 | 3.09ms | $saved = 1; | ||
143 | } | ||||
144 | |||||
145 | 14217 | 83.4ms | return ( $counter, $saved ) | ||
146 | } | ||||
147 | |||||
148 | ######################################### | ||||
149 | # 8.3 for filenames and directories | ||||
150 | ######################################### | ||||
151 | |||||
152 | sub make_eight_three_conform | ||||
153 | # spent 2201s (4.44+2197) within installer::windows::idtglobal::make_eight_three_conform which was called 202522 times, avg 10.9ms/call:
# 201432 times (4.41s+2197s) by installer::windows::directory::create_defaultdir_directorynames at line 345 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/directory.pm, avg 10.9ms/call
# 872 times (22.7ms+53.1ms) by installer::windows::shortcut::get_shortcut_name at line 102 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/shortcut.pm, avg 87µs/call
# 109 times (3.97ms+3.76ms) by installer::windows::directory::add_root_directories at line 441 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/directory.pm, avg 71µs/call
# 109 times (3.05ms+2.11ms) by installer::windows::directory::add_root_directories at line 489 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/directory.pm, avg 47µs/call | ||||
154 | 202522 | 217ms | my ($inputstring, $pattern, $shortnamesref) = @_; | ||
155 | |||||
156 | # all shortnames are collected in $shortnamesref, because of uniqueness | ||||
157 | |||||
158 | 202522 | 98.9ms | my ($name, $namelength, $number); | ||
159 | 202522 | 92.3ms | my $conformstring = ""; | ||
160 | 202522 | 81.3ms | my $changed = 0; | ||
161 | |||||
162 | 202522 | 1.10s | 202522 | 278ms | if (( $inputstring =~ /^\s*(.*?)\.(.*?)\s*$/ ) && ( $pattern eq "file" )) # files with a dot # spent 278ms making 202522 calls to installer::windows::idtglobal::CORE:match, avg 1µs/call |
163 | { | ||||
164 | $name = $1; | ||||
165 | my $extension = $2; | ||||
166 | |||||
167 | $namelength = length($name); | ||||
168 | my $extensionlength = length($extension); | ||||
169 | |||||
170 | if ( $extensionlength > 3 ) | ||||
171 | { | ||||
172 | # simply taking the first three letters | ||||
173 | $extension = substr($extension, 0, 3); # name, offset, length | ||||
174 | } | ||||
175 | |||||
176 | # Attention: readme.html -> README~1.HTM | ||||
177 | |||||
178 | if (( $namelength > 8 ) || ( $extensionlength > 3 )) | ||||
179 | { | ||||
180 | # taking the first six letters | ||||
181 | $name = substr($name, 0, 6); # name, offset, length | ||||
182 | $name =~ s/\s*$//; # removing ending whitespaces | ||||
183 | $name = $name . "\~"; | ||||
184 | $number = get_next_free_number($name, $shortnamesref); | ||||
185 | |||||
186 | # if $number>9 the new name would be "abcdef~10.xyz", which is 9+3, and therefore not allowed | ||||
187 | |||||
188 | if ( $number > 9 ) | ||||
189 | { | ||||
190 | $name = substr($name, 0, 5); # name, offset, length | ||||
191 | $name =~ s/\s*$//; # removing ending whitespaces | ||||
192 | $name = $name . "\~"; | ||||
193 | $number = get_next_free_number($name, $shortnamesref); | ||||
194 | |||||
195 | if ( $number > 99 ) | ||||
196 | { | ||||
197 | $name = substr($name, 0, 4); # name, offset, length | ||||
198 | $name =~ s/\s*$//; # removing ending whitespaces | ||||
199 | $name = $name . "\~"; | ||||
200 | $number = get_next_free_number($name, $shortnamesref); | ||||
201 | } | ||||
202 | } | ||||
203 | |||||
204 | $name = $name . "$number"; | ||||
205 | |||||
206 | $changed = 1; | ||||
207 | } | ||||
208 | |||||
209 | $conformstring = $name . "\." . $extension; | ||||
210 | |||||
211 | if ( $changed ) { $conformstring= uc($conformstring); } | ||||
212 | } | ||||
213 | else # no dot in filename or directory (also used for shortcuts) | ||||
214 | { | ||||
215 | 202522 | 101ms | $name = $inputstring; | ||
216 | 202522 | 90.1ms | $namelength = length($name); | ||
217 | |||||
218 | 202522 | 124ms | if ( $namelength > 8 ) | ||
219 | { | ||||
220 | # taking the first six letters | ||||
221 | 45889 | 69.5ms | $name = substr($name, 0, 6); # name, offset, length | ||
222 | 45889 | 340ms | 45889 | 167ms | $name =~ s/\s*$//; # removing ending whitespaces # spent 167ms making 45889 calls to installer::windows::idtglobal::CORE:subst, avg 4µs/call |
223 | 45889 | 27.8ms | $name = $name . "\~"; | ||
224 | 45889 | 143ms | 45889 | 61.9s | $number = get_next_free_number($name, $shortnamesref); # spent 61.9s making 45889 calls to installer::windows::idtglobal::get_next_free_number, avg 1.35ms/call |
225 | |||||
226 | # if $number>9 the new name would be "abcdef~10.xyz", which is 9+3, and therefore not allowed | ||||
227 | |||||
228 | 45889 | 44.3ms | if ( $number > 9 ) | ||
229 | { | ||||
230 | 35643 | 40.0ms | $name = substr($name, 0, 5); # name, offset, length | ||
231 | 35643 | 273ms | 35643 | 131ms | $name =~ s/\s*$//; # removing ending whitespaces # spent 131ms making 35643 calls to installer::windows::idtglobal::CORE:subst, avg 4µs/call |
232 | 35643 | 20.1ms | $name = $name . "\~"; | ||
233 | 35643 | 122ms | 35643 | 701s | $number = get_next_free_number($name, $shortnamesref); # spent 701s making 35643 calls to installer::windows::idtglobal::get_next_free_number, avg 19.7ms/call |
234 | |||||
235 | 35643 | 44.3ms | if ( $number > 99 ) | ||
236 | { | ||||
237 | 24198 | 42.1ms | $name = substr($name, 0, 4); # name, offset, length | ||
238 | 24198 | 273ms | 24198 | 151ms | $name =~ s/\s*$//; # removing ending whitespaces # spent 151ms making 24198 calls to installer::windows::idtglobal::CORE:subst, avg 6µs/call |
239 | 24198 | 15.3ms | $name = $name . "\~"; | ||
240 | 24198 | 116ms | 24198 | 1433s | $number = get_next_free_number($name, $shortnamesref); # spent 1433s making 24198 calls to installer::windows::idtglobal::get_next_free_number, avg 59.2ms/call |
241 | } | ||||
242 | } | ||||
243 | |||||
244 | 45889 | 38.5ms | $name = $name . "$number"; | ||
245 | 45889 | 23.9ms | $changed = 1; | ||
246 | 90906 | 418ms | 45017 | 151ms | if ( $pattern eq "dir" ) { $name =~ s/\./\_/g; } # in directories replacing "." with "_" # spent 151ms making 45017 calls to installer::windows::idtglobal::CORE:subst, avg 3µs/call |
247 | } | ||||
248 | |||||
249 | 202522 | 97.8ms | $conformstring = $name; | ||
250 | |||||
251 | 202522 | 105ms | if ( $changed ) { $conformstring = uc($name); } | ||
252 | } | ||||
253 | |||||
254 | 202522 | 1.03s | return $conformstring; | ||
255 | } | ||||
256 | |||||
257 | ######################################### | ||||
258 | # 8.3 for filenames and directories | ||||
259 | # $shortnamesref is a hash in this case | ||||
260 | # -> performance reasons | ||||
261 | ######################################### | ||||
262 | |||||
263 | sub make_eight_three_conform_with_hash | ||||
264 | # spent 7.57s (610ms+6.96) within installer::windows::idtglobal::make_eight_three_conform_with_hash which was called 15888 times, avg 476µs/call:
# 15888 times (610ms+6.96s) by installer::windows::file::generate_filename_for_filetable at line 513 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/file.pm, avg 476µs/call | ||||
265 | 15888 | 19.2ms | my ($inputstring, $pattern, $shortnamesref) = @_; | ||
266 | |||||
267 | # all shortnames are collected in $shortnamesref, because of uniqueness (a hash!) | ||||
268 | |||||
269 | 15888 | 8.43ms | my ($name, $namelength, $number); | ||
270 | 15888 | 8.19ms | my $conformstring = ""; | ||
271 | 15888 | 6.63ms | my $changed = 0; | ||
272 | 15888 | 5.66ms | my $saved; | ||
273 | |||||
274 | 15888 | 135ms | 15888 | 59.7ms | if (( $inputstring =~ /^\s*(.*)\.(.*?)\s*$/ ) && ( $pattern eq "file" )) # files with a dot # spent 59.7ms making 15888 calls to installer::windows::idtglobal::CORE:match, avg 4µs/call |
275 | { | ||||
276 | # extension has to be non-greedy, but name is. This is important to find the last dot in the filename | ||||
277 | 15542 | 20.3ms | $name = $1; | ||
278 | 15542 | 13.9ms | my $extension = $2; | ||
279 | |||||
280 | 15542 | 120ms | 15542 | 53.2ms | if ( $name =~ /^\s*(.*?)\s*$/ ) { $name = $1; } # now the name is also non-greedy # spent 53.2ms making 15542 calls to installer::windows::idtglobal::CORE:match, avg 3µs/call |
281 | 15542 | 75.3ms | 15542 | 21.0ms | $name =~ s/\.//g; # no dots in 8+3 conform filename # spent 21.0ms making 15542 calls to installer::windows::idtglobal::CORE:subst, avg 1µs/call |
282 | |||||
283 | 15542 | 7.57ms | $namelength = length($name); | ||
284 | 15542 | 7.91ms | my $extensionlength = length($extension); | ||
285 | |||||
286 | 15542 | 9.60ms | if ( $extensionlength > 3 ) | ||
287 | { | ||||
288 | # simply taking the first three letters | ||||
289 | 1246 | 1.58ms | $extension = substr($extension, 0, 3); # name, offset, length | ||
290 | 1246 | 684µs | $changed = 1; | ||
291 | } | ||||
292 | |||||
293 | # Attention: readme.html -> README~1.HTM | ||||
294 | |||||
295 | 15542 | 10.9ms | if (( $namelength > 8 ) || ( $extensionlength > 3 )) | ||
296 | { | ||||
297 | # taking the first six letters, if filename is longer than 6 characters | ||||
298 | 6995 | 6.05ms | if ( $namelength > 6 ) | ||
299 | { | ||||
300 | 6229 | 7.94ms | $name = substr($name, 0, 6); # name, offset, length | ||
301 | 6229 | 43.9ms | 6229 | 20.9ms | $name =~ s/\s*$//; # removing ending whitespaces # spent 20.9ms making 6229 calls to installer::windows::idtglobal::CORE:subst, avg 3µs/call |
302 | 6229 | 3.63ms | $name = $name . "\~"; | ||
303 | 6229 | 32.6ms | 6229 | 237ms | ($number, $saved) = get_next_free_number_with_hash($name, $shortnamesref, '.'.uc($extension)); # spent 237ms making 6229 calls to installer::windows::idtglobal::get_next_free_number_with_hash, avg 38µs/call |
304 | |||||
305 | # if $number>9 the new name would be "abcdef~10.xyz", which is 9+3, and therefore not allowed | ||||
306 | |||||
307 | 6229 | 4.79ms | if ( ! $saved ) | ||
308 | { | ||||
309 | 4612 | 4.65ms | $name = substr($name, 0, 5); # name, offset, length | ||
310 | 4612 | 31.8ms | 4612 | 14.5ms | $name =~ s/\s*$//; # removing ending whitespaces # spent 14.5ms making 4612 calls to installer::windows::idtglobal::CORE:subst, avg 3µs/call |
311 | 4612 | 2.58ms | $name = $name . "\~"; | ||
312 | 4612 | 20.7ms | 4612 | 1.23s | ($number, $saved) = get_next_free_number_with_hash($name, $shortnamesref, '.'.uc($extension)); # spent 1.23s making 4612 calls to installer::windows::idtglobal::get_next_free_number_with_hash, avg 267µs/call |
313 | |||||
314 | # if $number>99 the new name would be "abcde~100.xyz", which is 9+3, and therefore not allowed | ||||
315 | |||||
316 | 4612 | 4.18ms | if ( ! $saved ) | ||
317 | { | ||||
318 | 2496 | 2.56ms | $name = substr($name, 0, 4); # name, offset, length | ||
319 | 2496 | 17.0ms | 2496 | 7.58ms | $name =~ s/\s*$//; # removing ending whitespaces # spent 7.58ms making 2496 calls to installer::windows::idtglobal::CORE:subst, avg 3µs/call |
320 | 2496 | 1.35ms | $name = $name . "\~"; | ||
321 | 2496 | 11.7ms | 2496 | 5.11s | ($number, $saved) = get_next_free_number_with_hash($name, $shortnamesref, '.'.uc($extension)); # spent 5.11s making 2496 calls to installer::windows::idtglobal::get_next_free_number_with_hash, avg 2.05ms/call |
322 | |||||
323 | 2496 | 1.70ms | if ( ! $saved ) | ||
324 | { | ||||
325 | installer::exiter::exit_program("ERROR: Could not set 8+3 conform name for $inputstring !", "make_eight_three_conform_with_hash"); | ||||
326 | } | ||||
327 | } | ||||
328 | } | ||||
329 | |||||
330 | 6229 | 4.46ms | $name = $name . "$number"; | ||
331 | 6229 | 3.83ms | $changed = 1; | ||
332 | } | ||||
333 | } | ||||
334 | |||||
335 | 15542 | 14.5ms | $conformstring = $name . "\." . $extension; | ||
336 | |||||
337 | 15542 | 12.5ms | if ( $changed ) { $conformstring= uc($conformstring); } | ||
338 | } | ||||
339 | else # no dot in filename or directory (also used for shortcuts) | ||||
340 | { | ||||
341 | 346 | 196µs | $name = $inputstring; | ||
342 | 346 | 201µs | $namelength = length($name); | ||
343 | |||||
344 | 346 | 470µs | if ( $namelength > 8 ) | ||
345 | { | ||||
346 | # taking the first six letters | ||||
347 | 337 | 655µs | $name = substr($name, 0, 6); # name, offset, length | ||
348 | 337 | 3.13ms | 337 | 1.50ms | $name =~ s/\s*$//; # removing ending whitespaces # spent 1.50ms making 337 calls to installer::windows::idtglobal::CORE:subst, avg 4µs/call |
349 | 337 | 214µs | $name = $name . "\~"; | ||
350 | 337 | 1.79ms | 337 | 15.1ms | ( $number, $saved ) = get_next_free_number_with_hash($name, $shortnamesref, ''); # spent 15.1ms making 337 calls to installer::windows::idtglobal::get_next_free_number_with_hash, avg 45µs/call |
351 | |||||
352 | # if $number>9 the new name would be "abcdef~10", which is 9+0, and therefore not allowed | ||||
353 | |||||
354 | 337 | 337µs | if ( ! $saved ) | ||
355 | { | ||||
356 | 321 | 414µs | $name = substr($name, 0, 5); # name, offset, length | ||
357 | 321 | 2.54ms | 321 | 1.18ms | $name =~ s/\s*$//; # removing ending whitespaces # spent 1.18ms making 321 calls to installer::windows::idtglobal::CORE:subst, avg 4µs/call |
358 | 321 | 218µs | $name = $name . "\~"; | ||
359 | 321 | 1.44ms | 321 | 95.1ms | ( $number, $saved ) = get_next_free_number_with_hash($name, $shortnamesref, ''); # spent 95.1ms making 321 calls to installer::windows::idtglobal::get_next_free_number_with_hash, avg 296µs/call |
360 | |||||
361 | # if $number>99 the new name would be "abcde~100", which is 9+0, and therefore not allowed | ||||
362 | |||||
363 | 321 | 379µs | if ( ! $saved ) | ||
364 | { | ||||
365 | 222 | 299µs | $name = substr($name, 0, 4); # name, offset, length | ||
366 | 222 | 1.76ms | 222 | 795µs | $name =~ s/\s*$//; # removing ending whitespaces # spent 795µs making 222 calls to installer::windows::idtglobal::CORE:subst, avg 4µs/call |
367 | 222 | 156µs | $name = $name . "\~"; | ||
368 | 222 | 974µs | 222 | 84.2ms | ( $number, $saved ) = get_next_free_number_with_hash($name, $shortnamesref, ''); # spent 84.2ms making 222 calls to installer::windows::idtglobal::get_next_free_number_with_hash, avg 379µs/call |
369 | |||||
370 | 222 | 168µs | if ( ! $saved ) { installer::exiter::exit_program("ERROR: Could not set 8+3 conform name for $inputstring !", "make_eight_three_conform_with_hash"); } | ||
371 | } | ||||
372 | } | ||||
373 | |||||
374 | 337 | 328µs | $name = $name . "$number"; | ||
375 | 337 | 228µs | $changed = 1; | ||
376 | 337 | 280µs | if ( $pattern eq "dir" ) { $name =~ s/\./\_/g; } # in directories replacing "." with "_" | ||
377 | } | ||||
378 | |||||
379 | 346 | 187µs | $conformstring = $name; | ||
380 | |||||
381 | 346 | 318µs | if ( $changed ) { $conformstring = uc($name); } | ||
382 | } | ||||
383 | |||||
384 | 15888 | 80.9ms | return $conformstring; | ||
385 | } | ||||
386 | |||||
387 | ######################################### | ||||
388 | # Writing the header for idt files | ||||
389 | ######################################### | ||||
390 | |||||
391 | sub write_idt_header | ||||
392 | # spent 12.4ms within installer::windows::idtglobal::write_idt_header which was called 449 times, avg 28µs/call:
# 109 times (3.63ms+0s) by installer::windows::directory::create_directory_table at line 536 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/directory.pm, avg 33µs/call
# 109 times (3.11ms+0s) by installer::windows::feature::create_feature_table at line 378 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/feature.pm, avg 29µs/call
# 109 times (3.08ms+0s) by installer::windows::registry::create_registry_table at line 356 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/registry.pm, avg 28µs/call
# 109 times (2.30ms+0s) by installer::windows::shortcut::create_shortcut_table at line 546 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/shortcut.pm, avg 21µs/call
# once (32µs+0s) by installer::windows::assembly::create_msiassembly_table at line 162 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/assembly.pm
# once (29µs+0s) by installer::windows::media::create_media_table at line 246 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/media.pm
# once (29µs+0s) by installer::windows::featurecomponent::create_featurecomponent_table at line 146 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/featurecomponent.pm
# once (28µs+0s) by installer::windows::font::create_font_table at line 47 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/font.pm
# once (28µs+0s) by installer::windows::file::create_files_table at line 874 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/file.pm
# once (28µs+0s) by installer::windows::component::create_component_table at line 390 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/component.pm
# once (28µs+0s) by installer::windows::icon::create_icon_table at line 38 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/icon.pm
# once (27µs+0s) by installer::windows::upgrade::create_upgrade_table at line 56 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/upgrade.pm
# once (21µs+0s) by installer::windows::inifile::create_inifile_table at line 105 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/inifile.pm
# once (18µs+0s) by installer::windows::assembly::create_msiassemblyname_table at line 207 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/assembly.pm
# once (18µs+0s) by installer::windows::createfolder::create_createfolder_table at line 122 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/createfolder.pm
# once (17µs+0s) by installer::windows::file::create_files_table at line 875 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/file.pm
# once (16µs+0s) by installer::windows::file::create_files_table at line 876 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/file.pm | ||||
393 | 449 | 959µs | my ($idtref, $definestring) = @_; | ||
394 | |||||
395 | 449 | 216µs | my $oneline; | ||
396 | |||||
397 | 449 | 514µs | if ( $definestring eq "file" ) | ||
398 | { | ||||
399 | 1 | 2µs | $oneline = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"; | ||
400 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
401 | 1 | 600ns | $oneline = "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti4\n"; | ||
402 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
403 | 1 | 1µs | $oneline = "File\tFile\n"; | ||
404 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
405 | } | ||||
406 | |||||
407 | 449 | 378µs | if ( $definestring eq "filehash" ) | ||
408 | { | ||||
409 | 1 | 500ns | $oneline = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n"; | ||
410 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
411 | 1 | 1µs | $oneline = "s72\ti2\ti4\ti4\ti4\ti4\n"; | ||
412 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
413 | 1 | 500ns | $oneline = "MsiFileHash\tFile_\n"; | ||
414 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
415 | } | ||||
416 | |||||
417 | 449 | 327µs | if ( $definestring eq "directory" ) | ||
418 | { | ||||
419 | 109 | 111µs | $oneline = "Directory\tDirectory_Parent\tDefaultDir\n"; | ||
420 | 109 | 251µs | push(@{$idtref}, $oneline); | ||
421 | 109 | 68µs | $oneline = "s72\tS72\tl255\n"; | ||
422 | 109 | 154µs | push(@{$idtref}, $oneline); | ||
423 | 109 | 60µs | $oneline = "Directory\tDirectory\n"; | ||
424 | 109 | 136µs | push(@{$idtref}, $oneline); | ||
425 | } | ||||
426 | |||||
427 | 449 | 288µs | if ( $definestring eq "component" ) | ||
428 | { | ||||
429 | 1 | 1µs | $oneline = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"; | ||
430 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
431 | 1 | 500ns | $oneline = "s72\tS38\ts72\ti2\tS255\tS72\n"; | ||
432 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
433 | 1 | 500ns | $oneline = "Component\tComponent\n"; | ||
434 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
435 | } | ||||
436 | |||||
437 | 449 | 359µs | if ( $definestring eq "feature" ) | ||
438 | { | ||||
439 | 109 | 94µs | $oneline = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"; | ||
440 | 109 | 133µs | push(@{$idtref}, $oneline); | ||
441 | 109 | 59µs | $oneline = "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"; | ||
442 | 109 | 113µs | push(@{$idtref}, $oneline); | ||
443 | 109 | 67µs | $oneline = "WINDOWSENCODINGTEMPLATE\tFeature\tFeature\n"; | ||
444 | 109 | 111µs | push(@{$idtref}, $oneline); | ||
445 | } | ||||
446 | |||||
447 | 449 | 319µs | if ( $definestring eq "featurecomponent" ) | ||
448 | { | ||||
449 | 1 | 1µs | $oneline = "Feature_\tComponent_\n"; | ||
450 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
451 | 1 | 500ns | $oneline = "s38\ts72\n"; | ||
452 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
453 | 1 | 1µs | $oneline = "FeatureComponents\tFeature_\tComponent_\n"; | ||
454 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
455 | } | ||||
456 | |||||
457 | 449 | 290µs | if ( $definestring eq "media" ) | ||
458 | { | ||||
459 | 1 | 1µs | $oneline = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"; | ||
460 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
461 | 1 | 1µs | $oneline = "i2\ti4\tL64\tS255\tS32\tS72\n"; | ||
462 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
463 | 1 | 500ns | $oneline = "Media\tDiskId\n"; | ||
464 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
465 | } | ||||
466 | |||||
467 | 449 | 274µs | if ( $definestring eq "font" ) | ||
468 | { | ||||
469 | 1 | 1µs | $oneline = "File_\tFontTitle\n"; | ||
470 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
471 | 1 | 500ns | $oneline = "s72\tS128\n"; | ||
472 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
473 | 1 | 0s | $oneline = "Font\tFile_\n"; | ||
474 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
475 | } | ||||
476 | |||||
477 | 449 | 368µs | if ( $definestring eq "shortcut" ) | ||
478 | { | ||||
479 | 109 | 83µs | $oneline = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"; | ||
480 | 109 | 132µs | push(@{$idtref}, $oneline); | ||
481 | 109 | 55µs | $oneline = "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n"; | ||
482 | 109 | 105µs | push(@{$idtref}, $oneline); | ||
483 | 109 | 56µs | $oneline = "WINDOWSENCODINGTEMPLATE\tShortcut\tShortcut\n"; | ||
484 | 109 | 108µs | push(@{$idtref}, $oneline); | ||
485 | } | ||||
486 | |||||
487 | 449 | 355µs | if ( $definestring eq "registry" ) | ||
488 | { | ||||
489 | 109 | 78µs | $oneline = "Registry\tRoot\tKey\tName\tValue\tComponent_\n"; | ||
490 | 109 | 153µs | push(@{$idtref}, $oneline); | ||
491 | 109 | 55µs | $oneline = "s72\ti2\tl255\tL255\tL0\ts72\n"; | ||
492 | 109 | 107µs | push(@{$idtref}, $oneline); | ||
493 | 109 | 66µs | $oneline = "Registry\tRegistry\n"; | ||
494 | 109 | 132µs | push(@{$idtref}, $oneline); | ||
495 | } | ||||
496 | |||||
497 | 449 | 274µs | if ( $definestring eq "createfolder" ) | ||
498 | { | ||||
499 | 1 | 500ns | $oneline = "Directory_\tComponent_\n"; | ||
500 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
501 | 1 | 500ns | $oneline = "s72\ts72\n"; | ||
502 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
503 | 1 | 500ns | $oneline = "CreateFolder\tDirectory_\tComponent_\n"; | ||
504 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
505 | } | ||||
506 | |||||
507 | 449 | 348µs | if ( $definestring eq "removefile" ) | ||
508 | { | ||||
509 | 1 | 500ns | $oneline = "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"; | ||
510 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
511 | 1 | 1µs | $oneline = "s72\ts72\tL255\ts72\ti2\n"; | ||
512 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
513 | 1 | 1µs | $oneline = "RemoveFile\tFileKey\n"; | ||
514 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
515 | } | ||||
516 | |||||
517 | 449 | 278µs | if ( $definestring eq "upgrade" ) | ||
518 | { | ||||
519 | 1 | 1µs | $oneline = "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"; | ||
520 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
521 | 1 | 600ns | $oneline = "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"; | ||
522 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
523 | 1 | 500ns | $oneline = "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"; | ||
524 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
525 | } | ||||
526 | |||||
527 | 449 | 290µs | if ( $definestring eq "icon" ) | ||
528 | { | ||||
529 | 1 | 1µs | $oneline = "Name\tData\n"; | ||
530 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
531 | 1 | 500ns | $oneline = "s72\tv0\n"; | ||
532 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
533 | 1 | 500ns | $oneline = "Icon\tName\n"; | ||
534 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
535 | } | ||||
536 | |||||
537 | 449 | 248µs | if ( $definestring eq "inifile" ) | ||
538 | { | ||||
539 | 1 | 500ns | $oneline = "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"; | ||
540 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
541 | 1 | 500ns | $oneline = "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"; | ||
542 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
543 | 1 | 500ns | $oneline = "IniFile\tIniFile\n"; | ||
544 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
545 | } | ||||
546 | |||||
547 | 449 | 288µs | if ( $definestring eq "msiassembly" ) | ||
548 | { | ||||
549 | 1 | 500ns | $oneline = "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"; | ||
550 | 1 | 3µs | push(@{$idtref}, $oneline); | ||
551 | 1 | 600ns | $oneline = "s72\ts38\tS72\tS72\tI2\n"; | ||
552 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
553 | 1 | 500ns | $oneline = "MsiAssembly\tComponent_\n"; | ||
554 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
555 | } | ||||
556 | |||||
557 | 449 | 269µs | if ( $definestring eq "msiassemblyname" ) | ||
558 | { | ||||
559 | 1 | 1µs | $oneline = "Component_\tName\tValue\n"; | ||
560 | 1 | 2µs | push(@{$idtref}, $oneline); | ||
561 | 1 | 1µs | $oneline = "s72\ts255\ts255\n"; | ||
562 | 1 | 500ns | push(@{$idtref}, $oneline); | ||
563 | 1 | 500ns | $oneline = "MsiAssemblyName\tComponent_\tName\n"; | ||
564 | 1 | 1µs | push(@{$idtref}, $oneline); | ||
565 | } | ||||
566 | |||||
567 | 449 | 293µs | if ( $definestring eq "appsearch" ) | ||
568 | { | ||||
569 | $oneline = "Property\tSignature_\n"; | ||||
570 | push(@{$idtref}, $oneline); | ||||
571 | $oneline = "s72\ts72\n"; | ||||
572 | push(@{$idtref}, $oneline); | ||||
573 | $oneline = "AppSearch\tProperty\tSignature_\n"; | ||||
574 | push(@{$idtref}, $oneline); | ||||
575 | } | ||||
576 | |||||
577 | 449 | 267µs | if ( $definestring eq "reglocat" ) | ||
578 | { | ||||
579 | $oneline = "Signature_\tRoot\tKey\tName\tType\n"; | ||||
580 | push(@{$idtref}, $oneline); | ||||
581 | $oneline = "s72\ti2\ts255\tS255\tI2\n"; | ||||
582 | push(@{$idtref}, $oneline); | ||||
583 | $oneline = "RegLocator\tSignature_\n"; | ||||
584 | push(@{$idtref}, $oneline); | ||||
585 | } | ||||
586 | |||||
587 | 449 | 2.93ms | if ( $definestring eq "signatur" ) | ||
588 | { | ||||
589 | $oneline = "Signature\tFileName\tMinVersion\tMaxVersion\tMinSize\tMaxSize\tMinDate\tMaxDate\tLanguages\n"; | ||||
590 | push(@{$idtref}, $oneline); | ||||
591 | $oneline = "s72\ts255\tS20\tS20\tI4\tI4\tI4\tI4\tS255\n"; | ||||
592 | push(@{$idtref}, $oneline); | ||||
593 | $oneline = "Signature\tSignature\n"; | ||||
594 | push(@{$idtref}, $oneline); | ||||
595 | } | ||||
596 | |||||
597 | } | ||||
598 | |||||
599 | ############################################################## | ||||
600 | # Returning the name of the rranslation file for a | ||||
601 | # given language. | ||||
602 | # Sample: "01" oder "en-US" -> "1033.txt" | ||||
603 | ############################################################## | ||||
604 | |||||
605 | sub get_languagefilename | ||||
606 | # spent 22.6ms (16.7+5.95) within installer::windows::idtglobal::get_languagefilename which was called 872 times, avg 26µs/call:
# 872 times (16.7ms+5.95ms) by installer::run at line 1589 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 26µs/call | ||||
607 | 872 | 2.58ms | my ($idtfilename, $basedir) = @_; | ||
608 | |||||
609 | 872 | 12.3ms | 872 | 5.95ms | $idtfilename =~ s/\.idt/\.mlf/; # spent 5.95ms making 872 calls to installer::windows::idtglobal::CORE:subst, avg 7µs/call |
610 | |||||
611 | 872 | 1.72ms | my $languagefilename = $basedir . $installer::globals::separator . $idtfilename; | ||
612 | |||||
613 | 872 | 5.47ms | return $languagefilename; | ||
614 | } | ||||
615 | |||||
616 | ############################################################## | ||||
617 | # Returning the complete block in all languages | ||||
618 | # for a specified string | ||||
619 | ############################################################## | ||||
620 | |||||
621 | sub get_language_block_from_language_file | ||||
622 | # spent 4070s (3373+697) within installer::windows::idtglobal::get_language_block_from_language_file which was called 58752 times, avg 69.3ms/call:
# 58315 times (3372s+697s) by installer::windows::idtglobal::translate_idtfile at line 734, avg 69.8ms/call
# 436 times (779ms+173ms) by installer::windows::msiglobal::get_value_from_sis_lng at line 519 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm, avg 2.18ms/call
# once (296µs+110µs) by installer::windows::msiglobal::set_global_code_variables at line 1470 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm | ||||
623 | 58752 | 85.8ms | my ($searchstring, $languagefile) = @_; | ||
624 | |||||
625 | 58752 | 33.4ms | my @language_block = (); | ||
626 | |||||
627 | 58752 | 562s | for ( my $i = 0; $i <= $#{$languagefile}; $i++ ) | ||
628 | { | ||||
629 | 481707115 | 3467s | 963414230 | 691s | if ( ${$languagefile}[$i] =~ /^\s*\[\s*$searchstring\s*\]\s*$/ ) # spent 380s making 481707115 calls to installer::windows::idtglobal::CORE:regcomp, avg 790ns/call
# spent 310s making 481707115 calls to installer::windows::idtglobal::CORE:match, avg 644ns/call |
630 | { | ||||
631 | 58752 | 72.7ms | my $counter = $i; | ||
632 | |||||
633 | 58752 | 203ms | push(@language_block, ${$languagefile}[$counter]); | ||
634 | 58752 | 25.9ms | $counter++; | ||
635 | |||||
636 | 58752 | 444ms | 58752 | 104ms | while (( $counter <= $#{$languagefile} ) && (!( ${$languagefile}[$counter] =~ /^\s*\[/ ))) # spent 104ms making 58752 calls to installer::windows::idtglobal::CORE:match, avg 2µs/call |
637 | { | ||||
638 | 6522234 | 7.82s | push(@language_block, ${$languagefile}[$counter]); | ||
639 | 6522234 | 32.4s | 6521361 | 6.26s | $counter++; # spent 6.26s making 6521361 calls to installer::windows::idtglobal::CORE:match, avg 959ns/call |
640 | } | ||||
641 | |||||
642 | 58752 | 97.7ms | last; | ||
643 | } | ||||
644 | } | ||||
645 | |||||
646 | 58752 | 438ms | return \@language_block; | ||
647 | } | ||||
648 | |||||
649 | ############################################################## | ||||
650 | # Returning a specific language string from the block | ||||
651 | # of all translations | ||||
652 | ############################################################## | ||||
653 | |||||
654 | sub get_language_string_from_language_block | ||||
655 | # spent 29.1s (24.0+5.06) within installer::windows::idtglobal::get_language_string_from_language_block which was called 58752 times, avg 495µs/call:
# 58315 times (24.0s+5.05s) by installer::windows::idtglobal::translate_idtfile at line 735, avg 498µs/call
# 436 times (14.0ms+6.76ms) by installer::windows::msiglobal::get_value_from_sis_lng at line 520 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm, avg 48µs/call
# once (65µs+48µs) by installer::windows::msiglobal::set_global_code_variables at line 1471 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm | ||||
656 | 58752 | 143ms | my ($language_block, $language, $oldstring) = @_; | ||
657 | |||||
658 | 58752 | 44.4ms | my $newstring = ""; | ||
659 | |||||
660 | 58752 | 3.86s | for ( my $i = 0; $i <= $#{$language_block}; $i++ ) | ||
661 | { | ||||
662 | 3284169 | 24.4s | 6568338 | 5.06s | if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ ) # spent 2.55s making 3284169 calls to installer::windows::idtglobal::CORE:regcomp, avg 777ns/call
# spent 2.50s making 3284169 calls to installer::windows::idtglobal::CORE:match, avg 762ns/call |
663 | { | ||||
664 | 58751 | 171ms | $newstring = $1; | ||
665 | 58751 | 54.3ms | last; | ||
666 | } | ||||
667 | } | ||||
668 | |||||
669 | 58752 | 52.5ms | if ( $newstring eq "" ) | ||
670 | { | ||||
671 | 1 | 1µs | $language = "en-US"; # defaulting to english | ||
672 | |||||
673 | 1 | 3µs | for ( my $i = 0; $i <= $#{$language_block}; $i++ ) | ||
674 | { | ||||
675 | 2 | 44µs | 4 | 24µs | if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ ) # spent 18µs making 2 calls to installer::windows::idtglobal::CORE:regcomp, avg 9µs/call
# spent 6µs making 2 calls to installer::windows::idtglobal::CORE:match, avg 3µs/call |
676 | { | ||||
677 | 1 | 5µs | $newstring = $1; | ||
678 | 1 | 1µs | last; | ||
679 | } | ||||
680 | } | ||||
681 | } | ||||
682 | |||||
683 | 58752 | 362ms | return $newstring; | ||
684 | } | ||||
685 | |||||
686 | ############################################################## | ||||
687 | # Returning a specific code from the block | ||||
688 | # of all codes. No defaulting to english! | ||||
689 | ############################################################## | ||||
690 | |||||
691 | sub get_code_from_code_block | ||||
692 | { | ||||
693 | my ($codeblock, $language) = @_; | ||||
694 | |||||
695 | my $newstring = ""; | ||||
696 | |||||
697 | for ( my $i = 0; $i <= $#{$codeblock}; $i++ ) | ||||
698 | { | ||||
699 | if ( ${$codeblock}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ ) | ||||
700 | { | ||||
701 | $newstring = $1; | ||||
702 | last; | ||||
703 | } | ||||
704 | } | ||||
705 | |||||
706 | return $newstring; | ||||
707 | } | ||||
708 | |||||
709 | ############################################################## | ||||
710 | # Translating an idt file | ||||
711 | ############################################################## | ||||
712 | |||||
713 | sub translate_idtfile | ||||
714 | # spent 4106s (5.04+4101) within installer::windows::idtglobal::translate_idtfile which was called 872 times, avg 4.71s/call:
# 872 times (5.04s+4101s) by installer::run at line 1596 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 4.71s/call | ||||
715 | 872 | 2.28ms | my ($idtfile, $languagefile, $onelanguage) = @_; | ||
716 | |||||
717 | 872 | 167ms | for ( my $i = 0; $i <= $#{$idtfile}; $i++ ) | ||
718 | { | ||||
719 | 72267 | 57.4ms | my @allstrings = (); | ||
720 | |||||
721 | 72267 | 75.7ms | my $oneline = ${$idtfile}[$i]; | ||
722 | |||||
723 | 72267 | 586ms | 72267 | 241ms | while ( $oneline =~ /\b(OOO_\w+)\b/ ) # spent 241ms making 72267 calls to installer::windows::idtglobal::CORE:match, avg 3µs/call |
724 | { | ||||
725 | 58315 | 90.7ms | my $replacestring = $1; | ||
726 | 58315 | 64.9ms | push(@allstrings, $replacestring); | ||
727 | 58315 | 1.56s | 174945 | 910ms | $oneline =~ s/$replacestring//; # spent 714ms making 58315 calls to installer::windows::idtglobal::CORE:regcomp, avg 12µs/call
# spent 145ms making 58315 calls to installer::windows::idtglobal::CORE:subst, avg 2µs/call
# spent 50.5ms making 58315 calls to installer::windows::idtglobal::CORE:match, avg 866ns/call |
728 | } | ||||
729 | |||||
730 | 72267 | 27.5ms | my $oldstring; | ||
731 | |||||
732 | 72267 | 157ms | foreach $oldstring (@allstrings) | ||
733 | { | ||||
734 | 58315 | 219ms | 58315 | 4069s | my $language_block = get_language_block_from_language_file($oldstring, $languagefile); # spent 4069s making 58315 calls to installer::windows::idtglobal::get_language_block_from_language_file, avg 69.8ms/call |
735 | 58315 | 369ms | 58315 | 29.0s | my $newstring = get_language_string_from_language_block($language_block, $onelanguage, $oldstring); # spent 29.0s making 58315 calls to installer::windows::idtglobal::get_language_string_from_language_block, avg 498µs/call |
736 | |||||
737 | 58315 | 4.14s | 116630 | 1.52s | ${$idtfile}[$i] =~ s/$oldstring/$newstring/; # always substitute, even if $newstring eq "" (there are empty strings for control.idt) # spent 1.18s making 58315 calls to installer::windows::idtglobal::CORE:regcomp, avg 20µs/call
# spent 334ms making 58315 calls to installer::windows::idtglobal::CORE:subst, avg 6µs/call |
738 | } | ||||
739 | } | ||||
740 | } | ||||
741 | |||||
742 | ############################################################## | ||||
743 | # Copying all needed files to create a msi database | ||||
744 | # into one language specific directory | ||||
745 | ############################################################## | ||||
746 | |||||
747 | sub prepare_language_idt_directory | ||||
748 | # spent 26.6s (31.7ms+26.6) within installer::windows::idtglobal::prepare_language_idt_directory which was called 109 times, avg 244ms/call:
# 109 times (31.7ms+26.6s) by installer::run at line 1565 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 244ms/call | ||||
749 | 109 | 485µs | my ($destinationdir, $newidtdir, $onelanguage, $filesref, $iconfilecollector, $binarytablefiles, $allvariables) = @_; | ||
750 | |||||
751 | # Copying all idt-files from the source $installer::globals::idttemplatepath to the destination $destinationdir | ||||
752 | # Copying all files in the subdirectory "Binary" | ||||
753 | # Copying all files in the subdirectory "Icon" | ||||
754 | |||||
755 | 109 | 134µs | my $infoline = ""; | ||
756 | |||||
757 | 109 | 537µs | 109 | 7.39s | installer::systemactions::copy_directory($installer::globals::idttemplatepath, $destinationdir); # spent 7.39s making 109 calls to installer::systemactions::copy_directory, avg 67.8ms/call |
758 | |||||
759 | 109 | 9.23ms | 109 | 8.17ms | if ( -d $installer::globals::idttemplatepath . $installer::globals::separator . "Binary") # spent 8.17ms making 109 calls to installer::windows::idtglobal::CORE:ftdir, avg 75µs/call |
760 | { | ||||
761 | 109 | 736µs | 109 | 74.4ms | installer::systemactions::create_directory($destinationdir . $installer::globals::separator . "Binary"); # spent 74.4ms making 109 calls to installer::systemactions::create_directory, avg 682µs/call |
762 | 109 | 721µs | 109 | 4.09s | installer::systemactions::copy_directory($installer::globals::idttemplatepath . $installer::globals::separator . "Binary", $destinationdir . $installer::globals::separator . "Binary"); # spent 4.09s making 109 calls to installer::systemactions::copy_directory, avg 37.5ms/call |
763 | |||||
764 | 109 | 387µs | if ((( $installer::globals::patch ) && ( $allvariables->{'WINDOWSPATCHBITMAPDIRECTORY'} )) || ( $allvariables->{'WINDOWSBITMAPDIRECTORY'} )) | ||
765 | { | ||||
766 | my $bitmapdir = ""; | ||||
767 | if ( $allvariables->{'WINDOWSPATCHBITMAPDIRECTORY'} ) { $bitmapdir = $allvariables->{'WINDOWSPATCHBITMAPDIRECTORY'}; } | ||||
768 | if ( $allvariables->{'WINDOWSBITMAPDIRECTORY'} ) { $bitmapdir = $allvariables->{'WINDOWSBITMAPDIRECTORY'}; } | ||||
769 | |||||
770 | my $newsourcedir = $installer::globals::unpackpath . $installer::globals::separator . $bitmapdir; # path setting in list file dependent from unpackpath !? | ||||
771 | $infoline = "\nOverwriting files in directory \"" . $destinationdir . $installer::globals::separator . "Binary" . "\" with files from directory \"" . $newsourcedir . "\".\n"; | ||||
772 | push( @installer::globals::logfileinfo, $infoline); | ||||
773 | if ( ! -d $newsourcedir ) | ||||
774 | { | ||||
775 | my $currentdir = cwd(); | ||||
776 | installer::exiter::exit_program("ERROR: Directory $newsourcedir does not exist! Current directory is: $currentdir", "prepare_language_idt_directory"); | ||||
777 | } | ||||
778 | installer::systemactions::copy_directory($newsourcedir, $destinationdir . $installer::globals::separator . "Binary"); | ||||
779 | } | ||||
780 | } | ||||
781 | |||||
782 | 109 | 658µs | 109 | 73.6ms | installer::systemactions::create_directory($destinationdir . $installer::globals::separator . "Icon"); # spent 73.6ms making 109 calls to installer::systemactions::create_directory, avg 676µs/call |
783 | |||||
784 | 109 | 19.8ms | 109 | 18.9ms | if ( -d $installer::globals::idttemplatepath . $installer::globals::separator . "Icon") # spent 18.9ms making 109 calls to installer::windows::idtglobal::CORE:ftdir, avg 173µs/call |
785 | { | ||||
786 | installer::systemactions::copy_directory($installer::globals::idttemplatepath . $installer::globals::separator . "Icon", $destinationdir . $installer::globals::separator . "Icon"); | ||||
787 | } | ||||
788 | |||||
789 | # Copying all files in $iconfilecollector, that describe icons of folderitems | ||||
790 | |||||
791 | 109 | 738µs | for ( my $i = 0; $i <= $#{$iconfilecollector}; $i++ ) | ||
792 | { | ||||
793 | 109 | 270µs | my $iconfilename = ${$iconfilecollector}[$i]; | ||
794 | 109 | 583µs | 109 | 3.41ms | installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$iconfilename); # spent 3.41ms making 109 calls to installer::pathanalyzer::make_absolute_filename_to_relative_filename, avg 31µs/call |
795 | 109 | 595µs | 109 | 244ms | installer::systemactions::copy_one_file(${$iconfilecollector}[$i], $destinationdir . $installer::globals::separator . "Icon" . $installer::globals::separator . $iconfilename); # spent 244ms making 109 calls to installer::systemactions::copy_one_file, avg 2.24ms/call |
796 | } | ||||
797 | |||||
798 | # Copying all files in $binarytablefiles in the binary directory | ||||
799 | |||||
800 | 109 | 2.65ms | for ( my $i = 0; $i <= $#{$binarytablefiles}; $i++ ) | ||
801 | { | ||||
802 | 981 | 1.18ms | my $binaryfile = ${$binarytablefiles}[$i]; | ||
803 | 981 | 2.10ms | my $binaryfilepath = $binaryfile->{'sourcepath'}; | ||
804 | 981 | 614µs | my $binaryfilename = $binaryfilepath; | ||
805 | 981 | 3.92ms | 981 | 18.4ms | installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$binaryfilename); # spent 18.4ms making 981 calls to installer::pathanalyzer::make_absolute_filename_to_relative_filename, avg 19µs/call |
806 | 981 | 4.32ms | 981 | 2.33s | installer::systemactions::copy_one_file($binaryfilepath, $destinationdir . $installer::globals::separator . "Binary" . $installer::globals::separator . $binaryfilename); # spent 2.33s making 981 calls to installer::systemactions::copy_one_file, avg 2.37ms/call |
807 | } | ||||
808 | |||||
809 | # Copying all new created and language independent idt-files to the destination $destinationdir. | ||||
810 | # Example: "File.idt" | ||||
811 | |||||
812 | 109 | 701µs | 109 | 5.46s | installer::systemactions::copy_directory_with_fileextension($newidtdir, $destinationdir, "idt"); # spent 5.46s making 109 calls to installer::systemactions::copy_directory_with_fileextension, avg 50.1ms/call |
813 | |||||
814 | # Copying all new created and language dependent idt-files to the destination $destinationdir. | ||||
815 | # Example: "Feature.idt.01" | ||||
816 | |||||
817 | 109 | 594µs | 109 | 6.11s | installer::systemactions::copy_directory_with_fileextension($newidtdir, $destinationdir, $onelanguage); # spent 6.11s making 109 calls to installer::systemactions::copy_directory_with_fileextension, avg 56.1ms/call |
818 | 109 | 1.42ms | 109 | 777ms | installer::systemactions::rename_files_with_fileextension($destinationdir, $onelanguage); # spent 777ms making 109 calls to installer::systemactions::rename_files_with_fileextension, avg 7.13ms/call |
819 | |||||
820 | } | ||||
821 | |||||
822 | ############################################################## | ||||
823 | # Returning the source path of the rtf licensefile for | ||||
824 | # a specified language | ||||
825 | ############################################################## | ||||
826 | |||||
827 | sub get_rtflicensefilesource | ||||
828 | { | ||||
829 | my ($language, $includepatharrayref) = @_; | ||||
830 | |||||
831 | my $licensefilename = "license_" . $language . ".rtf"; | ||||
832 | |||||
833 | my $sourcefileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$licensefilename, $includepatharrayref, 1); | ||||
834 | |||||
835 | if ($$sourcefileref eq "") { installer::exiter::exit_program("ERROR: Could not find $licensefilename!", "get_rtflicensefilesource"); } | ||||
836 | |||||
837 | my $infoline = "Using licensefile: $$sourcefileref\n"; | ||||
838 | push( @installer::globals::logfileinfo, $infoline); | ||||
839 | |||||
840 | return $$sourcefileref; | ||||
841 | } | ||||
842 | |||||
843 | ############################################################## | ||||
844 | # A simple converter to create a license txt string from | ||||
845 | # the rtf format | ||||
846 | ############################################################## | ||||
847 | |||||
848 | sub make_string_licensetext | ||||
849 | { | ||||
850 | my ($licensefile) = @_; | ||||
851 | |||||
852 | my $rtf_licensetext = ""; | ||||
853 | |||||
854 | for ( my $i = 0; $i <= $#{$licensefile}; $i++ ) | ||||
855 | { | ||||
856 | my $oneline = ${$licensefile}[$i]; | ||||
857 | $oneline =~ s/\s*$//g; # no whitespace at line end | ||||
858 | |||||
859 | $rtf_licensetext = $rtf_licensetext . $oneline . " "; | ||||
860 | } | ||||
861 | |||||
862 | return $rtf_licensetext; | ||||
863 | } | ||||
864 | |||||
865 | ############################################################## | ||||
866 | # Including the license text into the table control.idt | ||||
867 | ############################################################## | ||||
868 | |||||
869 | sub add_licensefile_to_database | ||||
870 | { | ||||
871 | my ($licensefile, $controltable) = @_; | ||||
872 | |||||
873 | # Nine tabs before the license text and two tabs after it | ||||
874 | # The license text has to be included into the dialog | ||||
875 | # LicenseAgreement into the control Memo. | ||||
876 | |||||
877 | my $foundlicenseline = 0; | ||||
878 | my ($number, $line); | ||||
879 | |||||
880 | for ( my $i = 0; $i <= $#{$controltable}; $i++ ) | ||||
881 | { | ||||
882 | $line = ${$controltable}[$i]; | ||||
883 | |||||
884 | if ( $line =~ /^\s*\bLicenseAgreement\b\t\bMemo\t/ ) | ||||
885 | { | ||||
886 | $foundlicenseline = 1; | ||||
887 | $number = $i; | ||||
888 | last; | ||||
889 | } | ||||
890 | } | ||||
891 | |||||
892 | if (!($foundlicenseline)) | ||||
893 | { | ||||
894 | installer::exiter::exit_program("ERROR: Line for license file in Control.idt not found!", "add_licensefile_to_database"); | ||||
895 | } | ||||
896 | else | ||||
897 | { | ||||
898 | my %control = (); | ||||
899 | |||||
900 | if ( $line =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ ) | ||||
901 | { | ||||
902 | $control{'Dialog_'} = $1; | ||||
903 | $control{'Control'} = $2; | ||||
904 | $control{'Type'} = $3; | ||||
905 | $control{'X'} = $4; | ||||
906 | $control{'Y'} = $5; | ||||
907 | $control{'Width'} = $6; | ||||
908 | $control{'Height'} = $7; | ||||
909 | $control{'Attributes'} = $8; | ||||
910 | $control{'Property'} = $9; | ||||
911 | $control{'Text'} = $10; | ||||
912 | $control{'Control_Next'} = $11; | ||||
913 | $control{'Help'} = $12; | ||||
914 | } | ||||
915 | else | ||||
916 | { | ||||
917 | installer::exiter::exit_program("ERROR: Could not split line correctly!", "add_licensefile_to_database"); | ||||
918 | } | ||||
919 | |||||
920 | my $licensetext = make_string_licensetext($licensefile); | ||||
921 | |||||
922 | $control{'Text'} = $licensetext; | ||||
923 | |||||
924 | my $newline = $control{'Dialog_'} . "\t" . $control{'Control'} . "\t" . $control{'Type'} . "\t" . | ||||
925 | $control{'X'} . "\t" . $control{'Y'} . "\t" . $control{'Width'} . "\t" . | ||||
926 | $control{'Height'} . "\t" . $control{'Attributes'} . "\t" . $control{'Property'} . "\t" . | ||||
927 | $control{'Text'} . "\t" . $control{'Control_Next'} . "\t" . $control{'Help'} . "\n"; | ||||
928 | |||||
929 | ${$controltable}[$number] = $newline | ||||
930 | } | ||||
931 | } | ||||
932 | |||||
933 | ################################################################### | ||||
934 | # Determining the last position in a sequencetable | ||||
935 | # into the tables CustomAc.idt and InstallE.idt. | ||||
936 | ################################################################### | ||||
937 | |||||
938 | sub get_last_position_in_sequencetable | ||||
939 | # spent 170ms (129+41.1) within installer::windows::idtglobal::get_last_position_in_sequencetable which was called 327 times, avg 521µs/call:
# 327 times (129ms+41.1ms) by installer::windows::idtglobal::set_positions_in_table at line 1585, avg 521µs/call | ||||
940 | 327 | 301µs | my ($sequencetable) = @_; | ||
941 | |||||
942 | 327 | 242µs | my $position = 0; | ||
943 | |||||
944 | 327 | 21.2ms | for ( my $i = 0; $i <= $#{$sequencetable}; $i++ ) | ||
945 | { | ||||
946 | 16350 | 15.2ms | my $line = ${$sequencetable}[$i]; | ||
947 | |||||
948 | 16350 | 112ms | 16350 | 41.1ms | if ( $line =~ /^\s*\w+\t.*\t\s*(\d+)\s$/ ) # spent 41.1ms making 16350 calls to installer::windows::idtglobal::CORE:match, avg 3µs/call |
949 | { | ||||
950 | 11336 | 10.7ms | my $newposition = $1; | ||
951 | 11336 | 9.70ms | if ( $newposition > $position ) { $position = $newposition; } | ||
952 | } | ||||
953 | } | ||||
954 | |||||
955 | 327 | 2.03ms | return $position; | ||
956 | } | ||||
957 | |||||
958 | ######################################################################### | ||||
959 | # Determining the position of a specified Action in the sequencetable | ||||
960 | ######################################################################### | ||||
961 | |||||
962 | sub get_position_in_sequencetable | ||||
963 | { | ||||
964 | my ($action, $sequencetable) = @_; | ||||
965 | |||||
966 | my $position = 0; | ||||
967 | |||||
968 | $action =~ s/^\s*behind_//; | ||||
969 | |||||
970 | for ( my $i = 0; $i <= $#{$sequencetable}; $i++ ) | ||||
971 | { | ||||
972 | my $line = ${$sequencetable}[$i]; | ||||
973 | |||||
974 | if ( $line =~ /^\s*(\w+)\t.*\t\s*(\d+)\s$/ ) | ||||
975 | { | ||||
976 | my $compareaction = $1; | ||||
977 | $position = $2; | ||||
978 | if ( $compareaction eq $action ) { last; } | ||||
979 | } | ||||
980 | } | ||||
981 | |||||
982 | return $position; | ||||
983 | } | ||||
984 | |||||
985 | ################################################################################################ | ||||
986 | # Including the CustomAction for the configuration | ||||
987 | # into the tables CustomAc.idt and InstallE.idt. | ||||
988 | # | ||||
989 | # CustomAc.idt: ExecutePkgchk 82 pkgchk.exe -s | ||||
990 | # InstallE.idt: ExecutePkgchk Not REMOVE="ALL" 3175 | ||||
991 | # | ||||
992 | # CustomAc.idt: ExecuteQuickstart 82 install_quickstart.exe | ||||
993 | # InstallE.idt: ExecuteQuickstart &gm_o_Quickstart=3 3200 | ||||
994 | # | ||||
995 | # CustomAc.idt: ExecuteInstallRegsvrex 82 regsvrex.exe shlxthdl.dll | ||||
996 | # InstallE.idt: ExecuteInstallRegsvrex Not REMOVE="ALL" 3225 | ||||
997 | # | ||||
998 | # CustomAc.idt: ExecuteUninstallRegsvrex 82 regsvrex.exe /u shlxthdl.dll | ||||
999 | # InstallE.idt: ExecuteUninstallRegsvrex REMOVE="ALL" 690 | ||||
1000 | # | ||||
1001 | # CustomAc.idt: Regmsdocmsidll1 1 reg4msdocmsidll Reg4MsDocEntry | ||||
1002 | # InstallU.idt: Regmsdocmsidll1 Not REMOVE="ALL" 610 | ||||
1003 | # | ||||
1004 | # CustomAc.idt: Regmsdocmsidll2 1 reg4msdocmsidll Reg4MsDocEntry | ||||
1005 | # InstallE.idt: Regmsdocmsidll2 Not REMOVE="ALL" 3160 | ||||
1006 | ################################################################################################ | ||||
1007 | |||||
1008 | sub set_custom_action | ||||
1009 | # spent 115s (115+38.5ms) within installer::windows::idtglobal::set_custom_action which was called 4360 times, avg 26.3ms/call:
# 4360 times (115s+38.5ms) by installer::windows::idtglobal::addcustomactions at line 1725, avg 26.3ms/call | ||||
1010 | 4360 | 18.3ms | my ($customactionidttable, $actionname, $actionflags, $exefilename, $actionparameter, $inbinarytable, $filesref, $customactionidttablename, $styles) = @_; | ||
1011 | |||||
1012 | 4360 | 2.19ms | my $included_customaction = 0; | ||
1013 | 4360 | 2.67ms | my $infoline = ""; | ||
1014 | 4360 | 3.08ms | my $customaction_exefilename = $exefilename; | ||
1015 | 4360 | 3.54ms | my $uniquename = ""; | ||
1016 | |||||
1017 | # when the style NO_FILE is set, no searching for the file is needed, no filtering is done, we can add that custom action | ||||
1018 | 4360 | 33.5ms | 4360 | 5.85ms | if ( $styles =~ /\bNO_FILE\b/ ) # spent 5.85ms making 4360 calls to installer::windows::idtglobal::CORE:match, avg 1µs/call |
1019 | { | ||||
1020 | my $line = $actionname . "\t" . $actionflags . "\t" . $customaction_exefilename . "\t" . $actionparameter . "\n"; | ||||
1021 | push(@{$customactionidttable}, $line); | ||||
1022 | |||||
1023 | $infoline = "Added $actionname CustomAction into table $customactionidttablename (NO_FILE has been set)\n"; | ||||
1024 | push(@installer::globals::logfileinfo, $infoline); | ||||
1025 | |||||
1026 | $included_customaction = 1; | ||||
1027 | return $included_customaction; | ||||
1028 | } | ||||
1029 | |||||
1030 | # is the $exefilename a library that is included into the binary table | ||||
1031 | |||||
1032 | 8720 | 59.7ms | 4360 | 32.7ms | if ( $inbinarytable ) { $customaction_exefilename =~ s/\.//; } # this is the entry in the binary table ("abc.dll" -> "abcdll") # spent 32.7ms making 4360 calls to installer::windows::idtglobal::CORE:subst, avg 7µs/call |
1033 | |||||
1034 | # is the $exefilename included into the product? | ||||
1035 | |||||
1036 | 4360 | 2.79ms | my $contains_file = 0; | ||
1037 | |||||
1038 | # All files are located in $filesref and in @installer::globals::binarytableonlyfiles. | ||||
1039 | # Both must be added together | ||||
1040 | 4360 | 11.0s | my $localfilesref = [@installer::globals::binarytableonlyfiles, @{$filesref}]; | ||
1041 | |||||
1042 | 4360 | 22.9s | for ( my $i = 0; $i <= $#{$localfilesref}; $i++ ) | ||
1043 | { | ||||
1044 | 20811588 | 13.2s | my $onefile = ${$localfilesref}[$i]; | ||
1045 | 20811588 | 8.70s | my $filename = ""; | ||
1046 | 20811588 | 27.8s | if ( exists($onefile->{'Name'}) ) | ||
1047 | { | ||||
1048 | 20811588 | 16.8s | $filename = $onefile->{'Name'}; | ||
1049 | |||||
1050 | 20811588 | 8.50s | if ( $filename eq $exefilename ) | ||
1051 | { | ||||
1052 | 3052 | 1.67ms | $contains_file = 1; | ||
1053 | 3052 | 4.28ms | $uniquename = ${$localfilesref}[$i]->{'uniquename'}; | ||
1054 | 3052 | 4.78ms | last; | ||
1055 | } | ||||
1056 | } | ||||
1057 | else | ||||
1058 | { | ||||
1059 | installer::exiter::exit_program("ERROR: Did not find \"Name\" for file \"$onefile->{'uniquename'}\" ($onefile->{'gid'})!", "set_custom_action"); | ||||
1060 | } | ||||
1061 | } | ||||
1062 | |||||
1063 | 4360 | 3.86ms | if ( $contains_file ) | ||
1064 | { | ||||
1065 | # Now the CustomAction can be included into the CustomAc.idt | ||||
1066 | |||||
1067 | 3052 | 2.63ms | if ( ! $inbinarytable ) { $customaction_exefilename = $uniquename; } # the unique file name has to be added to the custom action table | ||
1068 | |||||
1069 | 3052 | 10.0ms | my $line = $actionname . "\t" . $actionflags . "\t" . $customaction_exefilename . "\t" . $actionparameter . "\n"; | ||
1070 | 3052 | 10.4ms | push(@{$customactionidttable}, $line); | ||
1071 | |||||
1072 | 3052 | 1.95ms | $included_customaction = 1; | ||
1073 | } | ||||
1074 | |||||
1075 | 4360 | 7.51ms | if ( $included_customaction ) { $infoline = "Added $actionname CustomAction into table $customactionidttablename\n"; } | ||
1076 | 1308 | 5.23ms | else { $infoline = "Did not add $actionname CustomAction into table $customactionidttablename\n"; } | ||
1077 | 4360 | 16.6ms | push(@installer::globals::logfileinfo, $infoline); | ||
1078 | |||||
1079 | 4360 | 5.54s | return $included_customaction; | ||
1080 | } | ||||
1081 | |||||
1082 | #################################################################### | ||||
1083 | # Adding a Custom Action to InstallExecuteTable or InstallUITable | ||||
1084 | #################################################################### | ||||
1085 | |||||
1086 | sub add_custom_action_to_install_table | ||||
1087 | # spent 12.8s (12.5+260ms) within installer::windows::idtglobal::add_custom_action_to_install_table which was called 3706 times, avg 3.45ms/call:
# 3706 times (12.5s+260ms) by installer::windows::idtglobal::addcustomactions at line 1766, avg 3.45ms/call | ||||
1088 | 3706 | 12.8ms | my ($installtable, $exefilename, $actionname, $actioncondition, $position, $filesref, $installtablename, $styles) = @_; | ||
1089 | |||||
1090 | 3706 | 1.86ms | my $included_customaction = 0; | ||
1091 | 3706 | 2.31ms | my $feature = ""; | ||
1092 | 3706 | 2.31ms | my $infoline = ""; | ||
1093 | |||||
1094 | # when the style NO_FILE is set, no searching for the file is needed, no filtering is done, we can add that custom action | ||||
1095 | 3706 | 18.2ms | 3706 | 3.03ms | if ( $styles =~ /\bNO_FILE\b/ ) # spent 3.03ms making 3706 calls to installer::windows::idtglobal::CORE:match, avg 818ns/call |
1096 | { | ||||
1097 | # then the InstallE.idt.idt or InstallU.idt.idt | ||||
1098 | $actioncondition =~ s/FEATURETEMPLATE/$feature/g; # only execute Custom Action, if feature of the file is installed | ||||
1099 | |||||
1100 | my $actionposition = 0; | ||||
1101 | |||||
1102 | if ( $position eq "end" ) { $actionposition = get_last_position_in_sequencetable($installtable) + 25; } | ||||
1103 | elsif ( $position =~ /^\s*behind_/ ) { $actionposition = get_position_in_sequencetable($position, $installtable) + 2; } | ||||
1104 | else { $actionposition = get_position_in_sequencetable($position, $installtable) - 2; } | ||||
1105 | |||||
1106 | my $line = $actionname . "\t" . $actioncondition . "\t" . $actionposition . "\n"; | ||||
1107 | push(@{$installtable}, $line); | ||||
1108 | |||||
1109 | $infoline = "Added $actionname CustomAction into table $installtablename (NO_FILE has been set)\n"; | ||||
1110 | push(@installer::globals::logfileinfo, $infoline); | ||||
1111 | return; | ||||
1112 | } | ||||
1113 | |||||
1114 | 3706 | 2.38ms | my $contains_file = 0; | ||
1115 | |||||
1116 | # All files are located in $filesref and in @installer::globals::binarytableonlyfiles. | ||||
1117 | # Both must be added together | ||||
1118 | 3706 | 8.59s | my $localfilesref = [@installer::globals::binarytableonlyfiles, @{$filesref}]; | ||
1119 | |||||
1120 | 3706 | 35.1ms | for ( my $i = 0; $i <= $#{$localfilesref}; $i++ ) | ||
1121 | { | ||||
1122 | 23326 | 36.9ms | my $filename = ${$localfilesref}[$i]->{'Name'}; | ||
1123 | |||||
1124 | 23326 | 14.4ms | if ( $filename eq $exefilename ) | ||
1125 | { | ||||
1126 | 3706 | 2.41ms | $contains_file = 1; | ||
1127 | |||||
1128 | # Determining the feature of the file | ||||
1129 | |||||
1130 | 3706 | 8.95ms | if ( ${$localfilesref}[$i] ) { $feature = ${$localfilesref}[$i]->{'modules'}; } | ||
1131 | |||||
1132 | # If modules contains a list of modules, only taking the first one. | ||||
1133 | 3706 | 47.9ms | 3706 | 13.9ms | if ( $feature =~ /^\s*(.*?)\,/ ) { $feature = $1; } # spent 13.9ms making 3706 calls to installer::windows::idtglobal::CORE:match, avg 4µs/call |
1134 | # Attention: Maximum feature length is 38! | ||||
1135 | 3706 | 27.7ms | 3706 | 224ms | shorten_feature_gid(\$feature); # spent 224ms making 3706 calls to installer::windows::idtglobal::shorten_feature_gid, avg 60µs/call |
1136 | |||||
1137 | 3706 | 6.57ms | last; | ||
1138 | } | ||||
1139 | } | ||||
1140 | |||||
1141 | 3706 | 4.25ms | if ( $contains_file ) | ||
1142 | { | ||||
1143 | # then the InstallE.idt.idt or InstallU.idt.idt | ||||
1144 | |||||
1145 | 3706 | 20.6ms | 3706 | 5.66ms | $actioncondition =~ s/FEATURETEMPLATE/$feature/g; # only execute Custom Action, if feature of the file is installed # spent 5.66ms making 3706 calls to installer::windows::idtglobal::CORE:subst, avg 2µs/call |
1146 | |||||
1147 | # my $actionposition = 0; | ||||
1148 | # if ( $position eq "end" ) { $actionposition = get_last_position_in_sequencetable($installtable) + 25; } | ||||
1149 | # elsif ( $position =~ /^\s*behind_/ ) { $actionposition = get_position_in_sequencetable($position, $installtable) + 2; } | ||||
1150 | # else { $actionposition = get_position_in_sequencetable($position, $installtable) - 2; } | ||||
1151 | # my $line = $actionname . "\t" . $actioncondition . "\t" . $actionposition . "\n"; | ||||
1152 | |||||
1153 | 3706 | 5.35ms | my $positiontemplate = ""; | ||
1154 | 3706 | 33.2ms | 3706 | 13.9ms | if ( $position =~ /^\s*\d+\s*$/ ) { $positiontemplate = $position; } # setting the position directly, number defined in scp2 # spent 13.9ms making 3706 calls to installer::windows::idtglobal::CORE:match, avg 4µs/call |
1155 | 3706 | 5.31ms | else { $positiontemplate = "POSITIONTEMPLATE_" . $position; } | ||
1156 | |||||
1157 | 3706 | 6.19ms | my $line = $actionname . "\t" . $actioncondition . "\t" . $positiontemplate . "\n"; | ||
1158 | 3706 | 9.05ms | push(@{$installtable}, $line); | ||
1159 | |||||
1160 | 3706 | 3.54ms | $included_customaction = 1; | ||
1161 | } | ||||
1162 | |||||
1163 | 3706 | 6.80ms | if ( $included_customaction ) { $infoline = "Added $actionname CustomAction into table $installtablename\n"; } | ||
1164 | else { $infoline = "Did not add $actionname CustomAction into table $installtablename\n"; } | ||||
1165 | 3706 | 3.69s | push(@installer::globals::logfileinfo, $infoline); | ||
1166 | |||||
1167 | } | ||||
1168 | |||||
1169 | ################################################################## | ||||
1170 | # A line in the table ControlEvent connects a Control | ||||
1171 | # with a Custom Action | ||||
1172 | ################################################################# | ||||
1173 | |||||
1174 | sub connect_custom_action_to_control | ||||
1175 | # spent 20.3ms (10.5+9.83) within installer::windows::idtglobal::connect_custom_action_to_control which was called 545 times, avg 37µs/call:
# 545 times (10.5ms+9.83ms) by installer::windows::idtglobal::addcustomactions at line 1766, avg 37µs/call | ||||
1176 | 545 | 1.88ms | my ( $table, $tablename, $dialog, $control, $event, $argument, $condition, $ordering) = @_; | ||
1177 | |||||
1178 | 545 | 1.51ms | my $line = $dialog . "\t" . $control. "\t" . $event. "\t" . $argument. "\t" . $condition. "\t" . $ordering . "\n"; | ||
1179 | |||||
1180 | 545 | 906µs | push(@{$table}, $line); | ||
1181 | |||||
1182 | 545 | 12.4ms | 545 | 9.83ms | $line =~ s/\s*$//g; # spent 9.83ms making 545 calls to installer::windows::idtglobal::CORE:subst, avg 18µs/call |
1183 | |||||
1184 | 545 | 847µs | $infoline = "Added line \"$line\" into table $tablename\n"; | ||
1185 | 545 | 3.58ms | push(@installer::globals::logfileinfo, $infoline); | ||
1186 | } | ||||
1187 | |||||
1188 | ################################################################## | ||||
1189 | # A line in the table ControlCondition connects a Control state | ||||
1190 | # with a condition | ||||
1191 | ################################################################## | ||||
1192 | |||||
1193 | sub connect_condition_to_control | ||||
1194 | { | ||||
1195 | my ( $table, $tablename, $dialog, $control, $event, $condition) = @_; | ||||
1196 | |||||
1197 | my $line = $dialog . "\t" . $control. "\t" . $event. "\t" . $condition. "\n"; | ||||
1198 | |||||
1199 | push(@{$table}, $line); | ||||
1200 | |||||
1201 | $line =~ s/\s*$//g; | ||||
1202 | |||||
1203 | $infoline = "Added line \"$line\" into table $tablename\n"; | ||||
1204 | push(@installer::globals::logfileinfo, $infoline); | ||||
1205 | } | ||||
1206 | |||||
1207 | ################################################################## | ||||
1208 | # Searching for a sequencenumber in InstallUISequence table | ||||
1209 | # "ExecuteAction" must be the last action | ||||
1210 | ################################################################## | ||||
1211 | |||||
1212 | sub get_free_number_in_uisequence_table | ||||
1213 | { | ||||
1214 | my ( $installuitable ) = @_; | ||||
1215 | |||||
1216 | # determining the sequence of "ExecuteAction" | ||||
1217 | |||||
1218 | my $executeactionnumber = 0; | ||||
1219 | |||||
1220 | for ( my $i = 0; $i <= $#{$installuitable}; $i++ ) | ||||
1221 | { | ||||
1222 | if ( ${$installuitable}[$i] =~ /^\s*(\w+)\t\w*\t(\d+)\s*$/ ) | ||||
1223 | { | ||||
1224 | my $actionname = $1; | ||||
1225 | my $actionnumber = $2; | ||||
1226 | |||||
1227 | if ( $actionname eq "ExecuteAction" ) | ||||
1228 | { | ||||
1229 | $executeactionnumber = $actionnumber; | ||||
1230 | last; | ||||
1231 | } | ||||
1232 | } | ||||
1233 | } | ||||
1234 | |||||
1235 | if ( $executeactionnumber == 0 ) { installer::exiter::exit_program("ERROR: Did not find \"ExecuteAction\" in InstallUISequence table!", "get_free_number_in_uisequence_table"); } | ||||
1236 | |||||
1237 | # determining the sequence of the action before "ExecuteAction" | ||||
1238 | |||||
1239 | my $lastactionnumber = 0; | ||||
1240 | |||||
1241 | for ( my $i = 0; $i <= $#{$installuitable}; $i++ ) | ||||
1242 | { | ||||
1243 | if ( ${$installuitable}[$i] =~ /^\s*\w+\t\w*\t(\d+)\s*$/ ) | ||||
1244 | { | ||||
1245 | my $actionnumber = $1; | ||||
1246 | |||||
1247 | if (( $actionnumber > $lastactionnumber ) && ( $actionnumber != $executeactionnumber )) | ||||
1248 | { | ||||
1249 | $lastactionnumber = $actionnumber; | ||||
1250 | } | ||||
1251 | } | ||||
1252 | } | ||||
1253 | |||||
1254 | # the new number can now be calculated | ||||
1255 | |||||
1256 | my $newnumber = 0; | ||||
1257 | |||||
1258 | if ((( $lastactionnumber + $executeactionnumber ) % 2 ) == 0 ) { $newnumber = ( $lastactionnumber + $executeactionnumber ) / 2; } | ||||
1259 | else { $newnumber = ( $lastactionnumber + $executeactionnumber -1 ) / 2; } | ||||
1260 | |||||
1261 | return $newnumber; | ||||
1262 | } | ||||
1263 | |||||
1264 | ############################################################# | ||||
1265 | # Including the new subdir into the directory table | ||||
1266 | ############################################################# | ||||
1267 | |||||
1268 | sub include_subdirname_into_directory_table | ||||
1269 | { | ||||
1270 | my ($dirname, $directorytable, $directorytablename, $onefile) = @_; | ||||
1271 | |||||
1272 | my $subdir = ""; | ||||
1273 | if ( $onefile->{'Subdir'} ) { $subdir = $onefile->{'Subdir'}; } | ||||
1274 | if ( $subdir eq "" ) { installer::exiter::exit_program("ERROR: No \"Subdir\" defined for $onefile->{'Name'}", "include_subdirname_into_directory_table"); } | ||||
1275 | |||||
1276 | # program INSTALLLOCATION program -> subjava INSTALLLOCATION program:java | ||||
1277 | |||||
1278 | my $uniquename = ""; | ||||
1279 | my $parent = ""; | ||||
1280 | my $name = ""; | ||||
1281 | |||||
1282 | my $includedline = 0; | ||||
1283 | |||||
1284 | my $newdir = ""; | ||||
1285 | |||||
1286 | for ( my $i = 0; $i <= $#{$directorytable}; $i++ ) | ||||
1287 | { | ||||
1288 | |||||
1289 | if ( ${$directorytable}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\s*$/ ) | ||||
1290 | { | ||||
1291 | $uniquename = $1; | ||||
1292 | $parent = $2; | ||||
1293 | $name = $3; | ||||
1294 | |||||
1295 | if ( $dirname eq $name ) | ||||
1296 | { | ||||
1297 | my $newuniquename = "sub" . $subdir; | ||||
1298 | $newdir = $newuniquename; | ||||
1299 | my $newparent = "INSTALLLOCATION"; | ||||
1300 | my $newname = $name . "\:" . $subdir; | ||||
1301 | my $newline = | ||||
1302 | $line = "$newuniquename\t$newparent\t$newname\n"; | ||||
1303 | push(@{$directorytable}, $line); | ||||
1304 | installer::remover::remove_leading_and_ending_whitespaces(\$line); | ||||
1305 | $infoline = "Added $line into directory table $directorytablename\n"; | ||||
1306 | push(@installer::globals::logfileinfo, $infoline); | ||||
1307 | |||||
1308 | $includedline = 1; | ||||
1309 | last; | ||||
1310 | } | ||||
1311 | } | ||||
1312 | } | ||||
1313 | |||||
1314 | if ( ! $includedline ) { installer::exiter::exit_program("ERROR: Could not include new subdirectory into directory table for file $onefile->{'Name'}!", "include_subdirname_into_directory_table"); } | ||||
1315 | |||||
1316 | return $newdir; | ||||
1317 | } | ||||
1318 | |||||
1319 | ################################################################## | ||||
1320 | # Including the new sub directory into the component table | ||||
1321 | ################################################################## | ||||
1322 | |||||
1323 | sub include_subdir_into_componenttable | ||||
1324 | { | ||||
1325 | my ($subdir, $onefile, $componenttable) = @_; | ||||
1326 | |||||
1327 | my $componentname = $onefile->{'componentname'}; | ||||
1328 | |||||
1329 | my $changeddirectory = 0; | ||||
1330 | |||||
1331 | for ( my $i = 0; $i <= $#{$componenttable}; $i++ ) | ||||
1332 | { | ||||
1333 | if ( ${$componenttable}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ ) | ||||
1334 | { | ||||
1335 | my $localcomponentname = $1; | ||||
1336 | my $directory = $3; | ||||
1337 | |||||
1338 | if ( $componentname eq $localcomponentname ) | ||||
1339 | { | ||||
1340 | my $oldvalue = ${$componenttable}[$i]; | ||||
1341 | ${$componenttable}[$i] =~ s/\b\Q$directory\E\b/$subdir/; | ||||
1342 | my $newvalue = ${$componenttable}[$i]; | ||||
1343 | |||||
1344 | installer::remover::remove_leading_and_ending_whitespaces(\$oldvalue); | ||||
1345 | installer::remover::remove_leading_and_ending_whitespaces(\$newvalue); | ||||
1346 | $infoline = "Change in Component table: From \"$oldvalue\" to \"$newvalue\"\n"; | ||||
1347 | push(@installer::globals::logfileinfo, $infoline); | ||||
1348 | |||||
1349 | $changeddirectory = 1; | ||||
1350 | last; | ||||
1351 | } | ||||
1352 | } | ||||
1353 | } | ||||
1354 | |||||
1355 | if ( ! $changeddirectory ) { installer::exiter::exit_program("ERROR: Could not change directory for component: $onefile->{'Name'}!", "include_subdir_into_componenttable"); } | ||||
1356 | |||||
1357 | } | ||||
1358 | |||||
1359 | ################################################################## | ||||
1360 | # Setting the encoding in all idt files. Replacing the | ||||
1361 | # variable WINDOWSENCODINGTEMPLATE | ||||
1362 | ################################################################## | ||||
1363 | |||||
1364 | sub setencoding | ||||
1365 | # spent 65.0s (29.1+35.9) within installer::windows::idtglobal::setencoding which was called 109 times, avg 597ms/call:
# 109 times (29.1s+35.9s) by installer::run at line 1608 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 597ms/call | ||||
1366 | 109 | 317µs | my ( $languageidtdir, $onelanguage ) = @_; | ||
1367 | |||||
1368 | 109 | 756µs | 109 | 1.87ms | my $encoding = installer::windows::language::get_windows_encoding($onelanguage); # spent 1.87ms making 109 calls to installer::windows::language::get_windows_encoding, avg 17µs/call |
1369 | |||||
1370 | # collecting all idt files in the directory $languageidtdir and substituting the string | ||||
1371 | |||||
1372 | 109 | 735µs | 109 | 110ms | my $idtfiles = installer::systemactions::find_file_with_file_extension("idt", $languageidtdir); # spent 110ms making 109 calls to installer::systemactions::find_file_with_file_extension, avg 1.01ms/call |
1373 | |||||
1374 | 109 | 16.8ms | for ( my $i = 0; $i <= $#{$idtfiles}; $i++ ) | ||
1375 | { | ||||
1376 | 4578 | 12.0ms | my $onefilename = $languageidtdir . $installer::globals::separator . ${$idtfiles}[$i]; | ||
1377 | 4578 | 20.2ms | 4578 | 27.8s | my $onefile = installer::files::read_file($onefilename); # spent 27.8s making 4578 calls to installer::files::read_file, avg 6.08ms/call |
1378 | |||||
1379 | 4578 | 7.20s | for ( my $j = 0; $j <= $#{$onefile}; $j++ ) | ||
1380 | { | ||||
1381 | 6186404 | 22.8s | 6186404 | 3.61s | ${$onefile}[$j] =~ s/WINDOWSENCODINGTEMPLATE/$encoding/g; # spent 3.61s making 6186404 calls to installer::windows::idtglobal::CORE:subst, avg 584ns/call |
1382 | } | ||||
1383 | |||||
1384 | 4578 | 2.62s | 4578 | 4.37s | installer::files::save_file($onefilename, $onefile); # spent 4.37s making 4578 calls to installer::files::save_file, avg 955µs/call |
1385 | } | ||||
1386 | } | ||||
1387 | |||||
1388 | ################################################################## | ||||
1389 | # Setting the condition, that at least one module is selected. | ||||
1390 | # All modules with flag SHOW_MULTILINGUAL_ONLY were already | ||||
1391 | # collected. In table ControlE.idt, the string | ||||
1392 | # LANGUAGECONDITIONINSTALL needs to be replaced. | ||||
1393 | # Also for APPLICATIONCONDITIONINSTALL for the applications | ||||
1394 | # with flag APPLICATIONMODULE. | ||||
1395 | ################################################################## | ||||
1396 | |||||
1397 | sub set_multilanguageonly_condition | ||||
1398 | # spent 358ms (164+194) within installer::windows::idtglobal::set_multilanguageonly_condition which was called 109 times, avg 3.28ms/call:
# 109 times (164ms+194ms) by installer::run at line 1615 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 3.28ms/call | ||||
1399 | 109 | 228µs | my ( $languageidtdir ) = @_; | ||
1400 | |||||
1401 | 109 | 271µs | my $onefilename = $languageidtdir . $installer::globals::separator . "ControlE.idt"; | ||
1402 | 109 | 336µs | 109 | 93.0ms | my $onefile = installer::files::read_file($onefilename); # spent 93.0ms making 109 calls to installer::files::read_file, avg 853µs/call |
1403 | |||||
1404 | # Language modules | ||||
1405 | |||||
1406 | 109 | 113µs | my $condition = ""; | ||
1407 | |||||
1408 | 109 | 17.5ms | 109 | 8.91ms | foreach my $module ( sort keys %installer::globals::multilingual_only_modules ) # spent 8.91ms making 109 calls to installer::windows::idtglobal::CORE:sort, avg 82µs/call |
1409 | { | ||||
1410 | 11881 | 12.8ms | $condition = $condition . " &$module=3 Or"; | ||
1411 | } | ||||
1412 | |||||
1413 | 109 | 1.56ms | 109 | 925µs | $condition =~ s/^\s*//; # spent 925µs making 109 calls to installer::windows::idtglobal::CORE:subst, avg 8µs/call |
1414 | 109 | 18.6ms | 109 | 18.1ms | $condition =~ s/\s*Or\s*$//; # removing the ending "Or" # spent 18.1ms making 109 calls to installer::windows::idtglobal::CORE:subst, avg 166µs/call |
1415 | |||||
1416 | 109 | 158µs | if ( $condition eq "" ) { $condition = "1"; } | ||
1417 | |||||
1418 | 109 | 16.8ms | for ( my $j = 0; $j <= $#{$onefile}; $j++ ) | ||
1419 | { | ||||
1420 | 14933 | 56.9ms | 14933 | 8.51ms | ${$onefile}[$j] =~ s/LANGUAGECONDITIONINSTALL/$condition/; # spent 8.51ms making 14933 calls to installer::windows::idtglobal::CORE:subst, avg 570ns/call |
1421 | } | ||||
1422 | |||||
1423 | # Application modules | ||||
1424 | |||||
1425 | 109 | 108µs | $condition = ""; | ||
1426 | |||||
1427 | 109 | 1.65ms | 109 | 442µs | foreach my $module ( sort keys %installer::globals::application_modules ) # spent 442µs making 109 calls to installer::windows::idtglobal::CORE:sort, avg 4µs/call |
1428 | { | ||||
1429 | 654 | 925µs | $condition = $condition . " &$module=3 Or"; | ||
1430 | } | ||||
1431 | |||||
1432 | 109 | 871µs | 109 | 336µs | $condition =~ s/^\s*//; # spent 336µs making 109 calls to installer::windows::idtglobal::CORE:subst, avg 3µs/call |
1433 | 109 | 1.65ms | 109 | 1.12ms | $condition =~ s/\s*Or\s*$//; # removing the ending "Or" # spent 1.12ms making 109 calls to installer::windows::idtglobal::CORE:subst, avg 10µs/call |
1434 | |||||
1435 | 109 | 80µs | if ( $condition eq "" ) { $condition = "1"; } | ||
1436 | |||||
1437 | 109 | 16.6ms | for ( my $j = 0; $j <= $#{$onefile}; $j++ ) | ||
1438 | { | ||||
1439 | 14933 | 56.4ms | 14933 | 7.99ms | ${$onefile}[$j] =~ s/APPLICATIONCONDITIONINSTALL/$condition/; # spent 7.99ms making 14933 calls to installer::windows::idtglobal::CORE:subst, avg 535ns/call |
1440 | } | ||||
1441 | |||||
1442 | 109 | 5.71ms | 109 | 55.1ms | installer::files::save_file($onefilename, $onefile); # spent 55.1ms making 109 calls to installer::files::save_file, avg 506µs/call |
1443 | } | ||||
1444 | |||||
1445 | ############################################# | ||||
1446 | # Putting array values into hash | ||||
1447 | ############################################# | ||||
1448 | |||||
1449 | sub fill_assignment_hash | ||||
1450 | # spent 716ms (461+255) within installer::windows::idtglobal::fill_assignment_hash which was called 4251 times, avg 168µs/call:
# 2616 times (250ms+140ms) by installer::windows::idtglobal::create_customaction_assignment_hash at line 1506, avg 149µs/call
# 654 times (59.7ms+33.6ms) by installer::windows::idtglobal::create_customaction_assignment_hash at line 1499, avg 143µs/call
# 545 times (111ms+59.7ms) by installer::windows::idtglobal::create_customaction_assignment_hash at line 1520, avg 313µs/call
# 436 times (40.1ms+21.3ms) by installer::windows::idtglobal::create_customaction_assignment_hash at line 1513, avg 141µs/call | ||||
1451 | 4251 | 10.9ms | my ($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray) = @_; | ||
1452 | |||||
1453 | 4251 | 7.54ms | my $max = $parameter - 1; | ||
1454 | |||||
1455 | 4251 | 7.90ms | if ( $max != $#{$assignmentarray} ) | ||
1456 | { | ||||
1457 | my $definedparameter = $#{$assignmentarray} + 1; | ||||
1458 | installer::exiter::exit_program("ERROR: gid: $gid, key: $key ! Wrong parameter in scp. For table $tablename $parameter parameter are required ! You defined: $definedparameter", "fill_assignment_hash"); | ||||
1459 | } | ||||
1460 | |||||
1461 | 4251 | 52.7ms | for ( my $i = 0; $i <= $#{$assignmentarray}; $i++ ) | ||
1462 | { | ||||
1463 | 14933 | 12.6ms | my $counter = $i + 1; | ||
1464 | 14933 | 16.1ms | my $key = "parameter". $counter; | ||
1465 | |||||
1466 | 14933 | 13.1ms | my $localvalue = ${$assignmentarray}[$i]; | ||
1467 | 14933 | 45.6ms | 14933 | 196ms | installer::remover::remove_leading_and_ending_quotationmarks(\$localvalue); # spent 196ms making 14933 calls to installer::remover::remove_leading_and_ending_quotationmarks, avg 13µs/call |
1468 | 14933 | 76.2ms | 14933 | 26.0ms | $localvalue =~ s/\\\"/\"/g; # spent 26.0ms making 14933 calls to installer::windows::idtglobal::CORE:subst, avg 2µs/call |
1469 | 14933 | 55.7ms | 14933 | 9.00ms | $localvalue =~ s/\\\!/\!/g; # spent 9.00ms making 14933 calls to installer::windows::idtglobal::CORE:subst, avg 603ns/call |
1470 | 14933 | 53.9ms | 14933 | 8.82ms | $localvalue =~ s/\\\&/\&/g; # spent 8.82ms making 14933 calls to installer::windows::idtglobal::CORE:subst, avg 591ns/call |
1471 | 14933 | 53.1ms | 14933 | 7.36ms | $localvalue =~ s/\\\</\</g; # spent 7.36ms making 14933 calls to installer::windows::idtglobal::CORE:subst, avg 493ns/call |
1472 | 14933 | 52.1ms | 14933 | 7.11ms | $localvalue =~ s/\\\>/\>/g; # spent 7.11ms making 14933 calls to installer::windows::idtglobal::CORE:subst, avg 476ns/call |
1473 | 14933 | 42.7ms | $assignmenthashref->{$key} = $localvalue; | ||
1474 | } | ||||
1475 | } | ||||
1476 | |||||
1477 | ########################################################################## | ||||
1478 | # Checking the assignment of a Windows CustomAction and putting it | ||||
1479 | # into a hash | ||||
1480 | ########################################################################## | ||||
1481 | |||||
1482 | sub create_customaction_assignment_hash | ||||
1483 | # spent 923ms (121+802) within installer::windows::idtglobal::create_customaction_assignment_hash which was called 4251 times, avg 217µs/call:
# 4251 times (121ms+802ms) by installer::windows::idtglobal::addcustomactions at line 1764, avg 217µs/call | ||||
1484 | 4251 | 9.62ms | my ($gid, $name, $key, $assignmentarray) = @_; | ||
1485 | |||||
1486 | 4251 | 6.56ms | my %assignment = (); | ||
1487 | 4251 | 3.18ms | my $assignmenthashref = \%assignment; | ||
1488 | |||||
1489 | 4251 | 4.47ms | my $tablename = ${$assignmentarray}[0]; | ||
1490 | 4251 | 16.6ms | 4251 | 86.2ms | installer::remover::remove_leading_and_ending_quotationmarks(\$tablename); # spent 86.2ms making 4251 calls to installer::remover::remove_leading_and_ending_quotationmarks, avg 20µs/call |
1491 | |||||
1492 | 4251 | 3.00ms | my $tablename_defined = 0; | ||
1493 | 4251 | 2.17ms | my $parameter = 0; | ||
1494 | |||||
1495 | 4251 | 4.13ms | if ( $tablename eq "InstallUISequence" ) | ||
1496 | { | ||||
1497 | 654 | 254µs | $tablename_defined = 1; | ||
1498 | 654 | 314µs | $parameter = 3; | ||
1499 | 654 | 2.29ms | 654 | 93.3ms | fill_assignment_hash($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray); # spent 93.3ms making 654 calls to installer::windows::idtglobal::fill_assignment_hash, avg 143µs/call |
1500 | } | ||||
1501 | |||||
1502 | 4251 | 3.94ms | if ( $tablename eq "InstallExecuteSequence" ) | ||
1503 | { | ||||
1504 | 2616 | 1.25ms | $tablename_defined = 1; | ||
1505 | 2616 | 1.18ms | $parameter = 3; | ||
1506 | 2616 | 10.3ms | 2616 | 390ms | fill_assignment_hash($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray); # spent 390ms making 2616 calls to installer::windows::idtglobal::fill_assignment_hash, avg 149µs/call |
1507 | } | ||||
1508 | |||||
1509 | 4251 | 2.77ms | if ( $tablename eq "AdminExecuteSequence" ) | ||
1510 | { | ||||
1511 | 436 | 212µs | $tablename_defined = 1; | ||
1512 | 436 | 204µs | $parameter = 3; | ||
1513 | 436 | 1.54ms | 436 | 61.3ms | fill_assignment_hash($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray); # spent 61.3ms making 436 calls to installer::windows::idtglobal::fill_assignment_hash, avg 141µs/call |
1514 | } | ||||
1515 | |||||
1516 | 4251 | 2.91ms | if ( $tablename eq "ControlEvent" ) | ||
1517 | { | ||||
1518 | 545 | 209µs | $tablename_defined = 1; | ||
1519 | 545 | 233µs | $parameter = 7; | ||
1520 | 545 | 1.95ms | 545 | 171ms | fill_assignment_hash($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray); # spent 171ms making 545 calls to installer::windows::idtglobal::fill_assignment_hash, avg 313µs/call |
1521 | } | ||||
1522 | |||||
1523 | 4251 | 2.29ms | if ( $tablename eq "ControlCondition" ) | ||
1524 | { | ||||
1525 | $tablename_defined = 1; | ||||
1526 | $parameter = 5; | ||||
1527 | fill_assignment_hash($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray); | ||||
1528 | } | ||||
1529 | |||||
1530 | 4251 | 2.28ms | if ( ! $tablename_defined ) | ||
1531 | { | ||||
1532 | installer::exiter::exit_program("ERROR: gid: $gid, key: $key ! Unknown Windows CustomAction table: $tablename ! Currently supported: InstallUISequence, InstallExecuteSequence, ControlEvent, ControlCondition", "create_customaction_assignment_hash"); | ||||
1533 | } | ||||
1534 | |||||
1535 | 4251 | 23.9ms | return $assignmenthashref; | ||
1536 | } | ||||
1537 | |||||
1538 | ########################################################################## | ||||
1539 | # Finding the position of a specified CustomAction. | ||||
1540 | # If the CustomAction is not found, the return value is "-1". | ||||
1541 | # If the CustomAction position is not defined yet, | ||||
1542 | # the return value is also "-1". | ||||
1543 | ########################################################################## | ||||
1544 | |||||
1545 | sub get_customaction_position | ||||
1546 | # spent 1.34s (1.02+324ms) within installer::windows::idtglobal::get_customaction_position which was called 2943 times, avg 457µs/call:
# 2943 times (1.02s+324ms) by installer::windows::idtglobal::set_positions_in_table at line 1635, avg 457µs/call | ||||
1547 | 2943 | 3.00ms | my ($action, $sequencetable) = @_; | ||
1548 | |||||
1549 | 2943 | 1.24ms | my $position = -1; | ||
1550 | |||||
1551 | 2943 | 185ms | for ( my $i = 0; $i <= $#{$sequencetable}; $i++ ) | ||
1552 | { | ||||
1553 | 126004 | 79.4ms | my $line = ${$sequencetable}[$i]; | ||
1554 | |||||
1555 | 126004 | 826ms | 126004 | 324ms | if ( $line =~ /^\s*([\w\.]+)\t.*\t\s*(\d+)\s$/ ) # matching only, if position is a number! # spent 324ms making 126004 calls to installer::windows::idtglobal::CORE:match, avg 3µs/call |
1556 | { | ||||
1557 | 111398 | 103ms | my $compareaction = $1; | ||
1558 | 111398 | 73.9ms | my $localposition = $2; | ||
1559 | |||||
1560 | 111398 | 60.4ms | if ( $compareaction eq $action ) | ||
1561 | { | ||||
1562 | 2289 | 1.01ms | $position = $localposition; | ||
1563 | 2289 | 2.12ms | last; | ||
1564 | } | ||||
1565 | } | ||||
1566 | } | ||||
1567 | |||||
1568 | 2943 | 14.4ms | return $position; | ||
1569 | } | ||||
1570 | |||||
1571 | ########################################################################## | ||||
1572 | # Setting the position of CustomActions in sequence tables. | ||||
1573 | # Replacing all occurrences of "POSITIONTEMPLATE_" | ||||
1574 | ########################################################################## | ||||
1575 | |||||
1576 | sub set_positions_in_table | ||||
1577 | # spent 2.04s (423ms+1.62) within installer::windows::idtglobal::set_positions_in_table which was called 327 times, avg 6.25ms/call:
# 109 times (297ms+1.37s) by installer::windows::idtglobal::addcustomactions at line 1796, avg 15.3ms/call
# 109 times (93.5ms+214ms) by installer::windows::idtglobal::addcustomactions at line 1797, avg 2.82ms/call
# 109 times (32.4ms+37.3ms) by installer::windows::idtglobal::addcustomactions at line 1798, avg 639µs/call | ||||
1578 | 327 | 595µs | my ( $sequencetable, $tablename ) = @_; | ||
1579 | |||||
1580 | 327 | 424µs | my $infoline = "\nSetting positions in table \"$tablename\".\n"; | ||
1581 | 327 | 490µs | push(@installer::globals::logfileinfo, $infoline); | ||
1582 | |||||
1583 | # Step 1: Resolving all occurrences of "POSITIONTEMPLATE_end" | ||||
1584 | |||||
1585 | 327 | 1.31ms | 327 | 170ms | my $lastposition = get_last_position_in_sequencetable($sequencetable); # spent 170ms making 327 calls to installer::windows::idtglobal::get_last_position_in_sequencetable, avg 521µs/call |
1586 | |||||
1587 | 327 | 18.1ms | for ( my $i = 0; $i <= $#{$sequencetable}; $i++ ) | ||
1588 | { | ||||
1589 | 16350 | 65.2ms | 16350 | 12.0ms | if ( ${$sequencetable}[$i] =~ /^\s*([\w\.]+)\t.*\t\s*POSITIONTEMPLATE_end\s*$/ ) # spent 12.0ms making 16350 calls to installer::windows::idtglobal::CORE:match, avg 731ns/call |
1590 | { | ||||
1591 | 1308 | 1.47ms | my $customaction = $1; | ||
1592 | 1308 | 808µs | $lastposition = $lastposition + 25; | ||
1593 | 1308 | 8.42ms | 1308 | 3.53ms | ${$sequencetable}[$i] =~ s/POSITIONTEMPLATE_end/$lastposition/; # spent 3.53ms making 1308 calls to installer::windows::idtglobal::CORE:subst, avg 3µs/call |
1594 | 1308 | 1.33ms | $infoline = "Setting position \"$lastposition\" for custom action \"$customaction\".\n"; | ||
1595 | 1308 | 1.92ms | push(@installer::globals::logfileinfo, $infoline); | ||
1596 | } | ||||
1597 | } | ||||
1598 | |||||
1599 | # Step 2: Resolving all occurrences of "POSITIONTEMPLATE_abc" or "POSITIONTEMPLATE_behind_abc" | ||||
1600 | # where abc is the name of the reference Custom Action. | ||||
1601 | # This has to be done, until there is no more occurrence of POSITIONTEMPLATE (success) | ||||
1602 | # or there is no replacement in one circle (failure). | ||||
1603 | |||||
1604 | 327 | 186µs | my $template_exists = 0; | ||
1605 | 327 | 124µs | my $template_replaced = 0; | ||
1606 | 327 | 140µs | my $counter = 0; | ||
1607 | |||||
1608 | do | ||||
1609 | 327 | 1.18ms | { | ||
1610 | 872 | 350µs | $template_exists = 0; | ||
1611 | 872 | 309µs | $template_replaced = 0; | ||
1612 | 872 | 342µs | $counter++; | ||
1613 | |||||
1614 | 872 | 51.8ms | for ( my $i = 0; $i <= $#{$sequencetable}; $i++ ) | ||
1615 | { | ||||
1616 | 47197 | 192ms | 47197 | 38.9ms | if ( ${$sequencetable}[$i] =~ /^\s*([\w\.]+)\t.*\t\s*(POSITIONTEMPLATE_.*?)\s*$/ ) # spent 38.9ms making 47197 calls to installer::windows::idtglobal::CORE:match, avg 824ns/call |
1617 | { | ||||
1618 | 2943 | 3.55ms | my $onename = $1; | ||
1619 | 2943 | 2.30ms | my $templatename = $2; | ||
1620 | 2943 | 1.52ms | my $positionname = $templatename; | ||
1621 | 2943 | 1.40ms | my $customaction = $templatename; | ||
1622 | 2943 | 16.7ms | 2943 | 6.37ms | $customaction =~ s/POSITIONTEMPLATE_//; # spent 6.37ms making 2943 calls to installer::windows::idtglobal::CORE:subst, avg 2µs/call |
1623 | 2943 | 1.27ms | $template_exists = 1; | ||
1624 | |||||
1625 | # Trying to find the correct number. | ||||
1626 | # This can fail, if the custom action has no number | ||||
1627 | |||||
1628 | 2943 | 1.20ms | my $setbehind = 0; | ||
1629 | 2943 | 11.3ms | 2943 | 2.11ms | if ( $customaction =~ /^\s*behind_(.*?)\s*$/ ) # spent 2.11ms making 2943 calls to installer::windows::idtglobal::CORE:match, avg 716ns/call |
1630 | { | ||||
1631 | $customaction = $1; | ||||
1632 | $setbehind = 1; | ||||
1633 | } | ||||
1634 | |||||
1635 | 2943 | 9.58ms | 2943 | 1.34s | my $position = get_customaction_position($customaction, $sequencetable); # spent 1.34s making 2943 calls to installer::windows::idtglobal::get_customaction_position, avg 457µs/call |
1636 | |||||
1637 | 2943 | 5.06ms | if ( $position >= 0 ) # Found CustomAction and is has a position. Otherwise return value is "-1". | ||
1638 | { | ||||
1639 | 2289 | 1.02ms | my $newposition = 0; | ||
1640 | 2289 | 1.85ms | if ( $setbehind ) { $newposition = $position + 2; } | ||
1641 | 2289 | 1.58ms | else { $newposition = $position - 2; } | ||
1642 | 2289 | 52.2ms | 4578 | 35.9ms | ${$sequencetable}[$i] =~ s/$templatename/$newposition/; # spent 29.6ms making 2289 calls to installer::windows::idtglobal::CORE:regcomp, avg 13µs/call
# spent 6.29ms making 2289 calls to installer::windows::idtglobal::CORE:subst, avg 3µs/call |
1643 | 2289 | 1.10ms | $template_replaced = 1; | ||
1644 | 2289 | 3.61ms | $infoline = "Setting position \"$newposition\" for custom action \"$onename\" (scp: \"$positionname\" at position $position).\n"; | ||
1645 | 2289 | 3.84ms | push(@installer::globals::logfileinfo, $infoline); | ||
1646 | } | ||||
1647 | else | ||||
1648 | { | ||||
1649 | 654 | 893µs | $infoline = "Could not assign position for custom action \"$onename\" yet (scp: \"$positionname\").\n"; | ||
1650 | 654 | 906µs | push(@installer::globals::logfileinfo, $infoline); | ||
1651 | } | ||||
1652 | } | ||||
1653 | } | ||||
1654 | } while (( $template_exists ) && ( $template_replaced )); | ||||
1655 | |||||
1656 | # An error occurred, because templates still exist, but could not be replaced. | ||||
1657 | # Reason: | ||||
1658 | # 1. Wrong name of CustomAction in scp2 (typo?) | ||||
1659 | # 2. Circular dependencies of CustomActions (A after B and B after A) | ||||
1660 | |||||
1661 | # Problem: It is allowed, that a CustomAction is defined in scp2 in a library that is | ||||
1662 | # part of product ABC, but this CustomAction is not used in this product | ||||
1663 | # and the reference CustomAction is not part of this product. | ||||
1664 | # Therefore this cannot be an error, but only produce a warning. The assigned number | ||||
1665 | # must be the last sequence number. | ||||
1666 | |||||
1667 | 327 | 1.93ms | if (( $template_exists ) && ( ! $template_replaced )) | ||
1668 | { | ||||
1669 | 109 | 11.3ms | for ( my $i = 0; $i <= $#{$sequencetable}; $i++ ) | ||
1670 | { | ||||
1671 | 10464 | 38.8ms | 10464 | 5.87ms | if ( ${$sequencetable}[$i] =~ /^\s*([\w\.]+)\t.*\t\s*(POSITIONTEMPLATE_.*?)\s*$/ ) # spent 5.87ms making 10464 calls to installer::windows::idtglobal::CORE:match, avg 561ns/call |
1672 | { | ||||
1673 | 109 | 170µs | my $customactionname = $1; | ||
1674 | 109 | 120µs | my $fulltemplate = $2; | ||
1675 | 109 | 109µs | my $template = $fulltemplate; | ||
1676 | 109 | 814µs | 109 | 297µs | $template =~ s/POSITIONTEMPLATE_//; # spent 297µs making 109 calls to installer::windows::idtglobal::CORE:subst, avg 3µs/call |
1677 | 109 | 115µs | $lastposition = $lastposition + 25; | ||
1678 | 109 | 1.27ms | 218 | 406µs | ${$sequencetable}[$i] =~ s/$fulltemplate/$lastposition/; # spent 314µs making 109 calls to installer::windows::idtglobal::CORE:subst, avg 3µs/call
# spent 92µs making 109 calls to installer::windows::idtglobal::CORE:regcomp, avg 847ns/call |
1679 | 109 | 190µs | $infoline = "WARNING: Setting position \"$lastposition\" for custom action \"$customactionname\". Could not find CustomAction \"$template\".\n"; | ||
1680 | 109 | 199µs | push(@installer::globals::logfileinfo, $infoline); | ||
1681 | } | ||||
1682 | } | ||||
1683 | } | ||||
1684 | } | ||||
1685 | |||||
1686 | ########################################################################## | ||||
1687 | # Setting the Windows custom actions into different tables | ||||
1688 | # CustomAc.idt, InstallE.idt, InstallU.idt, ControlE.idt, ControlC.idt | ||||
1689 | ########################################################################## | ||||
1690 | |||||
1691 | sub addcustomactions | ||||
1692 | # spent 132s (447ms+131) within installer::windows::idtglobal::addcustomactions which was called 109 times, avg 1.21s/call:
# 109 times (447ms+131s) by installer::run at line 1665 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 1.21s/call | ||||
1693 | 109 | 305µs | my ($languageidtdir, $customactions, $filesarray) = @_; | ||
1694 | |||||
1695 | 109 | 602µs | 109 | 21.5ms | installer::logger::include_timestamp_into_logfile("\nPerformance Info: addcustomactions start\n"); # spent 21.5ms making 109 calls to installer::logger::include_timestamp_into_logfile, avg 197µs/call |
1696 | |||||
1697 | 109 | 180µs | my $customactionidttablename = $languageidtdir . $installer::globals::separator . "CustomAc.idt"; | ||
1698 | 109 | 396µs | 109 | 40.4ms | my $customactionidttable = installer::files::read_file($customactionidttablename); # spent 40.4ms making 109 calls to installer::files::read_file, avg 371µs/call |
1699 | 109 | 191µs | my $installexecutetablename = $languageidtdir . $installer::globals::separator . "InstallE.idt"; | ||
1700 | 109 | 389µs | 109 | 63.7ms | my $installexecutetable = installer::files::read_file($installexecutetablename); # spent 63.7ms making 109 calls to installer::files::read_file, avg 585µs/call |
1701 | 109 | 199µs | my $adminexecutetablename = $languageidtdir . $installer::globals::separator . "AdminExe.idt"; | ||
1702 | 109 | 391µs | 109 | 38.3ms | my $adminexecutetable = installer::files::read_file($adminexecutetablename); # spent 38.3ms making 109 calls to installer::files::read_file, avg 352µs/call |
1703 | 109 | 247µs | my $installuitablename = $languageidtdir . $installer::globals::separator . "InstallU.idt"; | ||
1704 | 109 | 401µs | 109 | 46.5ms | my $installuitable = installer::files::read_file($installuitablename); # spent 46.5ms making 109 calls to installer::files::read_file, avg 427µs/call |
1705 | 109 | 214µs | my $controleventtablename = $languageidtdir . $installer::globals::separator . "ControlE.idt"; | ||
1706 | 109 | 417µs | 109 | 95.5ms | my $controleventtable = installer::files::read_file($controleventtablename); # spent 95.5ms making 109 calls to installer::files::read_file, avg 876µs/call |
1707 | 109 | 207µs | my $controlconditiontablename = $languageidtdir . $installer::globals::separator . "ControlC.idt"; | ||
1708 | 109 | 408µs | 109 | 62.9ms | my $controlconditiontable = installer::files::read_file($controlconditiontablename); # spent 62.9ms making 109 calls to installer::files::read_file, avg 577µs/call |
1709 | |||||
1710 | # Iterating over all Windows custom actions | ||||
1711 | |||||
1712 | 109 | 13.7ms | for ( my $i = 0; $i <= $#{$customactions}; $i++ ) | ||
1713 | { | ||||
1714 | 4360 | 8.53ms | my $customaction = ${$customactions}[$i]; | ||
1715 | 4360 | 9.04ms | my $name = $customaction->{'Name'}; | ||
1716 | 4360 | 5.40ms | my $typ = $customaction->{'Typ'}; | ||
1717 | 4360 | 4.32ms | my $source = $customaction->{'Source'}; | ||
1718 | 4360 | 5.78ms | my $target = $customaction->{'Target'}; | ||
1719 | 4360 | 4.06ms | my $inbinarytable = $customaction->{'Inbinarytable'}; | ||
1720 | 4360 | 5.33ms | my $gid = $customaction->{'gid'}; | ||
1721 | |||||
1722 | 4360 | 3.64ms | my $styles = ""; | ||
1723 | 4360 | 4.38ms | if ( $customaction->{'Styles'} ) { $styles = $customaction->{'Styles'}; } | ||
1724 | |||||
1725 | 4360 | 34.2ms | 4360 | 115s | my $added_customaction = set_custom_action($customactionidttable, $name, $typ, $source, $target, $inbinarytable, $filesarray, $customactionidttablename, $styles); # spent 115s making 4360 calls to installer::windows::idtglobal::set_custom_action, avg 26.3ms/call |
1726 | |||||
1727 | 4360 | 18.2ms | if ( $added_customaction ) | ||
1728 | { | ||||
1729 | # If the CustomAction was added into the CustomAc.idt, it can be connected to the installation. | ||||
1730 | # There are currently two different ways for doing this: | ||||
1731 | # 1. Using "add_custom_action_to_install_table", which adds the CustomAction to the install sequences, | ||||
1732 | # which are saved in InstallE.idt and InstallU.idt | ||||
1733 | # 2. Using "connect_custom_action_to_control" and "connect_custom_action_to_control". The first method | ||||
1734 | # connects a CustomAction to a control in ControlE.idt. The second method sets a condition for a control, | ||||
1735 | # which might be influenced by the CustomAction. This happens in ControlC.idt. | ||||
1736 | |||||
1737 | # Any Windows CustomAction can have a lot of different assignments. | ||||
1738 | |||||
1739 | 3052 | 16.0ms | for ( my $j = 1; $j <= 50; $j++ ) | ||
1740 | { | ||||
1741 | 7303 | 18.3ms | my $key = "Assignment" . $j; | ||
1742 | 7303 | 4.14ms | my $value = ""; | ||
1743 | 7303 | 17.2ms | if ( $customaction->{$key} ) | ||
1744 | { | ||||
1745 | 4251 | 3.77ms | $value = $customaction->{$key}; | ||
1746 | |||||
1747 | # in a patch the Assignment can be overwritten by a PatchAssignment | ||||
1748 | 4251 | 4.35ms | if ( $installer::globals::patch ) | ||
1749 | { | ||||
1750 | $patchkey = "PatchAssignment" . $j; | ||||
1751 | if ( $customaction->{$patchkey} ) | ||||
1752 | { | ||||
1753 | $value = $customaction->{$patchkey}; | ||||
1754 | $key = $patchkey; | ||||
1755 | } | ||||
1756 | } | ||||
1757 | |||||
1758 | } | ||||
1759 | 3052 | 3.41ms | else { last; } | ||
1760 | |||||
1761 | # $value is now a comma separated list | ||||
1762 | 4251 | 109ms | 4251 | 59.2ms | if ( $value =~ /^\s*\(\s*(.*)\s*\);?\s*$/ ) { $value = $1; } # spent 59.2ms making 4251 calls to installer::windows::idtglobal::CORE:match, avg 14µs/call |
1763 | 4251 | 38.6ms | 4251 | 140ms | my $assignmentarray = installer::converter::convert_stringlist_into_array(\$value, ","); # spent 140ms making 4251 calls to installer::converter::convert_stringlist_into_array, avg 33µs/call |
1764 | 4251 | 18.7ms | 4251 | 923ms | my $assignment = create_customaction_assignment_hash($gid, $name, $key, $assignmentarray); # spent 923ms making 4251 calls to installer::windows::idtglobal::create_customaction_assignment_hash, avg 217µs/call |
1765 | |||||
1766 | 4251 | 59.5ms | 4251 | 12.8s | if ( $assignment->{'parameter1'} eq "InstallExecuteSequence" ) # spent 12.8s making 3706 calls to installer::windows::idtglobal::add_custom_action_to_install_table, avg 3.45ms/call
# spent 20.3ms making 545 calls to installer::windows::idtglobal::connect_custom_action_to_control, avg 37µs/call |
1767 | { | ||||
1768 | add_custom_action_to_install_table($installexecutetable, $source, $name, $assignment->{'parameter2'}, $assignment->{'parameter3'}, $filesarray, $installexecutetablename, $styles); | ||||
1769 | } | ||||
1770 | elsif ( $assignment->{'parameter1'} eq "AdminExecuteSequence" ) | ||||
1771 | { | ||||
1772 | add_custom_action_to_install_table($adminexecutetable, $source, $name, $assignment->{'parameter2'}, $assignment->{'parameter3'}, $filesarray, $adminexecutetablename, $styles); | ||||
1773 | } | ||||
1774 | elsif ( $assignment->{'parameter1'} eq "InstallUISequence" ) | ||||
1775 | { | ||||
1776 | add_custom_action_to_install_table($installuitable, $source, $name, $assignment->{'parameter2'}, $assignment->{'parameter3'}, $filesarray, $installuitablename, $styles); | ||||
1777 | } | ||||
1778 | elsif ( $assignment->{'parameter1'} eq "ControlEvent" ) | ||||
1779 | { | ||||
1780 | connect_custom_action_to_control($controleventtable, $controleventtablename, $assignment->{'parameter2'}, $assignment->{'parameter3'}, $assignment->{'parameter4'}, $assignment->{'parameter5'}, $assignment->{'parameter6'}, $assignment->{'parameter7'}); | ||||
1781 | } | ||||
1782 | elsif ( $assignment->{'parameter1'} eq "ControlCondition" ) | ||||
1783 | { | ||||
1784 | connect_condition_to_control($controlconditiontable, $controlconditiontablename, $assignment->{'parameter2'}, $assignment->{'parameter3'}, $assignment->{'parameter4'}, $assignment->{'parameter5'}); | ||||
1785 | } | ||||
1786 | else | ||||
1787 | { | ||||
1788 | installer::exiter::exit_program("ERROR: gid: $gid, key: $key ! Unknown Windows CustomAction table: $assignmenthashref->{'parameter1'} ! Currently supported: InstallUISequence, InstallESequence, ControlEvent, ControlCondition", "addcustomactions"); | ||||
1789 | } | ||||
1790 | } | ||||
1791 | } | ||||
1792 | } | ||||
1793 | |||||
1794 | # Setting the positions in the tables | ||||
1795 | |||||
1796 | 109 | 742µs | 109 | 1.67s | set_positions_in_table($installexecutetable, $installexecutetablename); # spent 1.67s making 109 calls to installer::windows::idtglobal::set_positions_in_table, avg 15.3ms/call |
1797 | 109 | 330µs | 109 | 308ms | set_positions_in_table($installuitable, $installuitablename); # spent 308ms making 109 calls to installer::windows::idtglobal::set_positions_in_table, avg 2.82ms/call |
1798 | 109 | 306µs | 109 | 69.6ms | set_positions_in_table($adminexecutetable, $adminexecutetablename); # spent 69.6ms making 109 calls to installer::windows::idtglobal::set_positions_in_table, avg 639µs/call |
1799 | |||||
1800 | # Saving the files | ||||
1801 | |||||
1802 | 109 | 621µs | 109 | 88.7ms | installer::files::save_file($customactionidttablename, $customactionidttable); # spent 88.7ms making 109 calls to installer::files::save_file, avg 814µs/call |
1803 | 109 | 489µs | 109 | 47.3ms | installer::files::save_file($installexecutetablename, $installexecutetable); # spent 47.3ms making 109 calls to installer::files::save_file, avg 434µs/call |
1804 | 109 | 427µs | 109 | 44.8ms | installer::files::save_file($adminexecutetablename, $adminexecutetable); # spent 44.8ms making 109 calls to installer::files::save_file, avg 411µs/call |
1805 | 109 | 454µs | 109 | 43.3ms | installer::files::save_file($installuitablename, $installuitable); # spent 43.3ms making 109 calls to installer::files::save_file, avg 397µs/call |
1806 | 109 | 448µs | 109 | 50.7ms | installer::files::save_file($controleventtablename, $controleventtable); # spent 50.7ms making 109 calls to installer::files::save_file, avg 465µs/call |
1807 | 109 | 477µs | 109 | 45.5ms | installer::files::save_file($controlconditiontablename, $controlconditiontable); # spent 45.5ms making 109 calls to installer::files::save_file, avg 418µs/call |
1808 | |||||
1809 | 109 | 251µs | my $infoline = "Updated idt file: $customactionidttablename\n"; | ||
1810 | 109 | 228µs | push(@installer::globals::logfileinfo, $infoline); | ||
1811 | 109 | 132µs | $infoline = "Updated idt file: $installexecutetablename\n"; | ||
1812 | 109 | 125µs | push(@installer::globals::logfileinfo, $infoline); | ||
1813 | 109 | 107µs | $infoline = "Updated idt file: $adminexecutetablename\n"; | ||
1814 | 109 | 133µs | push(@installer::globals::logfileinfo, $infoline); | ||
1815 | 109 | 144µs | $infoline = "Updated idt file: $installuitablename\n"; | ||
1816 | 109 | 125µs | push(@installer::globals::logfileinfo, $infoline); | ||
1817 | 109 | 106µs | $infoline = "Updated idt file: $controleventtablename\n"; | ||
1818 | 109 | 128µs | push(@installer::globals::logfileinfo, $infoline); | ||
1819 | 109 | 131µs | $infoline = "Updated idt file: $controlconditiontablename\n"; | ||
1820 | 109 | 140µs | push(@installer::globals::logfileinfo, $infoline); | ||
1821 | |||||
1822 | 109 | 17.9ms | 109 | 19.9ms | installer::logger::include_timestamp_into_logfile("\nPerformance Info: addcustomactions end\n"); # spent 19.9ms making 109 calls to installer::logger::include_timestamp_into_logfile, avg 183µs/call |
1823 | } | ||||
1824 | |||||
1825 | ########################################################################## | ||||
1826 | # Setting bidi attributes in idt tables | ||||
1827 | ########################################################################## | ||||
1828 | |||||
1829 | sub setbidiattributes | ||||
1830 | # spent 43.9ms (25.8+18.2) within installer::windows::idtglobal::setbidiattributes which was called 4 times, avg 11.0ms/call:
# 4 times (25.8ms+18.2ms) by installer::run at line 1612 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 11.0ms/call | ||||
1831 | 4 | 16µs | my ($languageidtdir, $onelanguage) = @_; | ||
1832 | |||||
1833 | # Editing the files Dialog.idt and Control.idt | ||||
1834 | |||||
1835 | 4 | 14µs | my $dialogfilename = $languageidtdir . $installer::globals::separator . "Dialog.idt"; | ||
1836 | 4 | 8µs | my $controlfilename = $languageidtdir . $installer::globals::separator . "Control.idt"; | ||
1837 | |||||
1838 | 4 | 15µs | 4 | 1.79ms | my $dialogfile = installer::files::read_file($dialogfilename); # spent 1.79ms making 4 calls to installer::files::read_file, avg 448µs/call |
1839 | 4 | 14µs | 4 | 6.30ms | my $controlfile = installer::files::read_file($controlfilename); # spent 6.30ms making 4 calls to installer::files::read_file, avg 1.58ms/call |
1840 | |||||
1841 | # Searching attributes in Dialog.idt and adding "896". | ||||
1842 | # Attributes are in column 6 (from 10). | ||||
1843 | |||||
1844 | 4 | 4µs | my $bidiattribute = 896; | ||
1845 | 4 | 180µs | for ( my $i = 0; $i <= $#{$dialogfile}; $i++ ) | ||
1846 | { | ||||
1847 | 144 | 72µs | if ( $i < 3 ) { next; } | ||
1848 | 120 | 1.27ms | 120 | 722µs | if ( ${$dialogfile}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ ) # spent 722µs making 120 calls to installer::windows::idtglobal::CORE:match, avg 6µs/call |
1849 | { | ||||
1850 | 120 | 133µs | my $one = $1; | ||
1851 | 120 | 91µs | my $two = $2; | ||
1852 | 120 | 83µs | my $three = $3; | ||
1853 | 120 | 79µs | my $four = $4; | ||
1854 | 120 | 76µs | my $five = $5; | ||
1855 | 120 | 78µs | my $attribute = $6; | ||
1856 | 120 | 101µs | my $seven = $7; | ||
1857 | 120 | 89µs | my $eight = $8; | ||
1858 | 120 | 104µs | $attribute = $attribute + $bidiattribute; | ||
1859 | 120 | 360µs | ${$dialogfile}[$i] = "$one\t$two\t$three\t$four\t$five\t$attribute\t$seven\t$eight\n"; | ||
1860 | } | ||||
1861 | } | ||||
1862 | |||||
1863 | # Searching attributes in Control.idt and adding "224". | ||||
1864 | # Attributes are in column 8 (from 12). | ||||
1865 | |||||
1866 | 4 | 3µs | $bidiattribute = 224; | ||
1867 | 4 | 1.58ms | for ( my $i = 0; $i <= $#{$controlfile}; $i++ ) | ||
1868 | { | ||||
1869 | 1268 | 552µs | if ( $i < 3 ) { next; } | ||
1870 | 1244 | 10.8ms | 1244 | 5.37ms | if ( ${$controlfile}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ ) # spent 5.37ms making 1244 calls to installer::windows::idtglobal::CORE:match, avg 4µs/call |
1871 | { | ||||
1872 | 1244 | 1.25ms | my $one = $1; | ||
1873 | 1244 | 913µs | my $two = $2; | ||
1874 | 1244 | 898µs | my $three = $3; | ||
1875 | 1244 | 788µs | my $four = $4; | ||
1876 | 1244 | 757µs | my $five = $5; | ||
1877 | 1244 | 775µs | my $six = $6; | ||
1878 | 1244 | 791µs | my $seven = $7; | ||
1879 | 1244 | 887µs | my $attribute = $8; | ||
1880 | 1244 | 856µs | my $nine = $9; | ||
1881 | 1244 | 911µs | my $ten = $10; | ||
1882 | 1244 | 866µs | my $eleven = $11; | ||
1883 | 1244 | 766µs | my $twelve = $12; | ||
1884 | 1244 | 877µs | $attribute = $attribute + $bidiattribute; | ||
1885 | 1244 | 4.26ms | ${$controlfile}[$i] = "$one\t$two\t$three\t$four\t$five\t$six\t$seven\t$attribute\t$nine\t$ten\t$eleven\t$twelve\n"; | ||
1886 | } | ||||
1887 | } | ||||
1888 | |||||
1889 | # Saving the file | ||||
1890 | |||||
1891 | 4 | 22µs | 4 | 2.01ms | installer::files::save_file($dialogfilename, $dialogfile); # spent 2.01ms making 4 calls to installer::files::save_file, avg 502µs/call |
1892 | 4 | 13µs | $infoline = "Set bidi support in idt file \"$dialogfilename\" for language $onelanguage\n"; | ||
1893 | 4 | 9µs | push(@installer::globals::logfileinfo, $infoline); | ||
1894 | |||||
1895 | 4 | 14µs | 4 | 1.97ms | installer::files::save_file($controlfilename, $controlfile); # spent 1.97ms making 4 calls to installer::files::save_file, avg 494µs/call |
1896 | 4 | 11µs | $infoline = "Set bidi support in idt file \"$controlfilename\" for language $onelanguage\n"; | ||
1897 | 4 | 472µs | push(@installer::globals::logfileinfo, $infoline); | ||
1898 | } | ||||
1899 | |||||
1900 | 1 | 9µs | 1; | ||
# spent 27.0ms within installer::windows::idtglobal::CORE:ftdir which was called 218 times, avg 124µs/call:
# 109 times (18.9ms+0s) by installer::windows::idtglobal::prepare_language_idt_directory at line 784, avg 173µs/call
# 109 times (8.17ms+0s) by installer::windows::idtglobal::prepare_language_idt_directory at line 759, avg 75µs/call | |||||
# spent 321s within installer::windows::idtglobal::CORE:match which was called 492176334 times, avg 651ns/call:
# 481707115 times (310s+0s) by installer::windows::idtglobal::get_language_block_from_language_file at line 629, avg 644ns/call
# 6521361 times (6.26s+0s) by installer::windows::idtglobal::get_language_block_from_language_file at line 639, avg 959ns/call
# 3284169 times (2.50s+0s) by installer::windows::idtglobal::get_language_string_from_language_block at line 662, avg 762ns/call
# 202522 times (278ms+0s) by installer::windows::idtglobal::make_eight_three_conform at line 162, avg 1µs/call
# 126004 times (324ms+0s) by installer::windows::idtglobal::get_customaction_position at line 1555, avg 3µs/call
# 72267 times (241ms+0s) by installer::windows::idtglobal::translate_idtfile at line 723, avg 3µs/call
# 58752 times (104ms+0s) by installer::windows::idtglobal::get_language_block_from_language_file at line 636, avg 2µs/call
# 58315 times (50.5ms+0s) by installer::windows::idtglobal::translate_idtfile at line 727, avg 866ns/call
# 47197 times (38.9ms+0s) by installer::windows::idtglobal::set_positions_in_table at line 1616, avg 824ns/call
# 16350 times (41.1ms+0s) by installer::windows::idtglobal::get_last_position_in_sequencetable at line 948, avg 3µs/call
# 16350 times (12.0ms+0s) by installer::windows::idtglobal::set_positions_in_table at line 1589, avg 731ns/call
# 15888 times (59.7ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 274, avg 4µs/call
# 15542 times (53.2ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 280, avg 3µs/call
# 10464 times (5.87ms+0s) by installer::windows::idtglobal::set_positions_in_table at line 1671, avg 561ns/call
# 4360 times (5.85ms+0s) by installer::windows::idtglobal::set_custom_action at line 1018, avg 1µs/call
# 4251 times (59.2ms+0s) by installer::windows::idtglobal::addcustomactions at line 1762, avg 14µs/call
# 3706 times (13.9ms+0s) by installer::windows::idtglobal::add_custom_action_to_install_table at line 1154, avg 4µs/call
# 3706 times (13.9ms+0s) by installer::windows::idtglobal::add_custom_action_to_install_table at line 1133, avg 4µs/call
# 3706 times (3.03ms+0s) by installer::windows::idtglobal::add_custom_action_to_install_table at line 1095, avg 818ns/call
# 2943 times (2.11ms+0s) by installer::windows::idtglobal::set_positions_in_table at line 1629, avg 716ns/call
# 1244 times (5.37ms+0s) by installer::windows::idtglobal::setbidiattributes at line 1870, avg 4µs/call
# 120 times (722µs+0s) by installer::windows::idtglobal::setbidiattributes at line 1848, avg 6µs/call
# 2 times (6µs+0s) by installer::windows::idtglobal::get_language_string_from_language_block at line 675, avg 3µs/call | |||||
# spent 385s within installer::windows::idtglobal::CORE:regcomp which was called 485110314 times, avg 793ns/call:
# 481707115 times (380s+0s) by installer::windows::idtglobal::get_language_block_from_language_file at line 629, avg 790ns/call
# 3284169 times (2.55s+0s) by installer::windows::idtglobal::get_language_string_from_language_block at line 662, avg 777ns/call
# 58315 times (1.18s+0s) by installer::windows::idtglobal::translate_idtfile at line 737, avg 20µs/call
# 58315 times (714ms+0s) by installer::windows::idtglobal::translate_idtfile at line 727, avg 12µs/call
# 2289 times (29.6ms+0s) by installer::windows::idtglobal::set_positions_in_table at line 1642, avg 13µs/call
# 109 times (92µs+0s) by installer::windows::idtglobal::set_positions_in_table at line 1678, avg 847ns/call
# 2 times (18µs+0s) by installer::windows::idtglobal::get_language_string_from_language_block at line 675, avg 9µs/call | |||||
# spent 9.35ms within installer::windows::idtglobal::CORE:sort which was called 218 times, avg 43µs/call:
# 109 times (8.91ms+0s) by installer::windows::idtglobal::set_multilanguageonly_condition at line 1408, avg 82µs/call
# 109 times (442µs+0s) by installer::windows::idtglobal::set_multilanguageonly_condition at line 1427, avg 4µs/call | |||||
# spent 7.65s within installer::windows::idtglobal::CORE:subst which was called 9988397 times, avg 765ns/call:
# 6186404 times (3.61s+0s) by installer::windows::idtglobal::setencoding at line 1381, avg 584ns/call
# 375961 times (928ms+0s) by installer::windows::idtglobal::shorten_feature_gid at line 50, avg 2µs/call
# 375961 times (402ms+0s) by installer::windows::idtglobal::shorten_feature_gid at line 52, avg 1µs/call
# 375961 times (225ms+0s) by installer::windows::idtglobal::shorten_feature_gid at line 53, avg 599ns/call
# 375961 times (208ms+0s) by installer::windows::idtglobal::shorten_feature_gid at line 51, avg 554ns/call
# 375961 times (204ms+0s) by installer::windows::idtglobal::shorten_feature_gid at line 54, avg 541ns/call
# 375961 times (193ms+0s) by installer::windows::idtglobal::shorten_feature_gid at line 55, avg 513ns/call
# 375961 times (192ms+0s) by installer::windows::idtglobal::shorten_feature_gid at line 57, avg 512ns/call
# 375961 times (187ms+0s) by installer::windows::idtglobal::shorten_feature_gid at line 56, avg 498ns/call
# 375961 times (183ms+0s) by installer::windows::idtglobal::shorten_feature_gid at line 58, avg 487ns/call
# 58315 times (334ms+0s) by installer::windows::idtglobal::translate_idtfile at line 737, avg 6µs/call
# 58315 times (145ms+0s) by installer::windows::idtglobal::translate_idtfile at line 727, avg 2µs/call
# 45889 times (167ms+0s) by installer::windows::idtglobal::make_eight_three_conform at line 222, avg 4µs/call
# 45017 times (151ms+0s) by installer::windows::idtglobal::make_eight_three_conform at line 246, avg 3µs/call
# 35643 times (131ms+0s) by installer::windows::idtglobal::make_eight_three_conform at line 231, avg 4µs/call
# 24198 times (151ms+0s) by installer::windows::idtglobal::make_eight_three_conform at line 238, avg 6µs/call
# 15542 times (21.0ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 281, avg 1µs/call
# 14933 times (26.0ms+0s) by installer::windows::idtglobal::fill_assignment_hash at line 1468, avg 2µs/call
# 14933 times (9.00ms+0s) by installer::windows::idtglobal::fill_assignment_hash at line 1469, avg 603ns/call
# 14933 times (8.82ms+0s) by installer::windows::idtglobal::fill_assignment_hash at line 1470, avg 591ns/call
# 14933 times (8.51ms+0s) by installer::windows::idtglobal::set_multilanguageonly_condition at line 1420, avg 570ns/call
# 14933 times (7.99ms+0s) by installer::windows::idtglobal::set_multilanguageonly_condition at line 1439, avg 535ns/call
# 14933 times (7.36ms+0s) by installer::windows::idtglobal::fill_assignment_hash at line 1471, avg 493ns/call
# 14933 times (7.11ms+0s) by installer::windows::idtglobal::fill_assignment_hash at line 1472, avg 476ns/call
# 6229 times (20.9ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 301, avg 3µs/call
# 4612 times (14.5ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 310, avg 3µs/call
# 4360 times (32.7ms+0s) by installer::windows::idtglobal::set_custom_action at line 1032, avg 7µs/call
# 3706 times (5.66ms+0s) by installer::windows::idtglobal::add_custom_action_to_install_table at line 1145, avg 2µs/call
# 2943 times (6.37ms+0s) by installer::windows::idtglobal::set_positions_in_table at line 1622, avg 2µs/call
# 2496 times (7.58ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 319, avg 3µs/call
# 2289 times (6.29ms+0s) by installer::windows::idtglobal::set_positions_in_table at line 1642, avg 3µs/call
# 1308 times (3.53ms+0s) by installer::windows::idtglobal::set_positions_in_table at line 1593, avg 3µs/call
# 872 times (5.95ms+0s) by installer::windows::idtglobal::get_languagefilename at line 609, avg 7µs/call
# 545 times (9.83ms+0s) by installer::windows::idtglobal::connect_custom_action_to_control at line 1182, avg 18µs/call
# 337 times (1.50ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 348, avg 4µs/call
# 321 times (1.18ms+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 357, avg 4µs/call
# 222 times (795µs+0s) by installer::windows::idtglobal::make_eight_three_conform_with_hash at line 366, avg 4µs/call
# 109 times (18.1ms+0s) by installer::windows::idtglobal::set_multilanguageonly_condition at line 1414, avg 166µs/call
# 109 times (1.12ms+0s) by installer::windows::idtglobal::set_multilanguageonly_condition at line 1433, avg 10µs/call
# 109 times (925µs+0s) by installer::windows::idtglobal::set_multilanguageonly_condition at line 1413, avg 8µs/call
# 109 times (336µs+0s) by installer::windows::idtglobal::set_multilanguageonly_condition at line 1432, avg 3µs/call
# 109 times (314µs+0s) by installer::windows::idtglobal::set_positions_in_table at line 1678, avg 3µs/call
# 109 times (297µs+0s) by installer::windows::idtglobal::set_positions_in_table at line 1676, avg 3µs/call |