Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm |
Statements | Executed 6887505 statements in 1450s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
166402 | 2 | 1 | 931s | 931s | CORE:readline (opcode) | installer::windows::msiglobal::
438 | 8 | 1 | 457s | 457s | CORE:system (opcode) | installer::windows::msiglobal::
219 | 3 | 1 | 36.7s | 36.7s | CORE:open (opcode) | installer::windows::msiglobal::
109 | 1 | 1 | 13.7s | 25.6s | set_uuid_into_component_table | installer::windows::msiglobal::
1021265 | 16 | 1 | 4.07s | 4.07s | CORE:subst (opcode) | installer::windows::msiglobal::
1083306 | 15 | 1 | 2.67s | 2.67s | CORE:match (opcode) | installer::windows::msiglobal::
1 | 1 | 1 | 383ms | 712ms | save_packorder | installer::windows::msiglobal::
1 | 1 | 1 | 355ms | 4.15s | generate_cab_file_list | installer::windows::msiglobal::
15921 | 2 | 1 | 266ms | 347ms | make_relative_ddf_path | installer::windows::msiglobal::
9060 | 1 | 1 | 259ms | 380ms | calculate_guid | installer::windows::msiglobal::
217 | 3 | 1 | 210ms | 210ms | CORE:unlink (opcode) | installer::windows::msiglobal::
219 | 3 | 1 | 196ms | 196ms | CORE:close (opcode) | installer::windows::msiglobal::
326 | 3 | 1 | 66.7ms | 66.7ms | CORE:ftfile (opcode) | installer::windows::msiglobal::
1 | 1 | 1 | 51.1ms | 51.1ms | check_ddf_file | installer::windows::msiglobal::
221 | 7 | 1 | 42.5ms | 42.5ms | CORE:chdir (opcode) | installer::windows::msiglobal::
1 | 1 | 1 | 38.4ms | 39.7ms | put_msiproductversion_into_bootstrapfile | installer::windows::msiglobal::
1 | 1 | 1 | 35.3ms | 158s | create_transforms | installer::windows::msiglobal::
9060 | 1 | 1 | 34.0ms | 34.0ms | CORE:unpack (opcode) | installer::windows::msiglobal::
109 | 1 | 1 | 25.6ms | 103s | write_summary_into_msi_database | installer::windows::msiglobal::
436 | 4 | 1 | 24.8ms | 997ms | get_value_from_sis_lng | installer::windows::msiglobal::
108 | 1 | 1 | 19.1ms | 19.1ms | CORE:ftsize (opcode) | installer::windows::msiglobal::
110 | 2 | 1 | 15.1ms | 37.4s | get_guid_list | installer::windows::msiglobal::
109 | 1 | 1 | 12.8ms | 230s | create_msi_database | installer::windows::msiglobal::
15922 | 2 | 1 | 10.1ms | 10.1ms | CORE:regcomp (opcode) | installer::windows::msiglobal::
221 | 6 | 2 | 8.94ms | 12.4ms | get_msidatabasename | installer::windows::msiglobal::
109 | 1 | 1 | 8.73ms | 110ms | update_reglocat_table | installer::windows::msiglobal::
109 | 1 | 1 | 3.36ms | 37.3s | get_packagecode_for_sis | installer::windows::msiglobal::
3 | 3 | 1 | 2.80ms | 2.80ms | CORE:rename (opcode) | installer::windows::msiglobal::
109 | 1 | 1 | 2.12ms | 2.12ms | prepare_64bit_database | installer::windows::msiglobal::
109 | 1 | 1 | 2.06ms | 105ms | get_title_for_sis | installer::windows::msiglobal::
109 | 1 | 1 | 1.99ms | 2.96ms | get_template_for_sis | installer::windows::msiglobal::
109 | 1 | 1 | 1.72ms | 406ms | get_appname_for_sis | installer::windows::msiglobal::
109 | 1 | 1 | 1.60ms | 296ms | get_keywords_for_sis | installer::windows::msiglobal::
109 | 1 | 1 | 1.52ms | 3.19ms | get_codepage_for_sis | installer::windows::msiglobal::
109 | 1 | 1 | 1.51ms | 22.0ms | update_removere_table | installer::windows::msiglobal::
109 | 1 | 1 | 1.43ms | 197ms | get_comment_for_sis | installer::windows::msiglobal::
109 | 1 | 1 | 1.24ms | 1.24ms | get_subject_for_sis | installer::windows::msiglobal::
109 | 1 | 1 | 727µs | 727µs | get_author_for_sis | installer::windows::msiglobal::
109 | 1 | 1 | 597µs | 597µs | get_security_for_sis | installer::windows::msiglobal::
218 | 1 | 1 | 580µs | 580µs | CORE:substcont (opcode) | installer::windows::msiglobal::
109 | 1 | 1 | 551µs | 551µs | get_msiversion_for_sis | installer::windows::msiglobal::
109 | 1 | 1 | 509µs | 509µs | get_wordcount_for_sis | installer::windows::msiglobal::
108 | 1 | 1 | 436µs | 436µs | CORE:binmode (opcode) | installer::windows::msiglobal::
1 | 1 | 1 | 390µs | 489µs | BEGIN@30 | installer::windows::msiglobal::
1 | 1 | 1 | 280µs | 4.97s | include_cabs_into_msi | installer::windows::msiglobal::
1 | 1 | 1 | 143µs | 124ms | set_global_code_variables | installer::windows::msiglobal::
1 | 1 | 1 | 70µs | 71.8ms | rename_msi_database_in_installset | installer::windows::msiglobal::
1 | 1 | 1 | 58µs | 60µs | BEGIN@34 | installer::windows::msiglobal::
1 | 1 | 1 | 34µs | 34µs | write_ddf_file_header | installer::windows::msiglobal::
1 | 1 | 1 | 32µs | 43µs | set_msiproductversion | installer::windows::msiglobal::
1 | 1 | 1 | 17µs | 21µs | BEGIN@32 | installer::windows::msiglobal::
1 | 1 | 1 | 16µs | 18µs | BEGIN@42 | installer::windows::msiglobal::
1 | 1 | 1 | 16µs | 18µs | BEGIN@41 | installer::windows::msiglobal::
1 | 1 | 1 | 15µs | 43µs | BEGIN@36 | installer::windows::msiglobal::
1 | 1 | 1 | 15µs | 17µs | BEGIN@43 | installer::windows::msiglobal::
1 | 1 | 1 | 15µs | 17µs | BEGIN@39 | installer::windows::msiglobal::
1 | 1 | 1 | 15µs | 43µs | BEGIN@31 | installer::windows::msiglobal::
1 | 1 | 1 | 14µs | 16µs | BEGIN@33 | installer::windows::msiglobal::
1 | 1 | 1 | 14µs | 17µs | BEGIN@37 | installer::windows::msiglobal::
1 | 1 | 1 | 14µs | 16µs | BEGIN@40 | installer::windows::msiglobal::
1 | 1 | 1 | 14µs | 17µs | BEGIN@35 | installer::windows::msiglobal::
1 | 1 | 1 | 14µs | 16µs | BEGIN@38 | installer::windows::msiglobal::
0 | 0 | 0 | 0s | 0s | copy_merge_modules_into_installset | installer::windows::msiglobal::
0 | 0 | 0 | 0s | 0s | get_sequenceorder | installer::windows::msiglobal::
0 | 0 | 0 | 0s | 0s | read_saved_mappings | installer::windows::msiglobal::
1 | 1 | 1 | -857s | 73.7s | execute_packaging | installer::windows::msiglobal::
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::msiglobal; | ||||
29 | |||||
30 | 2 | 64µs | 2 | 588µs | # spent 489µs (390+99) within installer::windows::msiglobal::BEGIN@30 which was called:
# once (390µs+99µs) by installer::BEGIN@75 at line 30 # spent 489µs making 1 call to installer::windows::msiglobal::BEGIN@30
# spent 99µs making 1 call to Exporter::import |
31 | 2 | 57µs | 2 | 70µs | # spent 43µs (15+28) within installer::windows::msiglobal::BEGIN@31 which was called:
# once (15µs+28µs) by installer::BEGIN@75 at line 31 # spent 43µs making 1 call to installer::windows::msiglobal::BEGIN@31
# spent 28µs making 1 call to Exporter::import |
32 | 2 | 60µs | 2 | 24µs | # spent 21µs (17+3) within installer::windows::msiglobal::BEGIN@32 which was called:
# once (17µs+3µs) by installer::BEGIN@75 at line 32 # spent 21µs making 1 call to installer::windows::msiglobal::BEGIN@32
# spent 3µs making 1 call to UNIVERSAL::import |
33 | 2 | 53µs | 2 | 18µs | # spent 16µs (14+2) within installer::windows::msiglobal::BEGIN@33 which was called:
# once (14µs+2µs) by installer::BEGIN@75 at line 33 # spent 16µs making 1 call to installer::windows::msiglobal::BEGIN@33
# spent 2µs making 1 call to UNIVERSAL::import |
34 | 2 | 54µs | 2 | 63µs | # spent 60µs (58+3) within installer::windows::msiglobal::BEGIN@34 which was called:
# once (58µs+3µs) by installer::BEGIN@75 at line 34 # spent 60µs making 1 call to installer::windows::msiglobal::BEGIN@34
# spent 3µs making 1 call to UNIVERSAL::import |
35 | 2 | 53µs | 2 | 20µs | # spent 17µs (14+3) within installer::windows::msiglobal::BEGIN@35 which was called:
# once (14µs+3µs) by installer::BEGIN@75 at line 35 # spent 17µs making 1 call to installer::windows::msiglobal::BEGIN@35
# spent 3µs making 1 call to UNIVERSAL::import |
36 | 2 | 54µs | 2 | 71µs | # spent 43µs (15+28) within installer::windows::msiglobal::BEGIN@36 which was called:
# once (15µs+28µs) by installer::BEGIN@75 at line 36 # spent 43µs making 1 call to installer::windows::msiglobal::BEGIN@36
# spent 28µs making 1 call to Exporter::import |
37 | 2 | 54µs | 2 | 20µs | # spent 17µs (14+3) within installer::windows::msiglobal::BEGIN@37 which was called:
# once (14µs+3µs) by installer::BEGIN@75 at line 37 # spent 17µs making 1 call to installer::windows::msiglobal::BEGIN@37
# spent 3µs making 1 call to UNIVERSAL::import |
38 | 2 | 54µs | 2 | 18µs | # spent 16µs (14+2) within installer::windows::msiglobal::BEGIN@38 which was called:
# once (14µs+2µs) by installer::BEGIN@75 at line 38 # spent 16µs making 1 call to installer::windows::msiglobal::BEGIN@38
# spent 2µs making 1 call to UNIVERSAL::import |
39 | 2 | 53µs | 2 | 19µs | # spent 17µs (15+2) within installer::windows::msiglobal::BEGIN@39 which was called:
# once (15µs+2µs) by installer::BEGIN@75 at line 39 # spent 17µs making 1 call to installer::windows::msiglobal::BEGIN@39
# spent 2µs making 1 call to UNIVERSAL::import |
40 | 2 | 57µs | 2 | 19µs | # spent 16µs (14+2) within installer::windows::msiglobal::BEGIN@40 which was called:
# once (14µs+2µs) by installer::BEGIN@75 at line 40 # spent 16µs making 1 call to installer::windows::msiglobal::BEGIN@40
# spent 2µs making 1 call to UNIVERSAL::import |
41 | 2 | 53µs | 2 | 19µs | # spent 18µs (16+1) within installer::windows::msiglobal::BEGIN@41 which was called:
# once (16µs+1µs) by installer::BEGIN@75 at line 41 # spent 18µs making 1 call to installer::windows::msiglobal::BEGIN@41
# spent 2µs making 1 call to UNIVERSAL::import |
42 | 2 | 53µs | 2 | 20µs | # spent 18µs (16+2) within installer::windows::msiglobal::BEGIN@42 which was called:
# once (16µs+2µs) by installer::BEGIN@75 at line 42 # spent 18µs making 1 call to installer::windows::msiglobal::BEGIN@42
# spent 2µs making 1 call to UNIVERSAL::import |
43 | 2 | 17.6ms | 2 | 19µs | # spent 17µs (15+2) within installer::windows::msiglobal::BEGIN@43 which was called:
# once (15µs+2µs) by installer::BEGIN@75 at line 43 # spent 17µs making 1 call to installer::windows::msiglobal::BEGIN@43
# spent 2µs making 1 call to UNIVERSAL::import |
44 | |||||
45 | ########################################################################### | ||||
46 | # Generating the header of the ddf file. | ||||
47 | # The usage of ddf files is needed, because makecab.exe can only include | ||||
48 | # one sourcefile into a cab file | ||||
49 | ########################################################################### | ||||
50 | |||||
51 | sub write_ddf_file_header | ||||
52 | # spent 34µs within installer::windows::msiglobal::write_ddf_file_header which was called:
# once (34µs+0s) by installer::windows::msiglobal::generate_cab_file_list at line 296 | ||||
53 | 18 | 39µs | my ($ddffileref, $cabinetfile, $installdir) = @_; | ||
54 | |||||
55 | my $oneline; | ||||
56 | |||||
57 | $oneline = ".Set CabinetName1=" . $cabinetfile . "\n"; | ||||
58 | push(@{$ddffileref} ,$oneline); | ||||
59 | $oneline = ".Set ReservePerCabinetSize=128\n"; # This reserves space for a digital signature. | ||||
60 | push(@{$ddffileref} ,$oneline); | ||||
61 | $oneline = ".Set MaxDiskSize=2147483648\n"; # This allows the .cab file to get a size of 2 GB. | ||||
62 | push(@{$ddffileref} ,$oneline); | ||||
63 | $oneline = ".Set CompressionType=LZX\n"; | ||||
64 | push(@{$ddffileref} ,$oneline); | ||||
65 | $oneline = ".Set Compress=ON\n"; | ||||
66 | push(@{$ddffileref} ,$oneline); | ||||
67 | # The window size for LZX compression | ||||
68 | # CompressionMemory=15 | 16 | ... | 21 | ||||
69 | # Reference: http://msdn.microsoft.com/en-us/library/bb417343.aspx | ||||
70 | $oneline = ".Set CompressionMemory=$installer::globals::cabfilecompressionlevel\n"; | ||||
71 | push(@{$ddffileref} ,$oneline); | ||||
72 | $oneline = ".Set Cabinet=ON\n"; | ||||
73 | push(@{$ddffileref} ,$oneline); | ||||
74 | $oneline = ".Set DiskDirectoryTemplate=" . $installdir . "\n"; | ||||
75 | push(@{$ddffileref} ,$oneline); | ||||
76 | } | ||||
77 | |||||
78 | ########################################################################## | ||||
79 | # Lines in ddf files must not contain more than 256 characters | ||||
80 | ########################################################################## | ||||
81 | |||||
82 | sub check_ddf_file | ||||
83 | # spent 51.1ms within installer::windows::msiglobal::check_ddf_file which was called:
# once (51.1ms+0s) by installer::windows::msiglobal::generate_cab_file_list at line 337 | ||||
84 | 79697 | 51.1ms | my ( $ddffile, $ddffilename ) = @_; | ||
85 | |||||
86 | my $maxlength = 0; | ||||
87 | my $maxline = 0; | ||||
88 | my $linelength = 0; | ||||
89 | my $linenumber = 0; | ||||
90 | |||||
91 | for ( my $i = 0; $i <= $#{$ddffile}; $i++ ) | ||||
92 | { | ||||
93 | my $oneline = ${$ddffile}[$i]; | ||||
94 | |||||
95 | $linelength = length($oneline); | ||||
96 | $linenumber = $i + 1; | ||||
97 | |||||
98 | if ( $linelength > 256 ) | ||||
99 | { | ||||
100 | installer::exiter::exit_program("ERROR \"$ddffilename\" line $linenumber: Lines in ddf files must not contain more than 256 characters!", "check_ddf_file"); | ||||
101 | } | ||||
102 | |||||
103 | if ( $linelength > $maxlength ) | ||||
104 | { | ||||
105 | $maxlength = $linelength; | ||||
106 | $maxline = $linenumber; | ||||
107 | } | ||||
108 | } | ||||
109 | |||||
110 | my $infoline = "Check of ddf file \"$ddffilename\": Maximum length \"$maxlength\" in line \"$maxline\" (allowed line length: 256 characters)\n"; | ||||
111 | push(@installer::globals::logfileinfo, $infoline); | ||||
112 | } | ||||
113 | |||||
114 | ########################################################################## | ||||
115 | # Lines in ddf files must not be longer than 256 characters. | ||||
116 | # Therefore it can be useful to use relative paths. Then it is | ||||
117 | # necessary to change into temp directory before calling | ||||
118 | # makecab.exe. | ||||
119 | ########################################################################## | ||||
120 | |||||
121 | sub make_relative_ddf_path | ||||
122 | # spent 347ms (266+80.5) within installer::windows::msiglobal::make_relative_ddf_path which was called 15921 times, avg 22µs/call:
# 15920 times (266ms+80.5ms) by installer::windows::msiglobal::generate_cab_file_list at line 311, avg 22µs/call
# once (48µs+39µs) by installer::windows::msiglobal::generate_cab_file_list at line 290 | ||||
123 | 95526 | 373ms | my ( $sourcepath ) = @_; | ||
124 | |||||
125 | my $windowstemppath = $installer::globals::temppath; | ||||
126 | |||||
127 | 15921 | 29.7ms | if ( $^O =~ /cygwin/i ) # spent 29.7ms making 15921 calls to installer::windows::msiglobal::CORE:match, avg 2µs/call | ||
128 | { | ||||
129 | $windowstemppath = $installer::globals::cyg_temppath; | ||||
130 | } | ||||
131 | |||||
132 | 31842 | 33.5ms | $sourcepath =~ s/\Q$windowstemppath\E//; # spent 23.5ms making 15921 calls to installer::windows::msiglobal::CORE:subst, avg 1µs/call
# spent 10.0ms making 15921 calls to installer::windows::msiglobal::CORE:regcomp, avg 630ns/call | ||
133 | 15921 | 17.3ms | $sourcepath =~ s/^[\\\/]//; # spent 17.3ms making 15921 calls to installer::windows::msiglobal::CORE:subst, avg 1µs/call | ||
134 | |||||
135 | return $sourcepath; | ||||
136 | } | ||||
137 | |||||
138 | ########################################################################## | ||||
139 | # Returning the order of the sequences in the files array. | ||||
140 | ########################################################################## | ||||
141 | |||||
142 | sub get_sequenceorder | ||||
143 | { | ||||
144 | my ($filesref) = @_; | ||||
145 | |||||
146 | my %order = (); | ||||
147 | |||||
148 | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||||
149 | { | ||||
150 | my $onefile = ${$filesref}[$i]; | ||||
151 | if ( ! $onefile->{'assignedsequencenumber'} ) { installer::exiter::exit_program("ERROR: No sequence number assigned to $onefile->{'gid'} ($onefile->{'uniquename'})!", "get_sequenceorder"); } | ||||
152 | $order{$onefile->{'assignedsequencenumber'}} = $i; | ||||
153 | } | ||||
154 | |||||
155 | return \%order; | ||||
156 | } | ||||
157 | |||||
158 | ########################################################################## | ||||
159 | # Generation the list, in which the source of the files is connected | ||||
160 | # with the cabinet destination file. Because more than one file needs | ||||
161 | # to be included into a cab file, this has to be done via ddf files. | ||||
162 | ########################################################################## | ||||
163 | |||||
164 | sub generate_cab_file_list | ||||
165 | # spent 4.15s (355ms+3.80) within installer::windows::msiglobal::generate_cab_file_list which was called:
# once (355ms+3.80s) by installer::run at line 1733 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
166 | 207000 | 382ms | my ($filesref, $installdir, $ddfdir, $allvariables) = @_; | ||
167 | |||||
168 | my @cabfilelist = (); | ||||
169 | |||||
170 | 1 | 220µs | installer::logger::include_header_into_logfile("Generating ddf files"); # spent 220µs making 1 call to installer::logger::include_header_into_logfile | ||
171 | |||||
172 | 1 | 121µs | installer::logger::include_timestamp_into_logfile("Performance Info: ddf file generation start"); # spent 121µs making 1 call to installer::logger::include_timestamp_into_logfile | ||
173 | |||||
174 | 2 | 3.33s | if ( $^O =~ /cygwin/i ) { installer::worker::generate_cygwin_paths($filesref); } # spent 3.33s making 1 call to installer::worker::generate_cygwin_paths
# spent 7µs making 1 call to installer::windows::msiglobal::CORE:match | ||
175 | |||||
176 | if (( $installer::globals::fix_number_of_cab_files ) && ( $installer::globals::updatedatabase )) | ||||
177 | { | ||||
178 | my $sequenceorder = get_sequenceorder($filesref); | ||||
179 | |||||
180 | my $counter = 1; | ||||
181 | my $currentcabfile = ""; | ||||
182 | |||||
183 | while ( ( exists($sequenceorder->{$counter}) ) || ( exists($installer::globals::allmergemodulefilesequences{$counter}) ) ) # Taking care of files from merge modules | ||||
184 | { | ||||
185 | # if ( exists($installer::globals::allmergemodulefilesequences{$counter}) ) | ||||
186 | # { | ||||
187 | # # Skipping this sequence, it is not included in $filesref, because it is assigned to a file from a merge module.\n"; | ||||
188 | # $counter++; | ||||
189 | # next; | ||||
190 | # } | ||||
191 | |||||
192 | my $onefile = ${$filesref}[$sequenceorder->{$counter}]; | ||||
193 | $counter++; | ||||
194 | |||||
195 | my $cabinetfile = $onefile->{'cabinet'}; | ||||
196 | my $sourcepath = $onefile->{'sourcepath'}; | ||||
197 | if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; } | ||||
198 | my $uniquename = $onefile->{'uniquename'}; | ||||
199 | |||||
200 | my $styles = ""; | ||||
201 | my $doinclude = 1; | ||||
202 | if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }; | ||||
203 | if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; } | ||||
204 | |||||
205 | # to avoid lines with more than 256 characters, it can be useful to use relative paths | ||||
206 | $sourcepath = make_relative_ddf_path($sourcepath); | ||||
207 | |||||
208 | my @ddffile = (); | ||||
209 | |||||
210 | write_ddf_file_header(\@ddffile, $cabinetfile, $installdir); | ||||
211 | |||||
212 | my $ddfline = "\"" . $sourcepath . "\" \"" . $uniquename . "\"\n"; | ||||
213 | if ( $doinclude ) { push(@ddffile, $ddfline); } | ||||
214 | |||||
215 | my $nextfile = ""; | ||||
216 | if ( ${$filesref}[$sequenceorder->{$counter}] ) { $nextfile = ${$filesref}[$sequenceorder->{$counter}]; } | ||||
217 | |||||
218 | my $nextcabinetfile = ""; | ||||
219 | |||||
220 | if ( $nextfile->{'cabinet'} ) { $nextcabinetfile = $nextfile->{'cabinet'}; } | ||||
221 | |||||
222 | while ( $nextcabinetfile eq $cabinetfile ) | ||||
223 | { | ||||
224 | $sourcepath = $nextfile->{'sourcepath'}; | ||||
225 | if ( $^O =~ /cygwin/i ) { $sourcepath = $nextfile->{'cyg_sourcepath'}; } | ||||
226 | # to avoid lines with more than 256 characters, it can be useful to use relative paths | ||||
227 | $sourcepath = make_relative_ddf_path($sourcepath); | ||||
228 | $uniquename = $nextfile->{'uniquename'}; | ||||
229 | my $localdoinclude = 1; | ||||
230 | my $nextfilestyles = ""; | ||||
231 | if ( $nextfile->{'Styles'} ) { $nextfilestyles = $nextfile->{'Styles'}; } | ||||
232 | if ( $nextfilestyles =~ /\bDONT_PACK\b/ ) { $localdoinclude = 0; } | ||||
233 | $ddfline = "\"" . $sourcepath . "\" \"" . $uniquename . "\"\n"; | ||||
234 | if ( $localdoinclude ) { push(@ddffile, $ddfline); } | ||||
235 | $counter++; | ||||
236 | $nextfile = ""; | ||||
237 | $nextcabinetfile = "_lastfile_"; | ||||
238 | if (( exists($sequenceorder->{$counter}) ) && ( ${$filesref}[$sequenceorder->{$counter}] )) | ||||
239 | { | ||||
240 | $nextfile = ${$filesref}[$sequenceorder->{$counter}]; | ||||
241 | $nextcabinetfile = $nextfile->{'cabinet'}; | ||||
242 | } | ||||
243 | } | ||||
244 | |||||
245 | # creating the DDF file | ||||
246 | |||||
247 | my $ddffilename = $cabinetfile; | ||||
248 | $ddffilename =~ s/.cab/.ddf/; | ||||
249 | $ddfdir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
250 | $ddffilename = $ddfdir . $installer::globals::separator . $ddffilename; | ||||
251 | |||||
252 | installer::files::save_file($ddffilename ,\@ddffile); | ||||
253 | my $infoline = "Created ddf file: $ddffilename\n"; | ||||
254 | push(@installer::globals::logfileinfo, $infoline); | ||||
255 | |||||
256 | # lines in ddf files must not be longer than 256 characters | ||||
257 | check_ddf_file(\@ddffile, $ddffilename); | ||||
258 | |||||
259 | # Writing the makecab system call | ||||
260 | |||||
261 | my $oneline = "makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n"; | ||||
262 | if ( $installer::globals::isunix ) | ||||
263 | { | ||||
264 | $oneline = "$ENV{'OUTDIR_FOR_BUILD'}/bin/makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n"; | ||||
265 | } | ||||
266 | |||||
267 | push(@cabfilelist, $oneline); | ||||
268 | |||||
269 | # collecting all ddf files | ||||
270 | push(@installer::globals::allddffiles, $ddffilename); | ||||
271 | } | ||||
272 | } | ||||
273 | elsif ( $installer::globals::fix_number_of_cab_files ) | ||||
274 | { | ||||
275 | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||||
276 | { | ||||
277 | my $onefile = ${$filesref}[$i]; | ||||
278 | my $cabinetfile = $onefile->{'cabinet'}; | ||||
279 | my $sourcepath = $onefile->{'sourcepath'}; | ||||
280 | 1 | 6µs | if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; } # spent 6µs making 1 call to installer::windows::msiglobal::CORE:match | ||
281 | my $uniquename = $onefile->{'uniquename'}; | ||||
282 | |||||
283 | my $styles = ""; | ||||
284 | my $doinclude = 1; | ||||
285 | if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }; | ||||
286 | 1 | 500ns | if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; } # spent 500ns making 1 call to installer::windows::msiglobal::CORE:match | ||
287 | |||||
288 | |||||
289 | # to avoid lines with more than 256 characters, it can be useful to use relative paths | ||||
290 | 1 | 87µs | $sourcepath = make_relative_ddf_path($sourcepath); # spent 87µs making 1 call to installer::windows::msiglobal::make_relative_ddf_path | ||
291 | |||||
292 | # all files with the same cabinetfile are directly behind each other in the files collector | ||||
293 | |||||
294 | my @ddffile = (); | ||||
295 | |||||
296 | 1 | 34µs | write_ddf_file_header(\@ddffile, $cabinetfile, $installdir); # spent 34µs making 1 call to installer::windows::msiglobal::write_ddf_file_header | ||
297 | |||||
298 | my $ddfline = "\"" . $sourcepath . "\" \"" . $uniquename . "\"\n"; | ||||
299 | if ( $doinclude ) { push(@ddffile, $ddfline); } | ||||
300 | |||||
301 | my $nextfile = ${$filesref}[$i+1]; | ||||
302 | my $nextcabinetfile = ""; | ||||
303 | |||||
304 | if ( $nextfile->{'cabinet'} ) { $nextcabinetfile = $nextfile->{'cabinet'}; } | ||||
305 | |||||
306 | while ( $nextcabinetfile eq $cabinetfile ) | ||||
307 | { | ||||
308 | $sourcepath = $nextfile->{'sourcepath'}; | ||||
309 | 15920 | 43.7ms | if ( $^O =~ /cygwin/i ) { $sourcepath = $nextfile->{'cyg_sourcepath'}; } # spent 43.7ms making 15920 calls to installer::windows::msiglobal::CORE:match, avg 3µs/call | ||
310 | # to avoid lines with more than 256 characters, it can be useful to use relative paths | ||||
311 | 15920 | 347ms | $sourcepath = make_relative_ddf_path($sourcepath); # spent 347ms making 15920 calls to installer::windows::msiglobal::make_relative_ddf_path, avg 22µs/call | ||
312 | $uniquename = $nextfile->{'uniquename'}; | ||||
313 | my $localdoinclude = 1; | ||||
314 | my $nextfilestyles = ""; | ||||
315 | if ( $nextfile->{'Styles'} ) { $nextfilestyles = $nextfile->{'Styles'}; } | ||||
316 | 15920 | 9.54ms | if ( $nextfilestyles =~ /\bDONT_PACK\b/ ) { $localdoinclude = 0; } # spent 9.54ms making 15920 calls to installer::windows::msiglobal::CORE:match, avg 599ns/call | ||
317 | $ddfline = "\"" . $sourcepath . "\" \"" . $uniquename . "\"\n"; | ||||
318 | if ( $localdoinclude ) { push(@ddffile, $ddfline); } | ||||
319 | $i++; # increasing the counter! | ||||
320 | $nextfile = ${$filesref}[$i+1]; | ||||
321 | if ( $nextfile ) { $nextcabinetfile = $nextfile->{'cabinet'}; } | ||||
322 | else { $nextcabinetfile = "_lastfile_"; } | ||||
323 | } | ||||
324 | |||||
325 | # creating the DDF file | ||||
326 | |||||
327 | my $ddffilename = $cabinetfile; | ||||
328 | 1 | 3µs | $ddffilename =~ s/.cab/.ddf/; # spent 3µs making 1 call to installer::windows::msiglobal::CORE:subst | ||
329 | 2 | 36µs | $ddfdir =~ s/\Q$installer::globals::separator\E\s*$//; # spent 29µs making 1 call to installer::windows::msiglobal::CORE:regcomp
# spent 7µs making 1 call to installer::windows::msiglobal::CORE:subst | ||
330 | $ddffilename = $ddfdir . $installer::globals::separator . $ddffilename; | ||||
331 | |||||
332 | 1 | 8.47ms | installer::files::save_file($ddffilename ,\@ddffile); # spent 8.47ms making 1 call to installer::files::save_file | ||
333 | my $infoline = "Created ddf file: $ddffilename\n"; | ||||
334 | push(@installer::globals::logfileinfo, $infoline); | ||||
335 | |||||
336 | # lines in ddf files must not be longer than 256 characters | ||||
337 | 1 | 51.1ms | check_ddf_file(\@ddffile, $ddffilename); # spent 51.1ms making 1 call to installer::windows::msiglobal::check_ddf_file | ||
338 | |||||
339 | # Writing the makecab system call | ||||
340 | |||||
341 | my $oneline = "makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n"; | ||||
342 | if ( $installer::globals::isunix ) | ||||
343 | { | ||||
344 | $oneline = "$ENV{'OUTDIR_FOR_BUILD'}/bin/makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n"; | ||||
345 | } | ||||
346 | |||||
347 | push(@cabfilelist, $oneline); | ||||
348 | |||||
349 | # collecting all ddf files | ||||
350 | push(@installer::globals::allddffiles, $ddffilename); | ||||
351 | } | ||||
352 | } | ||||
353 | else | ||||
354 | { | ||||
355 | installer::exiter::exit_program("ERROR: No cab file specification in globals.pm !", "generate_cab_file_list"); | ||||
356 | } | ||||
357 | |||||
358 | 1 | 218µs | installer::logger::include_timestamp_into_logfile("Performance Info: ddf file generation end"); # spent 218µs making 1 call to installer::logger::include_timestamp_into_logfile | ||
359 | |||||
360 | return \@cabfilelist; # contains all system calls for packaging process | ||||
361 | } | ||||
362 | |||||
363 | ######################################################################## | ||||
364 | # For update and patch reasons the pack order needs to be saved. | ||||
365 | # The pack order is saved in the ddf files; the names and locations | ||||
366 | # of the ddf files are saved in @installer::globals::allddffiles. | ||||
367 | # The outputfile "packorder.txt" can be saved in | ||||
368 | # $installer::globals::infodirectory . | ||||
369 | ######################################################################## | ||||
370 | |||||
371 | sub save_packorder | ||||
372 | # spent 712ms (383+329) within installer::windows::msiglobal::save_packorder which was called:
# once (383ms+329ms) by installer::run at line 1736 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
373 | 175177 | 433ms | 1 | 119µs | installer::logger::include_header_into_logfile("Saving pack order"); # spent 119µs making 1 call to installer::logger::include_header_into_logfile |
374 | |||||
375 | 1 | 106µs | installer::logger::include_timestamp_into_logfile("Performance Info: saving pack order start"); # spent 106µs making 1 call to installer::logger::include_timestamp_into_logfile | ||
376 | |||||
377 | my $packorderfilename = "packorder.txt"; | ||||
378 | $packorderfilename = $installer::globals::infodirectory . $installer::globals::separator . $packorderfilename; | ||||
379 | |||||
380 | my @packorder = (); | ||||
381 | |||||
382 | my $headerline = "\# Syntax\: Filetable_Sequence Cabinetfilename Physical_FileName Unique_FileName\n\n"; | ||||
383 | push(@packorder, $headerline); | ||||
384 | |||||
385 | for ( my $i = 0; $i <= $#installer::globals::allddffiles; $i++ ) | ||||
386 | { | ||||
387 | my $ddffilename = $installer::globals::allddffiles[$i]; | ||||
388 | 1 | 67.1ms | my $ddffile = installer::files::read_file($ddffilename); # spent 67.1ms making 1 call to installer::files::read_file | ||
389 | my $cabinetfile = ""; | ||||
390 | |||||
391 | for ( my $j = 0; $j <= $#{$ddffile}; $j++ ) | ||||
392 | { | ||||
393 | my $oneline = ${$ddffile}[$j]; | ||||
394 | |||||
395 | # Getting the Cabinet file name | ||||
396 | |||||
397 | 15929 | 13.6ms | if ( $oneline =~ /^\s*\.Set\s+CabinetName.*\=(.*?)\s*$/ ) { $cabinetfile = $1; } # spent 13.6ms making 15929 calls to installer::windows::msiglobal::CORE:match, avg 851ns/call | ||
398 | 15929 | 10.2ms | if ( $oneline =~ /^\s*\.Set\s+/ ) { next; } # spent 10.2ms making 15929 calls to installer::windows::msiglobal::CORE:match, avg 643ns/call | ||
399 | |||||
400 | 15921 | 51.1ms | if ( $oneline =~ /^\s*\"(.*?)\"\s+\"(.*?)\"\s*$/ ) # spent 51.1ms making 15921 calls to installer::windows::msiglobal::CORE:match, avg 3µs/call | ||
401 | { | ||||
402 | my $sourcefile = $1; | ||||
403 | my $uniquefilename = $2; | ||||
404 | |||||
405 | 15921 | 181ms | installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$sourcefile); # spent 181ms making 15921 calls to installer::pathanalyzer::make_absolute_filename_to_relative_filename, avg 11µs/call | ||
406 | |||||
407 | # Using the hash created in create_files_table for performance reasons to get the sequence number | ||||
408 | my $filesequence = ""; | ||||
409 | if ( exists($installer::globals::uniquefilenamesequence{$uniquefilename}) ) { $filesequence = $installer::globals::uniquefilenamesequence{$uniquefilename}; } | ||||
410 | else { installer::exiter::exit_program("ERROR: No sequence number value for $uniquefilename !", "save_packorder"); } | ||||
411 | |||||
412 | my $line = $filesequence . "\t" . $cabinetfile . "\t" . $sourcefile . "\t" . $uniquefilename . "\n"; | ||||
413 | push(@packorder, $line); | ||||
414 | } | ||||
415 | } | ||||
416 | } | ||||
417 | |||||
418 | 1 | 5.81ms | installer::files::save_file($packorderfilename ,\@packorder); # spent 5.81ms making 1 call to installer::files::save_file | ||
419 | |||||
420 | 1 | 202µs | installer::logger::include_timestamp_into_logfile("Performance Info: saving pack order end"); # spent 202µs making 1 call to installer::logger::include_timestamp_into_logfile | ||
421 | } | ||||
422 | |||||
423 | ################################################################# | ||||
424 | # Returning the name of the msi database | ||||
425 | ################################################################# | ||||
426 | |||||
427 | sub get_msidatabasename | ||||
428 | # spent 12.4ms (8.94+3.50) within installer::windows::msiglobal::get_msidatabasename which was called 221 times, avg 56µs/call:
# 109 times (3.88ms+988µs) by installer::run at line 1671 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 45µs/call
# 108 times (4.93ms+2.47ms) by installer::windows::msiglobal::create_transforms at line 800, avg 69µs/call
# once (46µs+19µs) by installer::run at line 1705 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (36µs+12µs) by installer::windows::msiglobal::rename_msi_database_in_installset at line 959
# once (32µs+10µs) by installer::windows::msiglobal::create_transforms at line 787
# once (17µs+6µs) by installer::windows::msiglobal::rename_msi_database_in_installset at line 962 | ||||
429 | 2210 | 12.3ms | my ($allvariableshashref, $language) = @_; | ||
430 | |||||
431 | my $databasename = $allvariableshashref->{'PRODUCTNAME'} . $allvariableshashref->{'PRODUCTVERSION'}; | ||||
432 | $databasename = lc($databasename); | ||||
433 | 221 | 2.99ms | $databasename =~ s/\.//g; # spent 2.99ms making 221 calls to installer::windows::msiglobal::CORE:subst, avg 14µs/call | ||
434 | 221 | 184µs | $databasename =~ s/\-//g; # spent 184µs making 221 calls to installer::windows::msiglobal::CORE:subst, avg 834ns/call | ||
435 | 221 | 330µs | $databasename =~ s/\s//g; # spent 330µs making 221 calls to installer::windows::msiglobal::CORE:subst, avg 1µs/call | ||
436 | |||||
437 | # possibility to overwrite the name with variable DATABASENAME | ||||
438 | if ( $allvariableshashref->{'DATABASENAME'} ) | ||||
439 | { | ||||
440 | $databasename = $allvariableshashref->{'DATABASENAME'}; | ||||
441 | } | ||||
442 | |||||
443 | if ( $language ) | ||||
444 | { | ||||
445 | if (!($language eq "")) | ||||
446 | { | ||||
447 | $databasename .= "_$language"; | ||||
448 | } | ||||
449 | } | ||||
450 | |||||
451 | $databasename .= ".msi"; | ||||
452 | |||||
453 | return $databasename; | ||||
454 | } | ||||
455 | |||||
456 | ################################################################# | ||||
457 | # Creating the msi database | ||||
458 | # This works only on Windows | ||||
459 | ################################################################# | ||||
460 | |||||
461 | sub create_msi_database | ||||
462 | # spent 230s (12.8ms+230) within installer::windows::msiglobal::create_msi_database which was called 109 times, avg 2.11s/call:
# 109 times (12.8ms+230s) by installer::run at line 1678 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 2.11s/call | ||||
463 | 2071 | 230s | my ($idtdirbase ,$msifilename) = @_; | ||
464 | |||||
465 | # -f : path containing the idt files | ||||
466 | # -d : msi database, including path | ||||
467 | # -c : create database | ||||
468 | # -i : include the following tables ("*" includes all available tables) | ||||
469 | |||||
470 | my $msidb = "msidb.exe"; # Has to be in the path | ||||
471 | if ( $installer::globals::isunix ) | ||||
472 | { | ||||
473 | $msidb = "$ENV{'OUTDIR_FOR_BUILD'}/bin/msidb.exe"; | ||||
474 | } | ||||
475 | my $extraslash = ""; # Has to be set for non-ActiveState perl | ||||
476 | |||||
477 | 109 | 22.8ms | installer::logger::include_header_into_logfile("Creating msi database"); # spent 22.8ms making 109 calls to installer::logger::include_header_into_logfile, avg 209µs/call | ||
478 | |||||
479 | 109 | 2.77ms | $idtdirbase = installer::converter::make_path_conform($idtdirbase); # spent 2.77ms making 109 calls to installer::converter::make_path_conform, avg 25µs/call | ||
480 | |||||
481 | 109 | 1.32ms | $msifilename = installer::converter::make_path_conform($msifilename); # spent 1.32ms making 109 calls to installer::converter::make_path_conform, avg 12µs/call | ||
482 | |||||
483 | 109 | 689µs | if ( $^O =~ /cygwin/i ) { # spent 689µs making 109 calls to installer::windows::msiglobal::CORE:match, avg 6µs/call | ||
484 | # msidb.exe really wants backslashes. (And double escaping because system() expands the string.) | ||||
485 | 109 | 2.03ms | $idtdirbase =~ s/\//\\\\/g; # spent 2.03ms making 109 calls to installer::windows::msiglobal::CORE:subst, avg 19µs/call | ||
486 | 109 | 1.73ms | $msifilename =~ s/\//\\\\/g; # spent 1.73ms making 109 calls to installer::windows::msiglobal::CORE:subst, avg 16µs/call | ||
487 | $extraslash = "\\"; | ||||
488 | } | ||||
489 | 109 | 147µs | if ( $^O =~ /linux/i ) { # spent 147µs making 109 calls to installer::windows::msiglobal::CORE:match, avg 1µs/call | ||
490 | $extraslash = "\\"; | ||||
491 | } | ||||
492 | my $systemcall = $msidb . " -f " . $idtdirbase . " -d " . $msifilename . " -c " . "-i " . $extraslash . "*"; | ||||
493 | |||||
494 | 109 | 230s | my $returnvalue = system($systemcall); # spent 230s making 109 calls to installer::windows::msiglobal::CORE:system, avg 2.11s/call | ||
495 | |||||
496 | my $infoline = "Systemcall: $systemcall\n"; | ||||
497 | push( @installer::globals::logfileinfo, $infoline); | ||||
498 | |||||
499 | if ($returnvalue) | ||||
500 | { | ||||
501 | $infoline = "ERROR: Could not execute $msidb!\n"; | ||||
502 | push( @installer::globals::logfileinfo, $infoline); | ||||
503 | } | ||||
504 | else | ||||
505 | { | ||||
506 | $infoline = "Success: Executed $msidb successfully!\n"; | ||||
507 | push( @installer::globals::logfileinfo, $infoline); | ||||
508 | } | ||||
509 | } | ||||
510 | |||||
511 | ##################################################################### | ||||
512 | # Returning the value from sis.mlf for Summary Information Stream | ||||
513 | ##################################################################### | ||||
514 | |||||
515 | sub get_value_from_sis_lng | ||||
516 | # spent 997ms (24.8+972) within installer::windows::msiglobal::get_value_from_sis_lng which was called 436 times, avg 2.29ms/call:
# 109 times (6.02ms+398ms) by installer::windows::msiglobal::get_appname_for_sis at line 680, avg 3.71ms/call
# 109 times (5.74ms+289ms) by installer::windows::msiglobal::get_keywords_for_sis at line 667, avg 2.70ms/call
# 109 times (6.16ms+189ms) by installer::windows::msiglobal::get_comment_for_sis at line 654, avg 1.79ms/call
# 109 times (6.91ms+96.3ms) by installer::windows::msiglobal::get_title_for_sis at line 613, avg 947µs/call | ||||
517 | 2180 | 24.6ms | my ($language, $languagefile, $searchstring) = @_; | ||
518 | |||||
519 | 436 | 951ms | my $language_block = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $languagefile); # spent 951ms making 436 calls to installer::windows::idtglobal::get_language_block_from_language_file, avg 2.18ms/call | ||
520 | 436 | 20.8ms | my $newstring = installer::windows::idtglobal::get_language_string_from_language_block($language_block, $language, $searchstring); # spent 20.8ms making 436 calls to installer::windows::idtglobal::get_language_string_from_language_block, avg 48µs/call | ||
521 | $newstring = "\"" . $newstring . "\""; | ||||
522 | |||||
523 | return $newstring; | ||||
524 | } | ||||
525 | |||||
526 | ################################################################# | ||||
527 | # Returning the msi version for the Summary Information Stream | ||||
528 | ################################################################# | ||||
529 | |||||
530 | sub get_msiversion_for_sis | ||||
531 | # spent 551µs within installer::windows::msiglobal::get_msiversion_for_sis which was called 109 times, avg 5µs/call:
# 109 times (551µs+0s) by installer::windows::msiglobal::write_summary_into_msi_database at line 718, avg 5µs/call | ||||
532 | 218 | 810µs | my $msiversion = "200"; | ||
533 | return $msiversion; | ||||
534 | } | ||||
535 | |||||
536 | ################################################################# | ||||
537 | # Returning the word count for the Summary Information Stream | ||||
538 | ################################################################# | ||||
539 | |||||
540 | sub get_wordcount_for_sis | ||||
541 | # spent 509µs within installer::windows::msiglobal::get_wordcount_for_sis which was called 109 times, avg 5µs/call:
# 109 times (509µs+0s) by installer::windows::msiglobal::write_summary_into_msi_database at line 730, avg 5µs/call | ||||
542 | 218 | 808µs | my $wordcount = "0"; | ||
543 | return $wordcount; | ||||
544 | } | ||||
545 | |||||
546 | ################################################################# | ||||
547 | # Returning the codepage for the Summary Information Stream | ||||
548 | ################################################################# | ||||
549 | |||||
550 | sub get_codepage_for_sis | ||||
551 | # spent 3.19ms (1.52+1.66) within installer::windows::msiglobal::get_codepage_for_sis which was called 109 times, avg 29µs/call:
# 109 times (1.52ms+1.66ms) by installer::windows::msiglobal::write_summary_into_msi_database at line 719, avg 29µs/call | ||||
552 | 436 | 1.64ms | my ( $language ) = @_; | ||
553 | |||||
554 | 109 | 1.66ms | my $codepage = installer::windows::language::get_windows_encoding($language); # spent 1.66ms making 109 calls to installer::windows::language::get_windows_encoding, avg 15µs/call | ||
555 | |||||
556 | # Codepage 65001 does not work in Summary Information Stream | ||||
557 | if ( $codepage == 65001 ) { $codepage = 0; } | ||||
558 | |||||
559 | # my $codepage = "1252"; # determine dynamically in a function | ||||
560 | # my $codepage = "65001"; # UTF-8 | ||||
561 | return $codepage; | ||||
562 | } | ||||
563 | |||||
564 | ################################################################# | ||||
565 | # Returning the template for the Summary Information Stream | ||||
566 | ################################################################# | ||||
567 | |||||
568 | sub get_template_for_sis | ||||
569 | # spent 2.96ms (1.99+964µs) within installer::windows::msiglobal::get_template_for_sis which was called 109 times, avg 27µs/call:
# 109 times (1.99ms+964µs) by installer::windows::msiglobal::write_summary_into_msi_database at line 720, avg 27µs/call | ||||
570 | 763 | 1.89ms | my ( $language, $allvariables ) = @_; | ||
571 | |||||
572 | 109 | 964µs | my $windowslanguage = installer::windows::language::get_windows_language($language); # spent 964µs making 109 calls to installer::windows::language::get_windows_language, avg 9µs/call | ||
573 | |||||
574 | my $architecture = "Intel"; | ||||
575 | |||||
576 | if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $architecture = "x64"; } | ||||
577 | |||||
578 | my $value = "\"" . $architecture . ";" . $windowslanguage; # adding the Windows language | ||||
579 | |||||
580 | $value = $value . "\""; # adding ending '"' | ||||
581 | |||||
582 | return $value ; | ||||
583 | } | ||||
584 | |||||
585 | ################################################################# | ||||
586 | # Returning the PackageCode for the Summary Information Stream | ||||
587 | ################################################################# | ||||
588 | |||||
589 | sub get_packagecode_for_sis | ||||
590 | # spent 37.3s (3.36ms+37.3) within installer::windows::msiglobal::get_packagecode_for_sis which was called 109 times, avg 342ms/call:
# 109 times (3.36ms+37.3s) by installer::windows::msiglobal::write_summary_into_msi_database at line 721, avg 342ms/call | ||||
591 | # always generating a new package code for each package | ||||
592 | |||||
593 | 654 | 5.72ms | 109 | 37.3s | my $guidref = get_guid_list(1, 1); # only one GUID shall be generated # spent 37.3s making 109 calls to installer::windows::msiglobal::get_guid_list, avg 342ms/call |
594 | |||||
595 | 109 | 2.53ms | ${$guidref}[0] =~ s/\s*$//; # removing ending spaces # spent 2.53ms making 109 calls to installer::windows::msiglobal::CORE:subst, avg 23µs/call | ||
596 | |||||
597 | my $guid = "\{" . ${$guidref}[0] . "\}"; | ||||
598 | |||||
599 | my $infoline = "PackageCode: $guid\n"; | ||||
600 | push( @installer::globals::logfileinfo, $infoline); | ||||
601 | |||||
602 | return $guid; | ||||
603 | } | ||||
604 | |||||
605 | ################################################################# | ||||
606 | # Returning the title for the Summary Information Stream | ||||
607 | ################################################################# | ||||
608 | |||||
609 | sub get_title_for_sis | ||||
610 | # spent 105ms (2.06+103) within installer::windows::msiglobal::get_title_for_sis which was called 109 times, avg 966µs/call:
# 109 times (2.06ms+103ms) by installer::windows::msiglobal::write_summary_into_msi_database at line 722, avg 966µs/call | ||||
611 | 327 | 1.60ms | my ( $language, $languagefile, $searchstring ) = @_; | ||
612 | |||||
613 | 109 | 103ms | my $title = get_value_from_sis_lng($language, $languagefile, $searchstring ); # spent 103ms making 109 calls to installer::windows::msiglobal::get_value_from_sis_lng, avg 947µs/call | ||
614 | |||||
615 | return $title; | ||||
616 | } | ||||
617 | |||||
618 | ################################################################# | ||||
619 | # Returning the author for the Summary Information Stream | ||||
620 | ################################################################# | ||||
621 | |||||
622 | sub get_author_for_sis | ||||
623 | # spent 727µs within installer::windows::msiglobal::get_author_for_sis which was called 109 times, avg 7µs/call:
# 109 times (727µs+0s) by installer::windows::msiglobal::write_summary_into_msi_database at line 723, avg 7µs/call | ||||
624 | 327 | 982µs | my $author = $installer::globals::longmanufacturer; | ||
625 | |||||
626 | $author = "\"" . $author . "\""; | ||||
627 | |||||
628 | return $author; | ||||
629 | } | ||||
630 | |||||
631 | ################################################################# | ||||
632 | # Returning the subject for the Summary Information Stream | ||||
633 | ################################################################# | ||||
634 | |||||
635 | sub get_subject_for_sis | ||||
636 | # spent 1.24ms within installer::windows::msiglobal::get_subject_for_sis which was called 109 times, avg 11µs/call:
# 109 times (1.24ms+0s) by installer::windows::msiglobal::write_summary_into_msi_database at line 724, avg 11µs/call | ||||
637 | 436 | 1.54ms | my ( $allvariableshashref ) = @_; | ||
638 | |||||
639 | my $subject = $allvariableshashref->{'PRODUCTNAME'} . " " . $allvariableshashref->{'PRODUCTVERSION'}; | ||||
640 | |||||
641 | $subject = "\"" . $subject . "\""; | ||||
642 | |||||
643 | return $subject; | ||||
644 | } | ||||
645 | |||||
646 | ################################################################# | ||||
647 | # Returning the comment for the Summary Information Stream | ||||
648 | ################################################################# | ||||
649 | |||||
650 | sub get_comment_for_sis | ||||
651 | # spent 197ms (1.43+195) within installer::windows::msiglobal::get_comment_for_sis which was called 109 times, avg 1.80ms/call:
# 109 times (1.43ms+195ms) by installer::windows::msiglobal::write_summary_into_msi_database at line 725, avg 1.80ms/call | ||||
652 | 327 | 1.36ms | my ( $language, $languagefile, $searchstring ) = @_; | ||
653 | |||||
654 | 109 | 195ms | my $comment = get_value_from_sis_lng($language, $languagefile, $searchstring ); # spent 195ms making 109 calls to installer::windows::msiglobal::get_value_from_sis_lng, avg 1.79ms/call | ||
655 | |||||
656 | return $comment; | ||||
657 | } | ||||
658 | |||||
659 | ################################################################# | ||||
660 | # Returning the keywords for the Summary Information Stream | ||||
661 | ################################################################# | ||||
662 | |||||
663 | sub get_keywords_for_sis | ||||
664 | # spent 296ms (1.60+294) within installer::windows::msiglobal::get_keywords_for_sis which was called 109 times, avg 2.72ms/call:
# 109 times (1.60ms+294ms) by installer::windows::msiglobal::write_summary_into_msi_database at line 727, avg 2.72ms/call | ||||
665 | 327 | 1.38ms | my ( $language, $languagefile, $searchstring ) = @_; | ||
666 | |||||
667 | 109 | 294ms | my $keywords = get_value_from_sis_lng($language, $languagefile, $searchstring ); # spent 294ms making 109 calls to installer::windows::msiglobal::get_value_from_sis_lng, avg 2.70ms/call | ||
668 | |||||
669 | return $keywords; | ||||
670 | } | ||||
671 | |||||
672 | ###################################################################### | ||||
673 | # Returning the application name for the Summary Information Stream | ||||
674 | ###################################################################### | ||||
675 | |||||
676 | sub get_appname_for_sis | ||||
677 | # spent 406ms (1.72+404) within installer::windows::msiglobal::get_appname_for_sis which was called 109 times, avg 3.72ms/call:
# 109 times (1.72ms+404ms) by installer::windows::msiglobal::write_summary_into_msi_database at line 728, avg 3.72ms/call | ||||
678 | 327 | 1.40ms | my ( $language, $languagefile, $searchstring ) = @_; | ||
679 | |||||
680 | 109 | 404ms | my $appname = get_value_from_sis_lng($language, $languagefile, $searchstring ); # spent 404ms making 109 calls to installer::windows::msiglobal::get_value_from_sis_lng, avg 3.71ms/call | ||
681 | |||||
682 | return $appname; | ||||
683 | } | ||||
684 | |||||
685 | ###################################################################### | ||||
686 | # Returning the security for the Summary Information Stream | ||||
687 | ###################################################################### | ||||
688 | |||||
689 | sub get_security_for_sis | ||||
690 | # spent 597µs within installer::windows::msiglobal::get_security_for_sis which was called 109 times, avg 5µs/call:
# 109 times (597µs+0s) by installer::windows::msiglobal::write_summary_into_msi_database at line 729, avg 5µs/call | ||||
691 | 218 | 851µs | my $security = "0"; | ||
692 | return $security; | ||||
693 | } | ||||
694 | |||||
695 | ################################################################# | ||||
696 | # Writing the Summary information stream into the msi database | ||||
697 | # This works only on Windows | ||||
698 | ################################################################# | ||||
699 | |||||
700 | sub write_summary_into_msi_database | ||||
701 | # spent 103s (25.6ms+103) within installer::windows::msiglobal::write_summary_into_msi_database which was called 109 times, avg 943ms/call:
# 109 times (25.6ms+103s) by installer::run at line 1684 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 943ms/call | ||||
702 | 2834 | 64.5s | my ($msifilename, $language, $languagefile, $allvariableshashref) = @_; | ||
703 | |||||
704 | # -g : required msi version | ||||
705 | # -c : codepage | ||||
706 | # -p : template | ||||
707 | |||||
708 | 109 | 22.3ms | installer::logger::include_header_into_logfile("Writing summary information stream"); # spent 22.3ms making 109 calls to installer::logger::include_header_into_logfile, avg 205µs/call | ||
709 | |||||
710 | my $msiinfo = "msiinfo.exe"; # Has to be in the path | ||||
711 | if ( $installer::globals::isunix ) | ||||
712 | { | ||||
713 | $msiinfo = "$ENV{'OUTDIR_FOR_BUILD'}/bin/msiinfo.exe"; | ||||
714 | } | ||||
715 | |||||
716 | my $sislanguage = "en-US"; # title, comment, keyword, and appname are always in English | ||||
717 | |||||
718 | 109 | 551µs | my $msiversion = get_msiversion_for_sis(); # spent 551µs making 109 calls to installer::windows::msiglobal::get_msiversion_for_sis, avg 5µs/call | ||
719 | 109 | 3.19ms | my $codepage = get_codepage_for_sis($language); # spent 3.19ms making 109 calls to installer::windows::msiglobal::get_codepage_for_sis, avg 29µs/call | ||
720 | 109 | 2.96ms | my $template = get_template_for_sis($language, $allvariableshashref); # spent 2.96ms making 109 calls to installer::windows::msiglobal::get_template_for_sis, avg 27µs/call | ||
721 | 109 | 37.3s | my $guid = get_packagecode_for_sis(); # spent 37.3s making 109 calls to installer::windows::msiglobal::get_packagecode_for_sis, avg 342ms/call | ||
722 | 109 | 105ms | my $title = get_title_for_sis($sislanguage,$languagefile, "OOO_SIS_TITLE"); # spent 105ms making 109 calls to installer::windows::msiglobal::get_title_for_sis, avg 966µs/call | ||
723 | 109 | 727µs | my $author = get_author_for_sis(); # spent 727µs making 109 calls to installer::windows::msiglobal::get_author_for_sis, avg 7µs/call | ||
724 | 109 | 1.24ms | my $subject = get_subject_for_sis($allvariableshashref); # spent 1.24ms making 109 calls to installer::windows::msiglobal::get_subject_for_sis, avg 11µs/call | ||
725 | 109 | 197ms | my $comment = get_comment_for_sis($sislanguage,$languagefile, "OOO_SIS_COMMENT"); # spent 197ms making 109 calls to installer::windows::msiglobal::get_comment_for_sis, avg 1.80ms/call | ||
726 | 327 | 1.35ms | $comment =~ s/\[ProductName\]/$allvariableshashref->{'PRODUCTNAME'}/; # spent 767µs making 109 calls to installer::windows::msiglobal::CORE:subst, avg 7µs/call
# spent 580µs making 218 calls to installer::windows::msiglobal::CORE:substcont, avg 3µs/call | ||
727 | 109 | 296ms | my $keywords = get_keywords_for_sis($sislanguage,$languagefile, "OOO_SIS_KEYWORDS"); # spent 296ms making 109 calls to installer::windows::msiglobal::get_keywords_for_sis, avg 2.72ms/call | ||
728 | 109 | 406ms | my $appname = get_appname_for_sis($sislanguage,$languagefile, "OOO_SIS_APPNAME"); # spent 406ms making 109 calls to installer::windows::msiglobal::get_appname_for_sis, avg 3.72ms/call | ||
729 | 109 | 597µs | my $security = get_security_for_sis(); # spent 597µs making 109 calls to installer::windows::msiglobal::get_security_for_sis, avg 5µs/call | ||
730 | 109 | 509µs | my $wordcount = get_wordcount_for_sis(); # spent 509µs making 109 calls to installer::windows::msiglobal::get_wordcount_for_sis, avg 5µs/call | ||
731 | |||||
732 | 109 | 2.80ms | $msifilename = installer::converter::make_path_conform($msifilename); # spent 2.80ms making 109 calls to installer::converter::make_path_conform, avg 26µs/call | ||
733 | |||||
734 | my $systemcall = $msiinfo . " " . $msifilename . " -g " . $msiversion . " -c " . $codepage | ||||
735 | . " -p " . $template . " -v " . $guid . " -t " . $title . " -a " . $author | ||||
736 | . " -j " . $subject . " -o " . $comment . " -k " . $keywords . " -n " . $appname | ||||
737 | . " -u " . $security . " -w " . $wordcount; | ||||
738 | |||||
739 | 109 | 64.4s | my $returnvalue = system($systemcall); # spent 64.4s making 109 calls to installer::windows::msiglobal::CORE:system, avg 591ms/call | ||
740 | |||||
741 | my $infoline = "Systemcall: $systemcall\n"; | ||||
742 | push( @installer::globals::logfileinfo, $infoline); | ||||
743 | |||||
744 | if ($returnvalue) | ||||
745 | { | ||||
746 | $infoline = "ERROR: Could not execute $systemcall (return $returnvalue)\n"; | ||||
747 | push( @installer::globals::logfileinfo, $infoline); | ||||
748 | } | ||||
749 | else | ||||
750 | { | ||||
751 | $infoline = "Success: Executed $msiinfo successfully!\n"; | ||||
752 | push( @installer::globals::logfileinfo, $infoline); | ||||
753 | } | ||||
754 | } | ||||
755 | |||||
756 | ######################################################################### | ||||
757 | # For more than one language in the installation set: | ||||
758 | # Use one database and create Transformations for all other languages | ||||
759 | ######################################################################### | ||||
760 | |||||
761 | sub create_transforms | ||||
762 | # spent 158s (35.3ms+158) within installer::windows::msiglobal::create_transforms which was called:
# once (35.3ms+158s) by installer::run at line 1700 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
763 | 6513 | 158s | my ($languagesarray, $defaultlanguage, $installdir, $allvariableshashref) = @_; | ||
764 | |||||
765 | 1 | 200µs | installer::logger::include_header_into_logfile("Creating Transforms"); # spent 200µs making 1 call to installer::logger::include_header_into_logfile | ||
766 | |||||
767 | my $cscript = "cscript.exe"; # Has to be in the path | ||||
768 | my $msitran = "msitran.exe"; # Has to be in the path | ||||
769 | my $msidb = "msidb.exe"; # Has to be in the path | ||||
770 | if ( $installer::globals::isunix ) | ||||
771 | { | ||||
772 | $infoline = "ERROR: We cannot create transformations yet (we cannot use cscript.exe when cross-compiling)\n"; | ||||
773 | push( @installer::globals::logfileinfo, $infoline); | ||||
774 | } | ||||
775 | my $tmpdir = $ENV{TMPDIR}; # Variable %TEMP% will be set to it for WiLangId.vbs to work | ||||
776 | my $wilangid = $ENV{WINDOWS_SDK_HOME} . "/Samples/SysMgmt/Msi/scripts/WiLangId.vbs"; | ||||
777 | |||||
778 | 1 | 15µs | my $from = cwd(); # spent 15µs making 1 call to Cwd::__ANON__[Cwd.pm:406] | ||
779 | |||||
780 | my $templatevalue = "1033"; | ||||
781 | |||||
782 | 1 | 24µs | $installdir = installer::converter::make_path_conform($installdir); # spent 24µs making 1 call to installer::converter::make_path_conform | ||
783 | |||||
784 | # Syntax for creating a transformation | ||||
785 | # msitran.exe -g <baseDB> <referenceDB> <transformfile> [<errorhandling>} | ||||
786 | |||||
787 | 1 | 42µs | my $basedbname = get_msidatabasename($allvariableshashref, $defaultlanguage); # spent 42µs making 1 call to installer::windows::msiglobal::get_msidatabasename | ||
788 | $basedbname = $installdir . $installer::globals::separator . $basedbname; | ||||
789 | |||||
790 | my $errorhandling = "f"; # Suppress "change codepage" error | ||||
791 | |||||
792 | # Iterating over all files | ||||
793 | |||||
794 | foreach ( @{$languagesarray} ) | ||||
795 | { | ||||
796 | my $onelanguage = $_; | ||||
797 | |||||
798 | if ( $onelanguage eq $defaultlanguage ) { next; } | ||||
799 | |||||
800 | 108 | 7.40ms | my $referencedbname = get_msidatabasename($allvariableshashref, $onelanguage); # spent 7.40ms making 108 calls to installer::windows::msiglobal::get_msidatabasename, avg 69µs/call | ||
801 | $referencedbname = $installdir . $installer::globals::separator . $referencedbname; | ||||
802 | |||||
803 | 108 | 1.47ms | my $windowslanguage = installer::windows::language::get_windows_language($onelanguage); # spent 1.47ms making 108 calls to installer::windows::language::get_windows_language, avg 14µs/call | ||
804 | my $transformfile = $installdir . $installer::globals::separator . $windowslanguage; | ||||
805 | |||||
806 | my $systemcall = $msitran . " " . " -g " . $basedbname . " " . $referencedbname . " " . $transformfile . " " . $errorhandling; | ||||
807 | |||||
808 | 108 | 90.3s | my $returnvalue = system($systemcall); # spent 90.3s making 108 calls to installer::windows::msiglobal::CORE:system, avg 836ms/call | ||
809 | |||||
810 | my $infoline = "Systemcall: $systemcall\n"; | ||||
811 | push( @installer::globals::logfileinfo, $infoline); | ||||
812 | |||||
813 | # Problem: msitran.exe in version 4.0 always returns "1", even if no failure occurred. | ||||
814 | # Therefore it has to be checked, if this is version 4.0. If yes, if the mst file | ||||
815 | # exists and if it is larger than 0 bytes. If this is true, then no error occurred. | ||||
816 | # File Version of msitran.exe: 4.0.6000.16384 has checksum: "b66190a70145a57773ec769e16777b29". | ||||
817 | # Same for msitran.exe from wntmsci12: "aa25d3445b94ffde8ef0c1efb77a56b8" | ||||
818 | |||||
819 | if ($returnvalue) | ||||
820 | { | ||||
821 | $infoline = "WARNING: Returnvalue of $msitran is not 0. Checking version of $msitran!\n"; | ||||
822 | push( @installer::globals::logfileinfo, $infoline); | ||||
823 | |||||
824 | 108 | 33.3ms | open(FILE, "<$installer::globals::msitranpath") or die "ERROR: Can't open $installer::globals::msitranpath for creating file hash"; # spent 33.3ms making 108 calls to installer::windows::msiglobal::CORE:open, avg 309µs/call | ||
825 | 108 | 436µs | binmode(FILE); # spent 436µs making 108 calls to installer::windows::msiglobal::CORE:binmode, avg 4µs/call | ||
826 | 324 | 47.0ms | my $digest = Digest::MD5->new->addfile(*FILE)->hexdigest; # spent 45.0ms making 108 calls to Digest::MD5::addfile, avg 416µs/call
# spent 1.55ms making 108 calls to Digest::MD5::new, avg 14µs/call
# spent 524µs making 108 calls to Digest::MD5::hexdigest, avg 5µs/call | ||
827 | 216 | 3.50ms | close(FILE); # spent 3.16ms making 108 calls to installer::windows::msiglobal::CORE:close, avg 29µs/call
# spent 343µs making 108 calls to Digest::MD5::DESTROY, avg 3µs/call | ||
828 | |||||
829 | my @problemchecksums = ("b66190a70145a57773ec769e16777b29", "aa25d3445b94ffde8ef0c1efb77a56b8", "748206e54fc93efe6a1aaa9d491f3ad1"); | ||||
830 | my $isproblemchecksum = 0; | ||||
831 | |||||
832 | foreach my $problemchecksum ( @problemchecksums ) | ||||
833 | { | ||||
834 | $infoline = "Checksum of problematic MsiTran.exe: $problemchecksum\n"; | ||||
835 | push( @installer::globals::logfileinfo, $infoline); | ||||
836 | $infoline = "Checksum of used MsiTran.exe: $digest\n"; | ||||
837 | push( @installer::globals::logfileinfo, $infoline); | ||||
838 | if ( $digest eq $problemchecksum ) { $isproblemchecksum = 1; } | ||||
839 | } | ||||
840 | |||||
841 | if ( $isproblemchecksum ) | ||||
842 | { | ||||
843 | # Check existence of mst | ||||
844 | 108 | 25.4ms | if ( -f $transformfile ) # spent 25.4ms making 108 calls to installer::windows::msiglobal::CORE:ftfile, avg 235µs/call | ||
845 | { | ||||
846 | $infoline = "File $transformfile exists.\n"; | ||||
847 | push( @installer::globals::logfileinfo, $infoline); | ||||
848 | 108 | 19.1ms | my $filesize = ( -s $transformfile ); # spent 19.1ms making 108 calls to installer::windows::msiglobal::CORE:ftsize, avg 177µs/call | ||
849 | $infoline = "Size of $transformfile: $filesize\n"; | ||||
850 | push( @installer::globals::logfileinfo, $infoline); | ||||
851 | |||||
852 | if ( $filesize > 0 ) | ||||
853 | { | ||||
854 | $infoline = "Info: Returnvalue $returnvalue of $msitran is no problem :-) .\n"; | ||||
855 | push( @installer::globals::logfileinfo, $infoline); | ||||
856 | $returnvalue = 0; # reset the error | ||||
857 | } | ||||
858 | else | ||||
859 | { | ||||
860 | $infoline = "Filesize indicates that an error occurred.\n"; | ||||
861 | push( @installer::globals::logfileinfo, $infoline); | ||||
862 | } | ||||
863 | } | ||||
864 | else | ||||
865 | { | ||||
866 | $infoline = "File $transformfile does not exist -> An error occurred.\n"; | ||||
867 | push( @installer::globals::logfileinfo, $infoline); | ||||
868 | } | ||||
869 | } | ||||
870 | else | ||||
871 | { | ||||
872 | $infoline = "This is not a problematic version of msitran.exe. Therefore the error is not caused by problematic msitran.exe.\n"; | ||||
873 | push( @installer::globals::logfileinfo, $infoline); | ||||
874 | } | ||||
875 | } | ||||
876 | |||||
877 | if ($returnvalue) | ||||
878 | { | ||||
879 | $infoline = "ERROR: Could not execute $msitran!\n"; | ||||
880 | push( @installer::globals::logfileinfo, $infoline); | ||||
881 | } | ||||
882 | else | ||||
883 | { | ||||
884 | $infoline = "Success: Executed $msitran successfully!\n"; | ||||
885 | push( @installer::globals::logfileinfo, $infoline); | ||||
886 | } | ||||
887 | |||||
888 | # The reference database can be deleted | ||||
889 | |||||
890 | 108 | 141ms | my $result = unlink($referencedbname); # spent 141ms making 108 calls to installer::windows::msiglobal::CORE:unlink, avg 1.31ms/call | ||
891 | # $result contains the number of deleted files | ||||
892 | |||||
893 | if ( $result == 0 ) | ||||
894 | { | ||||
895 | $infoline = "ERROR: Could not remove file $$referencedbname !\n"; | ||||
896 | push( @installer::globals::logfileinfo, $infoline); | ||||
897 | installer::exiter::exit_program($infoline, "create_transforms"); | ||||
898 | } | ||||
899 | |||||
900 | 108 | 19.9ms | chdir($installdir); # spent 19.9ms making 108 calls to installer::windows::msiglobal::CORE:chdir, avg 184µs/call | ||
901 | $systemcall = $msidb . " " . " -d " . $basedbname . " -r " . $windowslanguage; | ||||
902 | 108 | 65.5s | system($systemcall); # spent 65.5s making 108 calls to installer::windows::msiglobal::CORE:system, avg 606ms/call | ||
903 | # fdo#46181 - zh-HK and zh-MO should have fallen back to zh-TW not to zh-CN | ||||
904 | # we need to hack zh-HK and zh-MO LCIDs directly into the MSI | ||||
905 | if($windowslanguage eq '1028') | ||||
906 | { | ||||
907 | 1 | 903µs | rename 1028,3076; # spent 903µs making 1 call to installer::windows::msiglobal::CORE:rename | ||
908 | $systemcall = $msidb . " " . " -d " . $basedbname . " -r " . 3076; | ||||
909 | 1 | 594ms | system($systemcall); # spent 594ms making 1 call to installer::windows::msiglobal::CORE:system | ||
910 | 1 | 992µs | rename 3076,5124; # spent 992µs making 1 call to installer::windows::msiglobal::CORE:rename | ||
911 | $systemcall = $msidb . " " . " -d " . $basedbname . " -r " . 5124; | ||||
912 | 1 | 582ms | system($systemcall); # spent 582ms making 1 call to installer::windows::msiglobal::CORE:system | ||
913 | $templatevalue = $templatevalue . "," . 3076 . "," . 5124; | ||||
914 | 1 | 903µs | rename 5124,1028; # spent 903µs making 1 call to installer::windows::msiglobal::CORE:rename | ||
915 | } | ||||
916 | 108 | 21.4ms | chdir($from); # spent 21.4ms making 108 calls to installer::windows::msiglobal::CORE:chdir, avg 198µs/call | ||
917 | 108 | 35.7ms | unlink($transformfile); # spent 35.7ms making 108 calls to installer::windows::msiglobal::CORE:unlink, avg 331µs/call | ||
918 | |||||
919 | $infoline = "Systemcall: $systemcall\n"; | ||||
920 | push( @installer::globals::logfileinfo, $infoline); | ||||
921 | |||||
922 | if ( $windowslanguage ne '1033') | ||||
923 | { | ||||
924 | $templatevalue = $templatevalue . "," . $windowslanguage; | ||||
925 | } | ||||
926 | } | ||||
927 | |||||
928 | $systemcall = "TEMP=" . $tmpdir . " " . $cscript . " " . $wilangid . " " . $basedbname . " Package " . $templatevalue; | ||||
929 | |||||
930 | 1 | 794ms | $returnvalue = system($systemcall); # spent 794ms making 1 call to installer::windows::msiglobal::CORE:system | ||
931 | |||||
932 | $infoline = "Systemcall: $systemcall\n"; | ||||
933 | push( @installer::globals::logfileinfo, $infoline); | ||||
934 | |||||
935 | if ($returnvalue) | ||||
936 | { | ||||
937 | $infoline = "ERROR: Could not execute WiLangId.vbs!\n"; | ||||
938 | push( @installer::globals::logfileinfo, $infoline); | ||||
939 | } | ||||
940 | else | ||||
941 | { | ||||
942 | $infoline = "Success: Executed WiLangId.vbs successfully!\n"; | ||||
943 | push( @installer::globals::logfileinfo, $infoline); | ||||
944 | } | ||||
945 | } | ||||
946 | |||||
947 | ######################################################################### | ||||
948 | # The default language msi database does not need to contain | ||||
949 | # the language in the database name. Therefore the file | ||||
950 | # is renamed. Example: "openofficeorg20_01.msi" to "openofficeorg20.msi" | ||||
951 | ######################################################################### | ||||
952 | |||||
953 | sub rename_msi_database_in_installset | ||||
954 | # spent 71.8ms (70µs+71.8) within installer::windows::msiglobal::rename_msi_database_in_installset which was called:
# once (70µs+71.8ms) by installer::run at line 1713 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
955 | 9 | 48µs | my ($defaultlanguage, $installdir, $allvariableshashref) = @_; | ||
956 | |||||
957 | 1 | 197µs | installer::logger::include_header_into_logfile("Renaming msi database"); # spent 197µs making 1 call to installer::logger::include_header_into_logfile | ||
958 | |||||
959 | 1 | 48µs | my $olddatabasename = get_msidatabasename($allvariableshashref, $defaultlanguage); # spent 48µs making 1 call to installer::windows::msiglobal::get_msidatabasename | ||
960 | $olddatabasename = $installdir . $installer::globals::separator . $olddatabasename; | ||||
961 | |||||
962 | 1 | 23µs | my $newdatabasename = get_msidatabasename($allvariableshashref); # spent 23µs making 1 call to installer::windows::msiglobal::get_msidatabasename | ||
963 | |||||
964 | $installer::globals::shortmsidatabasename = $newdatabasename; | ||||
965 | |||||
966 | $newdatabasename = $installdir . $installer::globals::separator . $newdatabasename; | ||||
967 | |||||
968 | 1 | 71.5ms | installer::systemactions::rename_one_file($olddatabasename, $newdatabasename); # spent 71.5ms making 1 call to installer::systemactions::rename_one_file | ||
969 | |||||
970 | $installer::globals::msidatabasename = $newdatabasename; | ||||
971 | } | ||||
972 | |||||
973 | ################################################################# | ||||
974 | # Copying MergeModules for the Windows installer into the | ||||
975 | # installation set. The list of MergeModules is located | ||||
976 | # in %installer::globals::copy_msm_files | ||||
977 | ################################################################# | ||||
978 | |||||
979 | sub copy_merge_modules_into_installset | ||||
980 | { | ||||
981 | my ($installdir) = @_; | ||||
982 | |||||
983 | installer::logger::include_header_into_logfile("Copying Merge files into installation set"); | ||||
984 | |||||
985 | my $cabfile; | ||||
986 | foreach $cabfile ( keys %installer::globals::copy_msm_files ) | ||||
987 | { | ||||
988 | my $sourcefile = $installer::globals::copy_msm_files{$cabfile}; | ||||
989 | my $destfile = $installdir . $installer::globals::separator . $cabfile; | ||||
990 | |||||
991 | installer::systemactions::copy_one_file($sourcefile, $destfile); | ||||
992 | } | ||||
993 | } | ||||
994 | |||||
995 | ################################################################# | ||||
996 | # Getting a list of GUID using uuidgen.exe. | ||||
997 | # This works only on Windows | ||||
998 | ################################################################# | ||||
999 | |||||
1000 | sub get_guid_list | ||||
1001 | # spent 37.4s (15.1ms+37.4) within installer::windows::msiglobal::get_guid_list which was called 110 times, avg 340ms/call:
# 109 times (15.0ms+37.3s) by installer::windows::msiglobal::get_packagecode_for_sis at line 593, avg 342ms/call
# once (147µs+123ms) by installer::windows::msiglobal::set_global_code_variables at line 1455 | ||||
1002 | 1760 | 37.4s | my ($number, $log) = @_; | ||
1003 | |||||
1004 | 110 | 12.8ms | if ( $log ) { installer::logger::include_header_into_logfile("Generating $number GUID"); } # spent 12.8ms making 110 calls to installer::logger::include_header_into_logfile, avg 116µs/call | ||
1005 | |||||
1006 | my $uuidgen = $ENV{'UUIDGEN'}; # Has to be in the path | ||||
1007 | |||||
1008 | # "-c" for uppercase output | ||||
1009 | |||||
1010 | my $systemcall = "$uuidgen -n$number |"; | ||||
1011 | if ( $installer::globals::isunix ) | ||||
1012 | { | ||||
1013 | # -n is not present in the non-windows uuidgen | ||||
1014 | $systemcall = "for I in `seq 1 $number` ; do uuidgen ; done |"; | ||||
1015 | } | ||||
1016 | 110 | 36.3s | open (UUIDGEN, "$systemcall" ) or die("uuidgen is missing."); # spent 36.3s making 110 calls to installer::windows::msiglobal::CORE:open, avg 330ms/call | ||
1017 | 110 | 912ms | my @uuidlist = <UUIDGEN>; # spent 912ms making 110 calls to installer::windows::msiglobal::CORE:readline, avg 8.29ms/call | ||
1018 | 110 | 193ms | close (UUIDGEN); # spent 193ms making 110 calls to installer::windows::msiglobal::CORE:close, avg 1.75ms/call | ||
1019 | |||||
1020 | my $infoline = "Systemcall: $systemcall\n"; | ||||
1021 | if ( $log ) { push( @installer::globals::logfileinfo, $infoline); } | ||||
1022 | |||||
1023 | my $comparenumber = $#uuidlist + 1; | ||||
1024 | |||||
1025 | if ( $comparenumber == $number ) | ||||
1026 | { | ||||
1027 | $infoline = "Success: Executed $uuidgen successfully!\n"; | ||||
1028 | if ( $log ) { push( @installer::globals::logfileinfo, $infoline); } | ||||
1029 | } | ||||
1030 | else | ||||
1031 | { | ||||
1032 | $infoline = "ERROR: Could not execute $uuidgen successfully!\n"; | ||||
1033 | if ( $log ) { push( @installer::globals::logfileinfo, $infoline); } | ||||
1034 | } | ||||
1035 | |||||
1036 | # uppercase, no longer "-c", because this is only supported in uuidgen.exe v.1.01 | ||||
1037 | for ( my $i = 0; $i <= $#uuidlist; $i++ ) { $uuidlist[$i] = uc($uuidlist[$i]); } | ||||
1038 | |||||
1039 | return \@uuidlist; | ||||
1040 | } | ||||
1041 | |||||
1042 | ################################################################# | ||||
1043 | # Calculating a GUID with a string using md5. | ||||
1044 | ################################################################# | ||||
1045 | |||||
1046 | sub calculate_guid | ||||
1047 | # spent 380ms (259+121) within installer::windows::msiglobal::calculate_guid which was called 9060 times, avg 42µs/call:
# 9060 times (259ms+121ms) by installer::windows::msiglobal::set_uuid_into_component_table at line 1106, avg 42µs/call | ||||
1048 | 81540 | 395ms | my ( $string ) = @_; | ||
1049 | |||||
1050 | my $guid = ""; | ||||
1051 | |||||
1052 | 9060 | 26.5ms | my $md5 = Digest::MD5->new; # spent 26.5ms making 9060 calls to Digest::MD5::new, avg 3µs/call | ||
1053 | 9060 | 15.9ms | $md5->add($string); # spent 15.9ms making 9060 calls to Digest::MD5::add, avg 2µs/call | ||
1054 | 9060 | 23.6ms | my $digest = $md5->hexdigest; # spent 23.6ms making 9060 calls to Digest::MD5::hexdigest, avg 3µs/call | ||
1055 | $digest = uc($digest); | ||||
1056 | |||||
1057 | 9060 | 34.0ms | my ($first, $second, $third, $fourth, $fifth) = unpack ('A8 A4 A4 A4 A12', $digest); # spent 34.0ms making 9060 calls to installer::windows::msiglobal::CORE:unpack, avg 4µs/call | ||
1058 | $guid = "$first-$second-$third-$fourth-$fifth"; | ||||
1059 | |||||
1060 | return $guid; | ||||
1061 | } | ||||
1062 | |||||
1063 | ################################################################# | ||||
1064 | # Filling real component GUID into the component table. | ||||
1065 | # This works only on Windows | ||||
1066 | ################################################################# | ||||
1067 | |||||
1068 | sub set_uuid_into_component_table | ||||
1069 | # spent 25.6s (13.7+11.9) within installer::windows::msiglobal::set_uuid_into_component_table which was called 109 times, avg 235ms/call:
# 109 times (13.7s+11.9s) by installer::run at line 1676 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 235ms/call | ||||
1070 | 6025557 | 20.2s | my ($idtdirbase, $allvariables) = @_; | ||
1071 | |||||
1072 | my $componenttablename = $idtdirbase . $installer::globals::separator . "Componen.idt"; | ||||
1073 | |||||
1074 | 109 | 4.35s | my $componenttable = installer::files::read_file($componenttablename); # spent 4.35s making 109 calls to installer::files::read_file, avg 39.9ms/call | ||
1075 | |||||
1076 | # For update and patch reasons (small update) the GUID of an existing component must not change! | ||||
1077 | # The collection of component GUIDs is saved in the directory $installer::globals::idttemplatepath in the file "components.txt" | ||||
1078 | |||||
1079 | my $infoline = ""; | ||||
1080 | my $counter = 0; | ||||
1081 | |||||
1082 | for ( my $i = 3; $i <= $#{$componenttable}; $i++ ) # ignoring the first three lines | ||||
1083 | { | ||||
1084 | my $oneline = ${$componenttable}[$i]; | ||||
1085 | my $componentname = ""; | ||||
1086 | 987540 | 2.51s | if ( $oneline =~ /^\s*(\S+?)\t/ ) { $componentname = $1; } # spent 2.51s making 987540 calls to installer::windows::msiglobal::CORE:match, avg 3µs/call | ||
1087 | |||||
1088 | my $uuid = ""; | ||||
1089 | |||||
1090 | if ( exists($installer::globals::calculated_component_guids{$componentname})) | ||||
1091 | { | ||||
1092 | $uuid = $installer::globals::calculated_component_guids{$componentname}; | ||||
1093 | } | ||||
1094 | else | ||||
1095 | { | ||||
1096 | # Calculating new GUID with the help of the component name. | ||||
1097 | my $useproductversion = 1; | ||||
1098 | if ( exists($installer::globals::base_independent_components{$componentname})) { $useproductversion = 0; } | ||||
1099 | my $sourcestring = $componentname; | ||||
1100 | |||||
1101 | if ( $useproductversion ) | ||||
1102 | { | ||||
1103 | if ( ! exists($allvariables->{'PRODUCTVERSION'}) ) { installer::exiter::exit_program("ERROR: Could not find variable \"PRODUCTVERSION\" (required value for GUID creation)!", "set_uuid_into_component_table"); } | ||||
1104 | $sourcestring = $sourcestring . "_" . $allvariables->{'PRODUCTVERSION'}; | ||||
1105 | } | ||||
1106 | 18120 | 401ms | $uuid = calculate_guid($sourcestring); # spent 380ms making 9060 calls to installer::windows::msiglobal::calculate_guid, avg 42µs/call
# spent 21.0ms making 9060 calls to Digest::MD5::DESTROY, avg 2µs/call | ||
1107 | $counter++; | ||||
1108 | |||||
1109 | # checking, if there is a conflict with an already created guid | ||||
1110 | if ( exists($installer::globals::allcalculated_guids{$uuid}) ) { installer::exiter::exit_program("ERROR: \"$uuid\" was already created before!", "set_uuid_into_component_table"); } | ||||
1111 | $installer::globals::allcalculated_guids{$uuid} = 1; | ||||
1112 | $installer::globals::calculated_component_guids{$componentname} = $uuid; | ||||
1113 | } | ||||
1114 | |||||
1115 | 987540 | 4.01s | ${$componenttable}[$i] =~ s/COMPONENTGUID/$uuid/; # spent 4.01s making 987540 calls to installer::windows::msiglobal::CORE:subst, avg 4µs/call | ||
1116 | } | ||||
1117 | |||||
1118 | 109 | 600ms | installer::files::save_file($componenttablename, $componenttable); # spent 600ms making 109 calls to installer::files::save_file, avg 5.51ms/call | ||
1119 | } | ||||
1120 | |||||
1121 | ######################################################################### | ||||
1122 | # Adding final 64 properties into msi database, if required. | ||||
1123 | # RegLocator : +16 in type column to search in 64 bit registry. | ||||
1124 | # All conditions: "VersionNT" -> "VersionNT64" (several tables). | ||||
1125 | # Already done: "+256" in Attributes column of table "Component". | ||||
1126 | # Still following: Setting "x64" instead of "Intel" in Summary | ||||
1127 | # Information Stream of msi database in "get_template_for_sis". | ||||
1128 | ######################################################################### | ||||
1129 | |||||
1130 | sub prepare_64bit_database | ||||
1131 | # spent 2.12ms within installer::windows::msiglobal::prepare_64bit_database which was called 109 times, avg 19µs/call:
# 109 times (2.12ms+0s) by installer::run at line 1677 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 19µs/call | ||||
1132 | 327 | 1.75ms | my ($basedir, $allvariables) = @_; | ||
1133 | |||||
1134 | my $infoline = ""; | ||||
1135 | |||||
1136 | if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) | ||||
1137 | { | ||||
1138 | # 1. Beginning with table "RegLocat.idt". Adding "16" to the type. | ||||
1139 | |||||
1140 | my $reglocatfile = ""; | ||||
1141 | my $reglocatfilename = $basedir . $installer::globals::separator . "RegLocat.idt"; | ||||
1142 | |||||
1143 | if ( -f $reglocatfilename ) | ||||
1144 | { | ||||
1145 | my $saving_required = 0; | ||||
1146 | $reglocatfile = installer::files::read_file($reglocatfilename); | ||||
1147 | |||||
1148 | for ( my $i = 3; $i <= $#{$reglocatfile}; $i++ ) # ignoring the first three lines | ||||
1149 | { | ||||
1150 | my $oneline = ${$reglocatfile}[$i]; | ||||
1151 | |||||
1152 | if ( $oneline =~ /^\s*\#/ ) { next; } # this is a comment line | ||||
1153 | if ( $oneline =~ /^\s*$/ ) { next; } | ||||
1154 | |||||
1155 | if ( $oneline =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(\d+)\s*$/ ) | ||||
1156 | { | ||||
1157 | # Syntax: Signature_ Root Key Name Type | ||||
1158 | my $sig = $1; | ||||
1159 | my $root = $2; | ||||
1160 | my $key = $3; | ||||
1161 | my $name = $4; | ||||
1162 | my $type = $5; | ||||
1163 | |||||
1164 | $type = $type + 16; | ||||
1165 | |||||
1166 | my $newline = $sig . "\t" . $root . "\t" . $key . "\t" . $name . "\t" . $type . "\n"; | ||||
1167 | ${$reglocatfile}[$i] = $newline; | ||||
1168 | |||||
1169 | $saving_required = 1; | ||||
1170 | } | ||||
1171 | } | ||||
1172 | |||||
1173 | if ( $saving_required ) | ||||
1174 | { | ||||
1175 | # Saving the files | ||||
1176 | installer::files::save_file($reglocatfilename ,$reglocatfile); | ||||
1177 | $infoline = "Making idt file 64 bit conform: $reglocatfilename\n"; | ||||
1178 | push(@installer::globals::logfileinfo, $infoline); | ||||
1179 | } | ||||
1180 | } | ||||
1181 | |||||
1182 | # 2. Replacing all occurences of "VersionNT" by "VersionNT64" | ||||
1183 | |||||
1184 | my @versionnt_files = ("Componen.idt", "InstallE.idt", "InstallU.idt", "LaunchCo.idt"); | ||||
1185 | |||||
1186 | foreach my $onefile ( @versionnt_files ) | ||||
1187 | { | ||||
1188 | my $fullfilename = $basedir . $installer::globals::separator . $onefile; | ||||
1189 | |||||
1190 | if ( -f $fullfilename ) | ||||
1191 | { | ||||
1192 | my $saving_required = 0; | ||||
1193 | $filecontent = installer::files::read_file($fullfilename); | ||||
1194 | |||||
1195 | for ( my $i = 3; $i <= $#{$filecontent}; $i++ ) # ignoring the first three lines | ||||
1196 | { | ||||
1197 | my $oneline = ${$filecontent}[$i]; | ||||
1198 | |||||
1199 | if ( $oneline =~ /\bVersionNT\b/ ) | ||||
1200 | { | ||||
1201 | ${$filecontent}[$i] =~ s/\bVersionNT\b/VersionNT64/g; | ||||
1202 | $saving_required = 1; | ||||
1203 | } | ||||
1204 | } | ||||
1205 | |||||
1206 | if ( $saving_required ) | ||||
1207 | { | ||||
1208 | # Saving the files | ||||
1209 | installer::files::save_file($fullfilename ,$filecontent); | ||||
1210 | $infoline = "Making idt file 64 bit conform: $fullfilename\n"; | ||||
1211 | push(@installer::globals::logfileinfo, $infoline); | ||||
1212 | } | ||||
1213 | } | ||||
1214 | } | ||||
1215 | } | ||||
1216 | |||||
1217 | } | ||||
1218 | |||||
1219 | ################################################################# | ||||
1220 | # Include all cab files into the msi database. | ||||
1221 | # This works only on Windows | ||||
1222 | ################################################################# | ||||
1223 | |||||
1224 | sub include_cabs_into_msi | ||||
1225 | # spent 4.97s (280µs+4.97) within installer::windows::msiglobal::include_cabs_into_msi which was called:
# once (280µs+4.97s) by installer::run at line 1759 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1226 | 29 | 4.97s | my ($installdir) = @_; | ||
1227 | |||||
1228 | 1 | 152µs | installer::logger::include_header_into_logfile("Including cabs into msi database"); # spent 152µs making 1 call to installer::logger::include_header_into_logfile | ||
1229 | |||||
1230 | 1 | 20µs | my $from = cwd(); # spent 20µs making 1 call to Cwd::__ANON__[Cwd.pm:406] | ||
1231 | my $to = $installdir; | ||||
1232 | |||||
1233 | 1 | 140µs | chdir($to); # spent 140µs making 1 call to installer::windows::msiglobal::CORE:chdir | ||
1234 | |||||
1235 | my $infoline = "Changing into directory: $to"; | ||||
1236 | push( @installer::globals::logfileinfo, $infoline); | ||||
1237 | |||||
1238 | my $msidb = "msidb.exe"; # Has to be in the path | ||||
1239 | if ( $installer::globals::isunix ) | ||||
1240 | { | ||||
1241 | $msidb = "$ENV{'OUTDIR_FOR_BUILD'}/bin/msidb.exe"; | ||||
1242 | } | ||||
1243 | my $extraslash = ""; # Has to be set for non-ActiveState perl | ||||
1244 | |||||
1245 | my $msifilename = $installer::globals::msidatabasename; | ||||
1246 | |||||
1247 | 1 | 37µs | $msifilename = installer::converter::make_path_conform($msifilename); # spent 37µs making 1 call to installer::converter::make_path_conform | ||
1248 | |||||
1249 | # msidb.exe really wants backslashes. (And double escaping because system() expands the string.) | ||||
1250 | 1 | 22µs | $msifilename =~ s/\//\\\\/g; # spent 22µs making 1 call to installer::windows::msiglobal::CORE:subst | ||
1251 | $extraslash = "\\"; | ||||
1252 | |||||
1253 | 1 | 531µs | my $allcabfiles = installer::systemactions::find_file_with_file_extension("cab", $installdir); # spent 531µs making 1 call to installer::systemactions::find_file_with_file_extension | ||
1254 | |||||
1255 | for ( my $i = 0; $i <= $#{$allcabfiles}; $i++ ) | ||||
1256 | { | ||||
1257 | my $systemcall = $msidb . " -d " . $msifilename . " -a " . ${$allcabfiles}[$i]; | ||||
1258 | |||||
1259 | 1 | 4.94s | my $returnvalue = system($systemcall); # spent 4.94s making 1 call to installer::windows::msiglobal::CORE:system | ||
1260 | |||||
1261 | $infoline = "Systemcall: $systemcall\n"; | ||||
1262 | push( @installer::globals::logfileinfo, $infoline); | ||||
1263 | |||||
1264 | if ($returnvalue) | ||||
1265 | { | ||||
1266 | $infoline = "ERROR: Could not execute $systemcall !\n"; | ||||
1267 | push( @installer::globals::logfileinfo, $infoline); | ||||
1268 | } | ||||
1269 | else | ||||
1270 | { | ||||
1271 | $infoline = "Success: Executed $systemcall successfully!\n"; | ||||
1272 | push( @installer::globals::logfileinfo, $infoline); | ||||
1273 | } | ||||
1274 | |||||
1275 | # deleting the cab file | ||||
1276 | |||||
1277 | 1 | 32.9ms | unlink(${$allcabfiles}[$i]); # spent 32.9ms making 1 call to installer::windows::msiglobal::CORE:unlink | ||
1278 | |||||
1279 | $infoline = "Deleted cab file: ${$allcabfiles}[$i]\n"; | ||||
1280 | push( @installer::globals::logfileinfo, $infoline); | ||||
1281 | } | ||||
1282 | |||||
1283 | $infoline = "Changing back into directory: $from"; | ||||
1284 | push( @installer::globals::logfileinfo, $infoline); | ||||
1285 | |||||
1286 | 1 | 278µs | chdir($from); # spent 278µs making 1 call to installer::windows::msiglobal::CORE:chdir | ||
1287 | } | ||||
1288 | |||||
1289 | ################################################################# | ||||
1290 | # Executing the created batch file to pack all files. | ||||
1291 | # This works only on Windows | ||||
1292 | ################################################################# | ||||
1293 | |||||
1294 | sub execute_packaging | ||||
1295 | # spent 73.7s (-857+931) within installer::windows::msiglobal::execute_packaging which was called:
# once (-857s+931s) by installer::run at line 1758 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1296 | 166330 | 933s | my ($localpackjobref, $loggingdir, $allvariables) = @_; | ||
1297 | |||||
1298 | 1 | 202µs | installer::logger::include_header_into_logfile("Packaging process"); # spent 202µs making 1 call to installer::logger::include_header_into_logfile | ||
1299 | |||||
1300 | 1 | 114µs | installer::logger::include_timestamp_into_logfile("Performance Info: Execute packaging start"); # spent 114µs making 1 call to installer::logger::include_timestamp_into_logfile | ||
1301 | |||||
1302 | my $infoline = ""; | ||||
1303 | 1 | 16µs | my $from = cwd(); # spent 16µs making 1 call to Cwd::__ANON__[Cwd.pm:406] | ||
1304 | my $to = $loggingdir; | ||||
1305 | |||||
1306 | 1 | 208µs | chdir($to); # spent 208µs making 1 call to installer::windows::msiglobal::CORE:chdir | ||
1307 | $infoline = "chdir: $to \n"; | ||||
1308 | push( @installer::globals::logfileinfo, $infoline); | ||||
1309 | |||||
1310 | # the ddf file contains relative paths, it is necessary to change into the temp directory | ||||
1311 | $to = $installer::globals::temppath; | ||||
1312 | 1 | 122µs | chdir($to); # spent 122µs making 1 call to installer::windows::msiglobal::CORE:chdir | ||
1313 | $infoline = "chdir: $to \n"; | ||||
1314 | push( @installer::globals::logfileinfo, $infoline); | ||||
1315 | |||||
1316 | # changing the tmp directory, because makecab.exe generates temporary cab files | ||||
1317 | my $origtemppath = ""; | ||||
1318 | if ( $ENV{'TMP'} ) { $origtemppath = $ENV{'TMP'}; } | ||||
1319 | $ENV{'TMP'} = $installer::globals::temppath; # setting TMP to the new unique directory! | ||||
1320 | |||||
1321 | my $maxmakecabcalls = 3; | ||||
1322 | my $allmakecabcalls = $#{$localpackjobref} + 1; | ||||
1323 | |||||
1324 | for ( my $i = 0; $i <= $#{$localpackjobref}; $i++ ) | ||||
1325 | { | ||||
1326 | my $systemcall = ${$localpackjobref}[$i]; | ||||
1327 | |||||
1328 | my $callscounter = $i + 1; | ||||
1329 | |||||
1330 | 1 | 11µs | installer::logger::print_message( "... makecab.exe ($callscounter/$allmakecabcalls) ... \n" ); # spent 11µs making 1 call to installer::logger::print_message | ||
1331 | |||||
1332 | for ( my $n = 1; $n <= $maxmakecabcalls; $n++ ) | ||||
1333 | { | ||||
1334 | my @ddfoutput = (); | ||||
1335 | |||||
1336 | $infoline = "Systemcall: $systemcall"; | ||||
1337 | push( @installer::globals::logfileinfo, $infoline); | ||||
1338 | |||||
1339 | 1 | 376ms | open (DDF, "$systemcall"); # spent 376ms making 1 call to installer::windows::msiglobal::CORE:open | ||
1340 | 166292 | 930s | while (<DDF>) {push(@ddfoutput, $_); } # spent 930s making 166292 calls to installer::windows::msiglobal::CORE:readline, avg 5.59ms/call | ||
1341 | 1 | 227µs | close (DDF); # spent 227µs making 1 call to installer::windows::msiglobal::CORE:close | ||
1342 | |||||
1343 | my $returnvalue = $?; # $? contains the return value of the systemcall | ||||
1344 | |||||
1345 | if ($returnvalue) | ||||
1346 | { | ||||
1347 | if ( $n < $maxmakecabcalls ) | ||||
1348 | { | ||||
1349 | installer::logger::print_message( "makecab_error (Try $n): Trying again \n" ); | ||||
1350 | $infoline = "makecab_error (Try $n): $systemcall !"; | ||||
1351 | } | ||||
1352 | else | ||||
1353 | { | ||||
1354 | installer::logger::print_message( "ERROR (Try $n): Abort packing \n" ); | ||||
1355 | $infoline = "ERROR (Try $n): $systemcall !"; | ||||
1356 | } | ||||
1357 | |||||
1358 | push( @installer::globals::logfileinfo, $infoline); | ||||
1359 | |||||
1360 | for ( my $m = 0; $m <= $#ddfoutput; $m++ ) | ||||
1361 | { | ||||
1362 | if ( $ddfoutput[$m] =~ /(ERROR\:.*?)\s*$/ ) | ||||
1363 | { | ||||
1364 | $infoline = $1 . "\n"; | ||||
1365 | if ( $n < $maxmakecabcalls ) { $infoline =~ s/ERROR\:/makecab_error\:/i; } | ||||
1366 | installer::logger::print_message( $infoline ); | ||||
1367 | push( @installer::globals::logfileinfo, $infoline); | ||||
1368 | } | ||||
1369 | } | ||||
1370 | |||||
1371 | if ( $n == $maxmakecabcalls ) { installer::exiter::exit_program("ERROR: \"$systemcall\"!", "execute_packaging"); } | ||||
1372 | } | ||||
1373 | else | ||||
1374 | { | ||||
1375 | $infoline = "Success (Try $n): $systemcall"; | ||||
1376 | push( @installer::globals::logfileinfo, $infoline); | ||||
1377 | last; | ||||
1378 | } | ||||
1379 | } | ||||
1380 | } | ||||
1381 | |||||
1382 | 1 | 330µs | installer::logger::include_timestamp_into_logfile("Performance Info: Execute packaging end"); # spent 330µs making 1 call to installer::logger::include_timestamp_into_logfile | ||
1383 | |||||
1384 | # setting back to the original tmp directory | ||||
1385 | $ENV{'TMP'} = $origtemppath; | ||||
1386 | |||||
1387 | 1 | 459µs | chdir($from); # spent 459µs making 1 call to installer::windows::msiglobal::CORE:chdir | ||
1388 | $infoline = "chdir: $from \n"; | ||||
1389 | push( @installer::globals::logfileinfo, $infoline); | ||||
1390 | } | ||||
1391 | |||||
1392 | ############################################################### | ||||
1393 | # Setting the global variables ProductCode and the UpgradeCode | ||||
1394 | ############################################################### | ||||
1395 | |||||
1396 | sub set_global_code_variables | ||||
1397 | # spent 124ms (143µs+124) within installer::windows::msiglobal::set_global_code_variables which was called:
# once (143µs+124ms) by installer::run at line 604 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1398 | 29 | 155µs | my ( $languagesref, $languagestringref, $allvariableshashref, $alloldproperties ) = @_; | ||
1399 | |||||
1400 | # In the msi template directory a files "codes.txt" has to exist, in which the ProductCode | ||||
1401 | # and the UpgradeCode for the product are defined. | ||||
1402 | # The name "codes.txt" can be overwritten in Product definition with CODEFILENAME . | ||||
1403 | # Default $installer::globals::codefilename is defined in parameter.pm. | ||||
1404 | |||||
1405 | if ( $allvariableshashref->{'CODEFILENAME'} ) | ||||
1406 | { | ||||
1407 | $installer::globals::codefilename = $installer::globals::idttemplatepath . $installer::globals::separator . $allvariableshashref->{'CODEFILENAME'}; | ||||
1408 | installer::files::check_file($installer::globals::codefilename); | ||||
1409 | } | ||||
1410 | |||||
1411 | my $infoline = "Using Codes file: $installer::globals::codefilename \n"; | ||||
1412 | push( @installer::globals::logfileinfo, $infoline); | ||||
1413 | |||||
1414 | 1 | 473µs | my $codefile = installer::files::read_file($installer::globals::codefilename); # spent 473µs making 1 call to installer::files::read_file | ||
1415 | |||||
1416 | my $onelanguage = ""; | ||||
1417 | |||||
1418 | if ( $#{$languagesref} > 0 ) # more than one language | ||||
1419 | { | ||||
1420 | if (( $installer::globals::added_english ) && ( $#{$languagesref} == 1 )) # only multilingual because of added English | ||||
1421 | { | ||||
1422 | $onelanguage = ${$languagesref}[1]; # setting the first language, that is not english | ||||
1423 | } | ||||
1424 | else | ||||
1425 | { | ||||
1426 | 3 | 5µs | if (( ${$languagesref}[1] =~ /jp/ ) || # spent 5µs making 3 calls to installer::windows::msiglobal::CORE:match, avg 2µs/call | ||
1427 | ( ${$languagesref}[1] =~ /ko/ ) || | ||||
1428 | ( ${$languagesref}[1] =~ /zh/ )) | ||||
1429 | { | ||||
1430 | $onelanguage = "multiasia"; | ||||
1431 | } | ||||
1432 | else | ||||
1433 | { | ||||
1434 | $onelanguage = "multiwestern"; | ||||
1435 | } | ||||
1436 | } | ||||
1437 | } | ||||
1438 | else # only one language | ||||
1439 | { | ||||
1440 | $onelanguage = ${$languagesref}[0]; | ||||
1441 | } | ||||
1442 | |||||
1443 | # ProductCode must not change, if Windows patches shall be applied | ||||
1444 | if ( $installer::globals::updatedatabase ) | ||||
1445 | { | ||||
1446 | $installer::globals::productcode = $alloldproperties->{'ProductCode'}; | ||||
1447 | } | ||||
1448 | elsif ( $installer::globals::prepare_winpatch ) | ||||
1449 | { | ||||
1450 | # ProductCode has to be specified in each language | ||||
1451 | my $searchstring = "PRODUCTCODE"; | ||||
1452 | my $codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile); | ||||
1453 | $installer::globals::productcode = installer::windows::idtglobal::get_code_from_code_block($codeblock, $onelanguage); | ||||
1454 | } else { | ||||
1455 | 1 | 123ms | my $guidref = get_guid_list(1, 1); # only one GUID shall be generated # spent 123ms making 1 call to installer::windows::msiglobal::get_guid_list | ||
1456 | 1 | 22µs | ${$guidref}[0] =~ s/\s*$//; # removing ending spaces # spent 22µs making 1 call to installer::windows::msiglobal::CORE:subst | ||
1457 | $installer::globals::productcode = "\{" . ${$guidref}[0] . "\}"; | ||||
1458 | } | ||||
1459 | |||||
1460 | if ( $installer::globals::patch ) # patch upgrade codes are defined in soffice.lst | ||||
1461 | { | ||||
1462 | if ( $allvariableshashref->{'PATCHUPGRADECODE'} ) { $installer::globals::upgradecode = $allvariableshashref->{'PATCHUPGRADECODE'}; } | ||||
1463 | else { installer::exiter::exit_program("ERROR: PATCHUPGRADECODE not defined in list file!", "set_global_code_variables"); } | ||||
1464 | } | ||||
1465 | else | ||||
1466 | { | ||||
1467 | # UpgradeCode can take english as default, if not defined in specified language | ||||
1468 | |||||
1469 | $searchstring = "UPGRADECODE"; # searching in the codes.txt file | ||||
1470 | 1 | 407µs | $codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile); # spent 407µs making 1 call to installer::windows::idtglobal::get_language_block_from_language_file | ||
1471 | 1 | 112µs | $installer::globals::upgradecode = installer::windows::idtglobal::get_language_string_from_language_block($codeblock, $onelanguage, ""); # spent 112µs making 1 call to installer::windows::idtglobal::get_language_string_from_language_block | ||
1472 | } | ||||
1473 | |||||
1474 | if ( $installer::globals::upgradecode eq "" ) { installer::exiter::exit_program("ERROR: UpgradeCode not defined in $installer::globals::codefilename !", "set_global_code_variables"); } | ||||
1475 | |||||
1476 | $infoline = "Setting ProductCode to: $installer::globals::productcode \n"; | ||||
1477 | push( @installer::globals::logfileinfo, $infoline); | ||||
1478 | $infoline = "Setting UpgradeCode to: $installer::globals::upgradecode \n"; | ||||
1479 | push( @installer::globals::logfileinfo, $infoline); | ||||
1480 | |||||
1481 | # Adding both variables into the variables array | ||||
1482 | |||||
1483 | $allvariableshashref->{'PRODUCTCODE'} = $installer::globals::productcode; | ||||
1484 | $allvariableshashref->{'UPGRADECODE'} = $installer::globals::upgradecode; | ||||
1485 | |||||
1486 | $infoline = "Defined variable PRODUCTCODE: $installer::globals::productcode \n"; | ||||
1487 | push( @installer::globals::logfileinfo, $infoline); | ||||
1488 | |||||
1489 | $infoline = "Defined variable UPGRADECODE: $installer::globals::upgradecode \n"; | ||||
1490 | push( @installer::globals::logfileinfo, $infoline); | ||||
1491 | |||||
1492 | } | ||||
1493 | |||||
1494 | ############################################################### | ||||
1495 | # Setting the product version used in property table and | ||||
1496 | # upgrade table. Saving in global variable $msiproductversion | ||||
1497 | ############################################################### | ||||
1498 | |||||
1499 | sub set_msiproductversion | ||||
1500 | # spent 43µs (32+11) within installer::windows::msiglobal::set_msiproductversion which was called:
# once (32µs+11µs) by installer::run at line 1483 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1501 | 7 | 45µs | my ( $allvariables ) = @_; | ||
1502 | |||||
1503 | my $productversion = $allvariables->{'PACKAGEVERSION'}; | ||||
1504 | |||||
1505 | 1 | 8µs | if ( $productversion =~ /^\s*(\d+)\.(\d+)\.(\d+)\s*$/ ) # spent 8µs making 1 call to installer::windows::msiglobal::CORE:match | ||
1506 | { | ||||
1507 | $productversion = $1 . "\." . $2 . "\." . $3 . "\." . $installer::globals::buildid; | ||||
1508 | } | ||||
1509 | |||||
1510 | $installer::globals::msiproductversion = $productversion; | ||||
1511 | |||||
1512 | # Setting $installer::globals::msimajorproductversion, to differ between old version in upgrade table | ||||
1513 | |||||
1514 | 1 | 3µs | if ( $installer::globals::msiproductversion =~ /^\s*(\d+)\./ ) # spent 3µs making 1 call to installer::windows::msiglobal::CORE:match | ||
1515 | { | ||||
1516 | my $major = $1; | ||||
1517 | $installer::globals::msimajorproductversion = $major . "\.0\.0"; | ||||
1518 | } | ||||
1519 | } | ||||
1520 | |||||
1521 | ################################################################################# | ||||
1522 | # Including the msi product version into the bootstrap.ini, Windows only | ||||
1523 | ################################################################################# | ||||
1524 | |||||
1525 | sub put_msiproductversion_into_bootstrapfile | ||||
1526 | # spent 39.7ms (38.4+1.24) within installer::windows::msiglobal::put_msiproductversion_into_bootstrapfile which was called:
# once (38.4ms+1.24ms) by installer::run at line 1484 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1527 | 31795 | 38.5ms | my ($filesref) = @_; | ||
1528 | |||||
1529 | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||||
1530 | { | ||||
1531 | my $onefile = ${$filesref}[$i]; | ||||
1532 | |||||
1533 | if ( $onefile->{'gid'} eq "gid_Brand_Profile_Version_Ini" ) | ||||
1534 | { | ||||
1535 | 1 | 697µs | my $file = installer::files::read_file($onefile->{'sourcepath'}); # spent 697µs making 1 call to installer::files::read_file | ||
1536 | |||||
1537 | for ( my $j = 0; $j <= $#{$file}; $j++ ) | ||||
1538 | { | ||||
1539 | 17 | 21µs | ${$file}[$j] =~ s/\<msiproductversion\>/$installer::globals::msiproductversion/; # spent 21µs making 17 calls to installer::windows::msiglobal::CORE:subst, avg 1µs/call | ||
1540 | } | ||||
1541 | |||||
1542 | 1 | 519µs | installer::files::save_file($onefile->{'sourcepath'}, $file); # spent 519µs making 1 call to installer::files::save_file | ||
1543 | |||||
1544 | last; | ||||
1545 | } | ||||
1546 | } | ||||
1547 | } | ||||
1548 | |||||
1549 | #################################################################################### | ||||
1550 | # Updating the file Property.idt dynamically | ||||
1551 | # Content: | ||||
1552 | # Property Value | ||||
1553 | #################################################################################### | ||||
1554 | |||||
1555 | sub update_reglocat_table | ||||
1556 | # spent 110ms (8.73+101) within installer::windows::msiglobal::update_reglocat_table which was called 109 times, avg 1.01ms/call:
# 109 times (8.73ms+101ms) by installer::run at line 1647 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 1.01ms/call | ||||
1557 | 1962 | 29.4ms | my ($basedir, $allvariables) = @_; | ||
1558 | |||||
1559 | my $reglocatfilename = $basedir . $installer::globals::separator . "RegLocat.idt"; | ||||
1560 | |||||
1561 | # Only do something, if this file exists | ||||
1562 | |||||
1563 | 109 | 20.8ms | if ( -f $reglocatfilename ) # spent 20.8ms making 109 calls to installer::windows::msiglobal::CORE:ftfile, avg 191µs/call | ||
1564 | { | ||||
1565 | 109 | 35.4ms | my $reglocatfile = installer::files::read_file($reglocatfilename); # spent 35.4ms making 109 calls to installer::files::read_file, avg 325µs/call | ||
1566 | |||||
1567 | my $layername = ""; | ||||
1568 | if ( $allvariables->{'REGISTRYLAYERNAME'} ) | ||||
1569 | { | ||||
1570 | $layername = $allvariables->{'REGISTRYLAYERNAME'}; | ||||
1571 | } | ||||
1572 | else | ||||
1573 | { | ||||
1574 | for ( my $i = 0; $i <= $#{$reglocatfile}; $i++ ) | ||||
1575 | { | ||||
1576 | if ( ${$reglocatfile}[$i] =~ /\bLAYERNAMETEMPLATE\b/ ) | ||||
1577 | { | ||||
1578 | installer::exiter::exit_program("ERROR: Variable \"REGISTRYLAYERNAME\" has to be defined", "update_reglocat_table"); | ||||
1579 | } | ||||
1580 | } | ||||
1581 | } | ||||
1582 | |||||
1583 | if ( $layername ne "" ) | ||||
1584 | { | ||||
1585 | # Updating the layername in | ||||
1586 | |||||
1587 | for ( my $i = 0; $i <= $#{$reglocatfile}; $i++ ) | ||||
1588 | { | ||||
1589 | 763 | 565µs | ${$reglocatfile}[$i] =~ s/\bLAYERNAMETEMPLATE\b/$layername/; # spent 565µs making 763 calls to installer::windows::msiglobal::CORE:subst, avg 740ns/call | ||
1590 | } | ||||
1591 | |||||
1592 | # Saving the file | ||||
1593 | 109 | 44.1ms | installer::files::save_file($reglocatfilename ,$reglocatfile); # spent 44.1ms making 109 calls to installer::files::save_file, avg 405µs/call | ||
1594 | my $infoline = "Updated idt file: $reglocatfilename\n"; | ||||
1595 | push(@installer::globals::logfileinfo, $infoline); | ||||
1596 | } | ||||
1597 | } | ||||
1598 | } | ||||
1599 | |||||
- - | |||||
1602 | #################################################################################### | ||||
1603 | # Updating the file RemoveRe.idt dynamically (RemoveRegistry.idt) | ||||
1604 | # The name of the component has to be replaced. | ||||
1605 | #################################################################################### | ||||
1606 | |||||
1607 | sub update_removere_table | ||||
1608 | # spent 22.0ms (1.51+20.5) within installer::windows::msiglobal::update_removere_table which was called 109 times, avg 202µs/call:
# 109 times (1.51ms+20.5ms) by installer::run at line 1651 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 202µs/call | ||||
1609 | 327 | 22.2ms | my ($basedir) = @_; | ||
1610 | |||||
1611 | my $removeregistryfilename = $basedir . $installer::globals::separator . "RemoveRe.idt"; | ||||
1612 | |||||
1613 | # Only do something, if this file exists | ||||
1614 | |||||
1615 | 109 | 20.5ms | if ( -f $removeregistryfilename ) # spent 20.5ms making 109 calls to installer::windows::msiglobal::CORE:ftfile, avg 188µs/call | ||
1616 | { | ||||
1617 | my $removeregistryfile = installer::files::read_file($removeregistryfilename); | ||||
1618 | |||||
1619 | for ( my $i = 0; $i <= $#{$removeregistryfile}; $i++ ) | ||||
1620 | { | ||||
1621 | for ( my $i = 0; $i <= $#{$removeregistryfile}; $i++ ) | ||||
1622 | { | ||||
1623 | ${$removeregistryfile}[$i] =~ s/\bREGISTRYROOTCOMPONENT\b/$installer::globals::registryrootcomponent/; | ||||
1624 | } | ||||
1625 | } | ||||
1626 | |||||
1627 | # Saving the file | ||||
1628 | installer::files::save_file($removeregistryfilename ,$removeregistryfile); | ||||
1629 | my $infoline = "Updated idt file: $removeregistryfilename \n"; | ||||
1630 | push(@installer::globals::logfileinfo, $infoline); | ||||
1631 | } | ||||
1632 | } | ||||
1633 | |||||
1634 | ########################################################################## | ||||
1635 | # Reading saved mappings in Files.idt and Director.idt. | ||||
1636 | # This is required, if installation sets shall be created, | ||||
1637 | # that can be used for creation of msp files. | ||||
1638 | ########################################################################## | ||||
1639 | |||||
1640 | sub read_saved_mappings | ||||
1641 | { | ||||
1642 | installer::logger::include_header_into_logfile("Reading saved mappings from older installation sets:"); | ||||
1643 | |||||
1644 | installer::logger::include_timestamp_into_logfile("Performance Info: Reading saved mappings start"); | ||||
1645 | |||||
1646 | if ( $installer::globals::previous_idt_dir ) | ||||
1647 | { | ||||
1648 | my @errorlines = (); | ||||
1649 | my $errorstring = ""; | ||||
1650 | my $error_occurred = 0; | ||||
1651 | my $file_error_occurred = 0; | ||||
1652 | my $dir_error = 0; | ||||
1653 | |||||
1654 | my $idtdir = $installer::globals::previous_idt_dir; | ||||
1655 | $idtdir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
1656 | |||||
1657 | # Reading File.idt | ||||
1658 | |||||
1659 | my $idtfile = $idtdir . $installer::globals::separator . "File.idt"; | ||||
1660 | push( @installer::globals::globallogfileinfo, "\nAnalyzing file: $idtfile\n" ); | ||||
1661 | if ( ! -f $idtfile ) { push( @installer::globals::globallogfileinfo, "Warning: File $idtfile does not exist!\n" ); } | ||||
1662 | |||||
1663 | my $n = 0; | ||||
1664 | open (F, "<$idtfile") || installer::exiter::exit_program("ERROR: Cannot open file $idtfile for reading", "read_saved_mappings"); | ||||
1665 | <F>; <F>; <F>; | ||||
1666 | while (<F>) | ||||
1667 | { | ||||
1668 | m/^([^\t]+)\t([^\t]+)\t((.*)\|)?([^\t]*)/; | ||||
1669 | print "OUT1: \$1: $1, \$2: $2, \$3: $3, \$4: $4, \$5: $5\n"; | ||||
1670 | next if ("$1" eq "$5") && (!defined($3)); | ||||
1671 | my $lc1 = lc($1); | ||||
1672 | |||||
1673 | if ( exists($installer::globals::savedmapping{"$2/$5"})) | ||||
1674 | { | ||||
1675 | if ( ! $file_error_occurred ) | ||||
1676 | { | ||||
1677 | $errorstring = "\nErrors in $idtfile: \n"; | ||||
1678 | push(@errorlines, $errorstring); | ||||
1679 | } | ||||
1680 | $errorstring = "Duplicate savedmapping{" . "$2/$5}\n"; | ||||
1681 | push(@errorlines, $errorstring); | ||||
1682 | $error_occurred = 1; | ||||
1683 | $file_error_occurred = 1; | ||||
1684 | } | ||||
1685 | |||||
1686 | if ( exists($installer::globals::savedrevmapping{$lc1})) | ||||
1687 | { | ||||
1688 | if ( ! $file_error_occurred ) | ||||
1689 | { | ||||
1690 | $errorstring = "\nErrors in $idtfile: \n"; | ||||
1691 | push(@errorlines, $errorstring); | ||||
1692 | } | ||||
1693 | $errorstring = "Duplicate savedrevmapping{" . "$lc1}\n"; | ||||
1694 | push(@errorlines, $errorstring); | ||||
1695 | $error_occurred = 1; | ||||
1696 | $file_error_occurred = 1; | ||||
1697 | } | ||||
1698 | |||||
1699 | my $shortname = $4 || ''; | ||||
1700 | |||||
1701 | # Don't reuse illegal 8.3 mappings that we used to generate in 2.0.4 | ||||
1702 | if (index($shortname, '.') > 8 || | ||||
1703 | (index($shortname, '.') == -1 && length($shortname) > 8)) | ||||
1704 | { | ||||
1705 | $shortname = ''; | ||||
1706 | } | ||||
1707 | |||||
1708 | if (( $shortname ne '' ) && ( index($shortname, '~') > 0 ) && ( exists($installer::globals::savedrev83mapping{$shortname}) )) | ||||
1709 | { | ||||
1710 | if ( ! $file_error_occurred ) | ||||
1711 | { | ||||
1712 | $errorstring = "\nErrors in $idtfile: \n"; | ||||
1713 | push(@errorlines, $errorstring); | ||||
1714 | } | ||||
1715 | $errorstring = "Duplicate savedrev83mapping{" . "$shortname}\n"; | ||||
1716 | push(@errorlines, $errorstring); | ||||
1717 | $error_occurred = 1; | ||||
1718 | $file_error_occurred = 1; | ||||
1719 | } | ||||
1720 | |||||
1721 | $installer::globals::savedmapping{"$2/$5"} = "$1;$shortname"; | ||||
1722 | $installer::globals::savedrevmapping{lc($1)} = "$2/$5"; | ||||
1723 | $installer::globals::savedrev83mapping{$shortname} = "$2/$5" if $shortname ne ''; | ||||
1724 | $n++; | ||||
1725 | } | ||||
1726 | |||||
1727 | close (F); | ||||
1728 | |||||
1729 | push( @installer::globals::globallogfileinfo, "Read $n old file table key or 8.3 name mappings from $idtfile\n" ); | ||||
1730 | |||||
1731 | # Reading Director.idt | ||||
1732 | |||||
1733 | $idtfile = $idtdir . $installer::globals::separator . "Director.idt"; | ||||
1734 | push( @installer::globals::globallogfileinfo, "\nAnalyzing file $idtfile\n" ); | ||||
1735 | if ( ! -f $idtfile ) { push( @installer::globals::globallogfileinfo, "Warning: File $idtfile does not exist!\n" ); } | ||||
1736 | |||||
1737 | $n = 0; | ||||
1738 | open (F, "<$idtfile") || installer::exiter::exit_program("ERROR: Cannot open file $idtfile for reading", "read_saved_mappings"); | ||||
1739 | <F>; <F>; <F>; | ||||
1740 | while (<F>) | ||||
1741 | { | ||||
1742 | m/^([^\t]+)\t([^\t]+)\t(([^~]+~\d.*)\|)?([^\t]*)/; | ||||
1743 | next if (!defined($3)); | ||||
1744 | my $lc1 = lc($1); | ||||
1745 | |||||
1746 | print "OUT2: \$1: $1, \$2: $2, \$3: $3\n"; | ||||
1747 | |||||
1748 | if ( exists($installer::globals::saved83dirmapping{$1}) ) | ||||
1749 | { | ||||
1750 | if ( ! $dir_error_occurred ) | ||||
1751 | { | ||||
1752 | $errorstring = "\nErrors in $idtfile: \n"; | ||||
1753 | push(@errorlines, $errorstring); | ||||
1754 | } | ||||
1755 | $errorstring = "Duplicate saved83dirmapping{" . "$1}\n"; | ||||
1756 | push(@errorlines, $errorstring); | ||||
1757 | $error_occurred = 1; | ||||
1758 | $dir_error_occurred = 1; | ||||
1759 | } | ||||
1760 | |||||
1761 | $installer::globals::saved83dirmapping{$1} = $4; | ||||
1762 | $n++; | ||||
1763 | } | ||||
1764 | close (F); | ||||
1765 | |||||
1766 | push( @installer::globals::globallogfileinfo, "Read $n old directory 8.3 name mappings from $idtfile\n" ); | ||||
1767 | |||||
1768 | # Analyzing errors | ||||
1769 | |||||
1770 | if ( $error_occurred ) | ||||
1771 | { | ||||
1772 | for ( my $i = 0; $i <= $#errorlines; $i++ ) | ||||
1773 | { | ||||
1774 | print "$errorlines[$i]"; | ||||
1775 | push( @installer::globals::globallogfileinfo, "$errorlines[$i]"); | ||||
1776 | } | ||||
1777 | installer::exiter::exit_program("ERROR: Duplicate entries in saved mappings!", "read_saved_mappings"); | ||||
1778 | } | ||||
1779 | } else { | ||||
1780 | installer::exiter::exit_program("ERROR: Windows patch shall be prepared, but environment variable PREVIOUS_IDT_DIR is not set!", "read_saved_mappings"); | ||||
1781 | } | ||||
1782 | |||||
1783 | installer::logger::include_timestamp_into_logfile("Performance Info: Reading saved mappings end"); | ||||
1784 | } | ||||
1785 | |||||
1786 | 1 | 10µs | 1; | ||
1787 | |||||
1788 | # vim:set shiftwidth=4 softtabstop=4 expandtab: | ||||
# spent 436µs within installer::windows::msiglobal::CORE:binmode which was called 108 times, avg 4µs/call:
# 108 times (436µs+0s) by installer::windows::msiglobal::create_transforms at line 825, avg 4µs/call | |||||
# spent 42.5ms within installer::windows::msiglobal::CORE:chdir which was called 221 times, avg 192µs/call:
# 108 times (21.4ms+0s) by installer::windows::msiglobal::create_transforms at line 916, avg 198µs/call
# 108 times (19.9ms+0s) by installer::windows::msiglobal::create_transforms at line 900, avg 184µs/call
# once (459µs+0s) by installer::windows::msiglobal::execute_packaging at line 1387
# once (278µs+0s) by installer::windows::msiglobal::include_cabs_into_msi at line 1286
# once (208µs+0s) by installer::windows::msiglobal::execute_packaging at line 1306
# once (140µs+0s) by installer::windows::msiglobal::include_cabs_into_msi at line 1233
# once (122µs+0s) by installer::windows::msiglobal::execute_packaging at line 1312 | |||||
# spent 196ms within installer::windows::msiglobal::CORE:close which was called 219 times, avg 895µs/call:
# 110 times (193ms+0s) by installer::windows::msiglobal::get_guid_list at line 1018, avg 1.75ms/call
# 108 times (3.16ms+0s) by installer::windows::msiglobal::create_transforms at line 827, avg 29µs/call
# once (227µs+0s) by installer::windows::msiglobal::execute_packaging at line 1341 | |||||
# spent 66.7ms within installer::windows::msiglobal::CORE:ftfile which was called 326 times, avg 205µs/call:
# 109 times (20.8ms+0s) by installer::windows::msiglobal::update_reglocat_table at line 1563, avg 191µs/call
# 109 times (20.5ms+0s) by installer::windows::msiglobal::update_removere_table at line 1615, avg 188µs/call
# 108 times (25.4ms+0s) by installer::windows::msiglobal::create_transforms at line 844, avg 235µs/call | |||||
# spent 19.1ms within installer::windows::msiglobal::CORE:ftsize which was called 108 times, avg 177µs/call:
# 108 times (19.1ms+0s) by installer::windows::msiglobal::create_transforms at line 848, avg 177µs/call | |||||
# spent 2.67s within installer::windows::msiglobal::CORE:match which was called 1083306 times, avg 2µs/call:
# 987540 times (2.51s+0s) by installer::windows::msiglobal::set_uuid_into_component_table at line 1086, avg 3µs/call
# 15929 times (13.6ms+0s) by installer::windows::msiglobal::save_packorder at line 397, avg 851ns/call
# 15929 times (10.2ms+0s) by installer::windows::msiglobal::save_packorder at line 398, avg 643ns/call
# 15921 times (51.1ms+0s) by installer::windows::msiglobal::save_packorder at line 400, avg 3µs/call
# 15921 times (29.7ms+0s) by installer::windows::msiglobal::make_relative_ddf_path at line 127, avg 2µs/call
# 15920 times (43.7ms+0s) by installer::windows::msiglobal::generate_cab_file_list at line 309, avg 3µs/call
# 15920 times (9.54ms+0s) by installer::windows::msiglobal::generate_cab_file_list at line 316, avg 599ns/call
# 109 times (689µs+0s) by installer::windows::msiglobal::create_msi_database at line 483, avg 6µs/call
# 109 times (147µs+0s) by installer::windows::msiglobal::create_msi_database at line 489, avg 1µs/call
# 3 times (5µs+0s) by installer::windows::msiglobal::set_global_code_variables at line 1426, avg 2µs/call
# once (8µs+0s) by installer::windows::msiglobal::set_msiproductversion at line 1505
# once (7µs+0s) by installer::windows::msiglobal::generate_cab_file_list at line 174
# once (6µs+0s) by installer::windows::msiglobal::generate_cab_file_list at line 280
# once (3µs+0s) by installer::windows::msiglobal::set_msiproductversion at line 1514
# once (500ns+0s) by installer::windows::msiglobal::generate_cab_file_list at line 286 | |||||
# spent 36.7s within installer::windows::msiglobal::CORE:open which was called 219 times, avg 167ms/call:
# 110 times (36.3s+0s) by installer::windows::msiglobal::get_guid_list at line 1016, avg 330ms/call
# 108 times (33.3ms+0s) by installer::windows::msiglobal::create_transforms at line 824, avg 309µs/call
# once (376ms+0s) by installer::windows::msiglobal::execute_packaging at line 1339 | |||||
# spent 931s within installer::windows::msiglobal::CORE:readline which was called 166402 times, avg 5.60ms/call:
# 166292 times (930s+0s) by installer::windows::msiglobal::execute_packaging at line 1340, avg 5.59ms/call
# 110 times (912ms+0s) by installer::windows::msiglobal::get_guid_list at line 1017, avg 8.29ms/call | |||||
# spent 10.1ms within installer::windows::msiglobal::CORE:regcomp which was called 15922 times, avg 632ns/call:
# 15921 times (10.0ms+0s) by installer::windows::msiglobal::make_relative_ddf_path at line 132, avg 630ns/call
# once (29µs+0s) by installer::windows::msiglobal::generate_cab_file_list at line 329 | |||||
# spent 2.80ms within installer::windows::msiglobal::CORE:rename which was called 3 times, avg 933µs/call:
# once (992µs+0s) by installer::windows::msiglobal::create_transforms at line 910
# once (903µs+0s) by installer::windows::msiglobal::create_transforms at line 907
# once (903µs+0s) by installer::windows::msiglobal::create_transforms at line 914 | |||||
# spent 4.07s within installer::windows::msiglobal::CORE:subst which was called 1021265 times, avg 4µs/call:
# 987540 times (4.01s+0s) by installer::windows::msiglobal::set_uuid_into_component_table at line 1115, avg 4µs/call
# 15921 times (23.5ms+0s) by installer::windows::msiglobal::make_relative_ddf_path at line 132, avg 1µs/call
# 15921 times (17.3ms+0s) by installer::windows::msiglobal::make_relative_ddf_path at line 133, avg 1µs/call
# 763 times (565µs+0s) by installer::windows::msiglobal::update_reglocat_table at line 1589, avg 740ns/call
# 221 times (2.99ms+0s) by installer::windows::msiglobal::get_msidatabasename at line 433, avg 14µs/call
# 221 times (330µs+0s) by installer::windows::msiglobal::get_msidatabasename at line 435, avg 1µs/call
# 221 times (184µs+0s) by installer::windows::msiglobal::get_msidatabasename at line 434, avg 834ns/call
# 109 times (2.53ms+0s) by installer::windows::msiglobal::get_packagecode_for_sis at line 595, avg 23µs/call
# 109 times (2.03ms+0s) by installer::windows::msiglobal::create_msi_database at line 485, avg 19µs/call
# 109 times (1.73ms+0s) by installer::windows::msiglobal::create_msi_database at line 486, avg 16µs/call
# 109 times (767µs+0s) by installer::windows::msiglobal::write_summary_into_msi_database at line 726, avg 7µs/call
# 17 times (21µs+0s) by installer::windows::msiglobal::put_msiproductversion_into_bootstrapfile at line 1539, avg 1µs/call
# once (22µs+0s) by installer::windows::msiglobal::set_global_code_variables at line 1456
# once (22µs+0s) by installer::windows::msiglobal::include_cabs_into_msi at line 1250
# once (7µs+0s) by installer::windows::msiglobal::generate_cab_file_list at line 329
# once (3µs+0s) by installer::windows::msiglobal::generate_cab_file_list at line 328 | |||||
# spent 580µs within installer::windows::msiglobal::CORE:substcont which was called 218 times, avg 3µs/call:
# 218 times (580µs+0s) by installer::windows::msiglobal::write_summary_into_msi_database at line 726, avg 3µs/call | |||||
# spent 457s within installer::windows::msiglobal::CORE:system which was called 438 times, avg 1.04s/call:
# 109 times (230s+0s) by installer::windows::msiglobal::create_msi_database at line 494, avg 2.11s/call
# 109 times (64.4s+0s) by installer::windows::msiglobal::write_summary_into_msi_database at line 739, avg 591ms/call
# 108 times (90.3s+0s) by installer::windows::msiglobal::create_transforms at line 808, avg 836ms/call
# 108 times (65.5s+0s) by installer::windows::msiglobal::create_transforms at line 902, avg 606ms/call
# once (4.94s+0s) by installer::windows::msiglobal::include_cabs_into_msi at line 1259
# once (794ms+0s) by installer::windows::msiglobal::create_transforms at line 930
# once (594ms+0s) by installer::windows::msiglobal::create_transforms at line 909
# once (582ms+0s) by installer::windows::msiglobal::create_transforms at line 912 | |||||
# spent 210ms within installer::windows::msiglobal::CORE:unlink which was called 217 times, avg 967µs/call:
# 108 times (141ms+0s) by installer::windows::msiglobal::create_transforms at line 890, avg 1.31ms/call
# 108 times (35.7ms+0s) by installer::windows::msiglobal::create_transforms at line 917, avg 331µs/call
# once (32.9ms+0s) by installer::windows::msiglobal::include_cabs_into_msi at line 1277 | |||||
# spent 34.0ms within installer::windows::msiglobal::CORE:unpack which was called 9060 times, avg 4µs/call:
# 9060 times (34.0ms+0s) by installer::windows::msiglobal::calculate_guid at line 1057, avg 4µs/call |