← Index
NYTProf Performance Profile   « block view • line view • sub view »
For C:/lo/libo-master/solenv/bin/make_installer.pl
  Run on Mon Sep 24 00:52:54 2012
Reported on Mon Sep 24 07:34:33 2012

Filename/cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm
StatementsExecuted 6887505 statements in 1450s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
16640221931s931sinstaller::windows::msiglobal::::CORE:readlineinstaller::windows::msiglobal::CORE:readline (opcode)
43881457s457sinstaller::windows::msiglobal::::CORE:systeminstaller::windows::msiglobal::CORE:system (opcode)
2193136.7s36.7sinstaller::windows::msiglobal::::CORE:openinstaller::windows::msiglobal::CORE:open (opcode)
1091113.7s25.6sinstaller::windows::msiglobal::::set_uuid_into_component_tableinstaller::windows::msiglobal::set_uuid_into_component_table
10212651614.07s4.07sinstaller::windows::msiglobal::::CORE:substinstaller::windows::msiglobal::CORE:subst (opcode)
10833061512.67s2.67sinstaller::windows::msiglobal::::CORE:matchinstaller::windows::msiglobal::CORE:match (opcode)
111383ms712msinstaller::windows::msiglobal::::save_packorderinstaller::windows::msiglobal::save_packorder
111355ms4.15sinstaller::windows::msiglobal::::generate_cab_file_listinstaller::windows::msiglobal::generate_cab_file_list
1592121266ms347msinstaller::windows::msiglobal::::make_relative_ddf_pathinstaller::windows::msiglobal::make_relative_ddf_path
906011259ms380msinstaller::windows::msiglobal::::calculate_guidinstaller::windows::msiglobal::calculate_guid
21731210ms210msinstaller::windows::msiglobal::::CORE:unlinkinstaller::windows::msiglobal::CORE:unlink (opcode)
21931196ms196msinstaller::windows::msiglobal::::CORE:closeinstaller::windows::msiglobal::CORE:close (opcode)
3263166.7ms66.7msinstaller::windows::msiglobal::::CORE:ftfileinstaller::windows::msiglobal::CORE:ftfile (opcode)
11151.1ms51.1msinstaller::windows::msiglobal::::check_ddf_fileinstaller::windows::msiglobal::check_ddf_file
2217142.5ms42.5msinstaller::windows::msiglobal::::CORE:chdirinstaller::windows::msiglobal::CORE:chdir (opcode)
11138.4ms39.7msinstaller::windows::msiglobal::::put_msiproductversion_into_bootstrapfileinstaller::windows::msiglobal::put_msiproductversion_into_bootstrapfile
11135.3ms158sinstaller::windows::msiglobal::::create_transformsinstaller::windows::msiglobal::create_transforms
90601134.0ms34.0msinstaller::windows::msiglobal::::CORE:unpackinstaller::windows::msiglobal::CORE:unpack (opcode)
1091125.6ms103sinstaller::windows::msiglobal::::write_summary_into_msi_databaseinstaller::windows::msiglobal::write_summary_into_msi_database
4364124.8ms997msinstaller::windows::msiglobal::::get_value_from_sis_lnginstaller::windows::msiglobal::get_value_from_sis_lng
1081119.1ms19.1msinstaller::windows::msiglobal::::CORE:ftsizeinstaller::windows::msiglobal::CORE:ftsize (opcode)
1102115.1ms37.4sinstaller::windows::msiglobal::::get_guid_listinstaller::windows::msiglobal::get_guid_list
1091112.8ms230sinstaller::windows::msiglobal::::create_msi_databaseinstaller::windows::msiglobal::create_msi_database
159222110.1ms10.1msinstaller::windows::msiglobal::::CORE:regcompinstaller::windows::msiglobal::CORE:regcomp (opcode)
221628.94ms12.4msinstaller::windows::msiglobal::::get_msidatabasenameinstaller::windows::msiglobal::get_msidatabasename
109118.73ms110msinstaller::windows::msiglobal::::update_reglocat_tableinstaller::windows::msiglobal::update_reglocat_table
109113.36ms37.3sinstaller::windows::msiglobal::::get_packagecode_for_sisinstaller::windows::msiglobal::get_packagecode_for_sis
3312.80ms2.80msinstaller::windows::msiglobal::::CORE:renameinstaller::windows::msiglobal::CORE:rename (opcode)
109112.12ms2.12msinstaller::windows::msiglobal::::prepare_64bit_databaseinstaller::windows::msiglobal::prepare_64bit_database
109112.06ms105msinstaller::windows::msiglobal::::get_title_for_sisinstaller::windows::msiglobal::get_title_for_sis
109111.99ms2.96msinstaller::windows::msiglobal::::get_template_for_sisinstaller::windows::msiglobal::get_template_for_sis
109111.72ms406msinstaller::windows::msiglobal::::get_appname_for_sisinstaller::windows::msiglobal::get_appname_for_sis
109111.60ms296msinstaller::windows::msiglobal::::get_keywords_for_sisinstaller::windows::msiglobal::get_keywords_for_sis
109111.52ms3.19msinstaller::windows::msiglobal::::get_codepage_for_sisinstaller::windows::msiglobal::get_codepage_for_sis
109111.51ms22.0msinstaller::windows::msiglobal::::update_removere_tableinstaller::windows::msiglobal::update_removere_table
109111.43ms197msinstaller::windows::msiglobal::::get_comment_for_sisinstaller::windows::msiglobal::get_comment_for_sis
109111.24ms1.24msinstaller::windows::msiglobal::::get_subject_for_sisinstaller::windows::msiglobal::get_subject_for_sis
10911727µs727µsinstaller::windows::msiglobal::::get_author_for_sisinstaller::windows::msiglobal::get_author_for_sis
10911597µs597µsinstaller::windows::msiglobal::::get_security_for_sisinstaller::windows::msiglobal::get_security_for_sis
21811580µs580µsinstaller::windows::msiglobal::::CORE:substcontinstaller::windows::msiglobal::CORE:substcont (opcode)
10911551µs551µsinstaller::windows::msiglobal::::get_msiversion_for_sisinstaller::windows::msiglobal::get_msiversion_for_sis
10911509µs509µsinstaller::windows::msiglobal::::get_wordcount_for_sisinstaller::windows::msiglobal::get_wordcount_for_sis
10811436µs436µsinstaller::windows::msiglobal::::CORE:binmodeinstaller::windows::msiglobal::CORE:binmode (opcode)
111390µs489µsinstaller::windows::msiglobal::::BEGIN@30installer::windows::msiglobal::BEGIN@30
111280µs4.97sinstaller::windows::msiglobal::::include_cabs_into_msiinstaller::windows::msiglobal::include_cabs_into_msi
111143µs124msinstaller::windows::msiglobal::::set_global_code_variablesinstaller::windows::msiglobal::set_global_code_variables
11170µs71.8msinstaller::windows::msiglobal::::rename_msi_database_in_installsetinstaller::windows::msiglobal::rename_msi_database_in_installset
11158µs60µsinstaller::windows::msiglobal::::BEGIN@34installer::windows::msiglobal::BEGIN@34
11134µs34µsinstaller::windows::msiglobal::::write_ddf_file_headerinstaller::windows::msiglobal::write_ddf_file_header
11132µs43µsinstaller::windows::msiglobal::::set_msiproductversioninstaller::windows::msiglobal::set_msiproductversion
11117µs21µsinstaller::windows::msiglobal::::BEGIN@32installer::windows::msiglobal::BEGIN@32
11116µs18µsinstaller::windows::msiglobal::::BEGIN@42installer::windows::msiglobal::BEGIN@42
11116µs18µsinstaller::windows::msiglobal::::BEGIN@41installer::windows::msiglobal::BEGIN@41
11115µs43µsinstaller::windows::msiglobal::::BEGIN@36installer::windows::msiglobal::BEGIN@36
11115µs17µsinstaller::windows::msiglobal::::BEGIN@43installer::windows::msiglobal::BEGIN@43
11115µs17µsinstaller::windows::msiglobal::::BEGIN@39installer::windows::msiglobal::BEGIN@39
11115µs43µsinstaller::windows::msiglobal::::BEGIN@31installer::windows::msiglobal::BEGIN@31
11114µs16µsinstaller::windows::msiglobal::::BEGIN@33installer::windows::msiglobal::BEGIN@33
11114µs17µsinstaller::windows::msiglobal::::BEGIN@37installer::windows::msiglobal::BEGIN@37
11114µs16µsinstaller::windows::msiglobal::::BEGIN@40installer::windows::msiglobal::BEGIN@40
11114µs17µsinstaller::windows::msiglobal::::BEGIN@35installer::windows::msiglobal::BEGIN@35
11114µs16µsinstaller::windows::msiglobal::::BEGIN@38installer::windows::msiglobal::BEGIN@38
0000s0sinstaller::windows::msiglobal::::copy_merge_modules_into_installsetinstaller::windows::msiglobal::copy_merge_modules_into_installset
0000s0sinstaller::windows::msiglobal::::get_sequenceorderinstaller::windows::msiglobal::get_sequenceorder
0000s0sinstaller::windows::msiglobal::::read_saved_mappingsinstaller::windows::msiglobal::read_saved_mappings
111-857s73.7sinstaller::windows::msiglobal::::execute_packaginginstaller::windows::msiglobal::execute_packaging
Call graph for these subroutines as a Graphviz dot language file.
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
28package installer::windows::msiglobal;
29
30264µs2588µ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
use Cwd;
# spent 489µs making 1 call to installer::windows::msiglobal::BEGIN@30 # spent 99µs making 1 call to Exporter::import
31257µs270µ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
use Digest::MD5;
# spent 43µs making 1 call to installer::windows::msiglobal::BEGIN@31 # spent 28µs making 1 call to Exporter::import
32260µs224µ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
use installer::converter;
# spent 21µs making 1 call to installer::windows::msiglobal::BEGIN@32 # spent 3µs making 1 call to UNIVERSAL::import
33253µs218µ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
use installer::exiter;
# spent 16µs making 1 call to installer::windows::msiglobal::BEGIN@33 # spent 2µs making 1 call to UNIVERSAL::import
34254µs263µ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
use installer::files;
# spent 60µs making 1 call to installer::windows::msiglobal::BEGIN@34 # spent 3µs making 1 call to UNIVERSAL::import
35253µs220µ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
use installer::globals;
# spent 17µs making 1 call to installer::windows::msiglobal::BEGIN@35 # spent 3µs making 1 call to UNIVERSAL::import
36254µs271µ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
use installer::logger;
# spent 43µs making 1 call to installer::windows::msiglobal::BEGIN@36 # spent 28µs making 1 call to Exporter::import
37254µs220µ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
use installer::pathanalyzer;
# spent 17µs making 1 call to installer::windows::msiglobal::BEGIN@37 # spent 3µs making 1 call to UNIVERSAL::import
38254µs218µ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
use installer::remover;
# spent 16µs making 1 call to installer::windows::msiglobal::BEGIN@38 # spent 2µs making 1 call to UNIVERSAL::import
39253µs219µ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
use installer::scriptitems;
# spent 17µs making 1 call to installer::windows::msiglobal::BEGIN@39 # spent 2µs making 1 call to UNIVERSAL::import
40257µs219µ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
use installer::systemactions;
# spent 16µs making 1 call to installer::windows::msiglobal::BEGIN@40 # spent 2µs making 1 call to UNIVERSAL::import
41253µs219µ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
use installer::worker;
# spent 18µs making 1 call to installer::windows::msiglobal::BEGIN@41 # spent 2µs making 1 call to UNIVERSAL::import
42253µs220µ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
use installer::windows::idtglobal;
# spent 18µs making 1 call to installer::windows::msiglobal::BEGIN@42 # spent 2µs making 1 call to UNIVERSAL::import
43217.6ms219µ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
use installer::windows::language;
# 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
51sub 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
{
531839µ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
82sub 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
{
847969751.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
121sub 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
{
12395526373ms my ( $sourcepath ) = @_;
124
125 my $windowstemppath = $installer::globals::temppath;
126
1271592129.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
1323184233.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
1331592117.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
142sub 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
164sub 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
{
166207000382ms my ($filesref, $installdir, $ddfdir, $allvariables) = @_;
167
168 my @cabfilelist = ();
169
1701220µs installer::logger::include_header_into_logfile("Generating ddf files");
# spent 220µs making 1 call to installer::logger::include_header_into_logfile
171
1721121µ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
17423.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'};
28016µ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'}; };
2861500ns 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
290187µs $sourcepath = make_relative_ddf_path($sourcepath);
291
292 # all files with the same cabinetfile are directly behind each other in the files collector
293
294 my @ddffile = ();
295
296134µs write_ddf_file_header(\@ddffile, $cabinetfile, $installdir);
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'};
3091592043.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
31115920347ms $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'}; }
316159209.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;
32813µs $ddffilename =~ s/.cab/.ddf/;
# spent 3µs making 1 call to installer::windows::msiglobal::CORE:subst
329236µ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
33218.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
337151.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
3581218µ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
371sub 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
{
373175177433ms1119µs installer::logger::include_header_into_logfile("Saving pack order");
# spent 119µs making 1 call to installer::logger::include_header_into_logfile
374
3751106µ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];
388167.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
3971592913.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
3981592910.2ms if ( $oneline =~ /^\s*\.Set\s+/ ) { next; }
# spent 10.2ms making 15929 calls to installer::windows::msiglobal::CORE:match, avg 643ns/call
399
4001592151.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
40515921181ms 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
41815.81ms installer::files::save_file($packorderfilename ,\@packorder);
# spent 5.81ms making 1 call to installer::files::save_file
419
4201202µ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
427sub 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
{
429221012.3ms my ($allvariableshashref, $language) = @_;
430
431 my $databasename = $allvariableshashref->{'PRODUCTNAME'} . $allvariableshashref->{'PRODUCTVERSION'};
432 $databasename = lc($databasename);
4332212.99ms $databasename =~ s/\.//g;
# spent 2.99ms making 221 calls to installer::windows::msiglobal::CORE:subst, avg 14µs/call
434221184µs $databasename =~ s/\-//g;
# spent 184µs making 221 calls to installer::windows::msiglobal::CORE:subst, avg 834ns/call
435221330µ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
461sub 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
{
4632071230s 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
47710922.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
4791092.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
4811091.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
483109689µ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.)
4851092.03ms $idtdirbase =~ s/\//\\\\/g;
# spent 2.03ms making 109 calls to installer::windows::msiglobal::CORE:subst, avg 19µs/call
4861091.73ms $msifilename =~ s/\//\\\\/g;
# spent 1.73ms making 109 calls to installer::windows::msiglobal::CORE:subst, avg 16µs/call
487 $extraslash = "\\";
488 }
489109147µ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
494109230s 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
515sub 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
{
517218024.6ms my ($language, $languagefile, $searchstring) = @_;
518
519436951ms 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
52043620.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
530sub 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
{
532218810µs my $msiversion = "200";
533 return $msiversion;
534}
535
536#################################################################
537# Returning the word count for the Summary Information Stream
538#################################################################
539
540sub 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
{
542218808µs my $wordcount = "0";
543 return $wordcount;
544}
545
546#################################################################
547# Returning the codepage for the Summary Information Stream
548#################################################################
549
550sub 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
{
5524361.64ms my ( $language ) = @_;
553
5541091.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
568sub 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
{
5707631.89ms my ( $language, $allvariables ) = @_;
571
572109964µ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
589sub 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
5936545.72ms10937.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
5951092.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
609sub 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
{
6113271.60ms my ( $language, $languagefile, $searchstring ) = @_;
612
613109103ms 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
622sub 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
{
624327982µ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
635sub 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
{
6374361.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
650sub 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
{
6523271.36ms my ( $language, $languagefile, $searchstring ) = @_;
653
654109195ms 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
663sub 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
{
6653271.38ms my ( $language, $languagefile, $searchstring ) = @_;
666
667109294ms 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
676sub 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
{
6783271.40ms my ( $language, $languagefile, $searchstring ) = @_;
679
680109404ms 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
689sub 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
{
691218851µ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
700sub 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
{
702283464.5s my ($msifilename, $language, $languagefile, $allvariableshashref) = @_;
703
704 # -g : required msi version
705 # -c : codepage
706 # -p : template
707
70810922.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
718109551µ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
7191093.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
7201092.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
72110937.3s my $guid = get_packagecode_for_sis();
# spent 37.3s making 109 calls to installer::windows::msiglobal::get_packagecode_for_sis, avg 342ms/call
722109105ms 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
723109727µ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
7241091.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
725109197ms 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
7263271.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
727109296ms 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
728109406ms 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
729109597µ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
730109509µ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
7321092.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
73910964.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
761sub 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
{
7636513158s my ($languagesarray, $defaultlanguage, $installdir, $allvariableshashref) = @_;
764
7651200µ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
778115µs my $from = cwd();
# spent 15µs making 1 call to Cwd::__ANON__[Cwd.pm:406]
779
780 my $templatevalue = "1033";
781
782124µ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
787142µs my $basedbname = get_msidatabasename($allvariableshashref, $defaultlanguage);
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
8001087.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
8031081.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
80810890.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
82410833.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
825108436µs binmode(FILE);
# spent 436µs making 108 calls to installer::windows::msiglobal::CORE:binmode, avg 4µs/call
82632447.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
8272163.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
84410825.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);
84810819.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
890108141ms 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
90010819.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;
90210865.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 {
9071903µs rename 1028,3076;
# spent 903µs making 1 call to installer::windows::msiglobal::CORE:rename
908 $systemcall = $msidb . " " . " -d " . $basedbname . " -r " . 3076;
9091594ms system($systemcall);
# spent 594ms making 1 call to installer::windows::msiglobal::CORE:system
9101992µs rename 3076,5124;
# spent 992µs making 1 call to installer::windows::msiglobal::CORE:rename
911 $systemcall = $msidb . " " . " -d " . $basedbname . " -r " . 5124;
9121582ms system($systemcall);
# spent 582ms making 1 call to installer::windows::msiglobal::CORE:system
913 $templatevalue = $templatevalue . "," . 3076 . "," . 5124;
9141903µs rename 5124,1028;
# spent 903µs making 1 call to installer::windows::msiglobal::CORE:rename
915 }
91610821.4ms chdir($from);
# spent 21.4ms making 108 calls to installer::windows::msiglobal::CORE:chdir, avg 198µs/call
91710835.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
9301794ms $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
953sub 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
{
955948µs my ($defaultlanguage, $installdir, $allvariableshashref) = @_;
956
9571197µs installer::logger::include_header_into_logfile("Renaming msi database");
# spent 197µs making 1 call to installer::logger::include_header_into_logfile
958
959148µs my $olddatabasename = get_msidatabasename($allvariableshashref, $defaultlanguage);
960 $olddatabasename = $installdir . $installer::globals::separator . $olddatabasename;
961
962123µs my $newdatabasename = get_msidatabasename($allvariableshashref);
963
964 $installer::globals::shortmsidatabasename = $newdatabasename;
965
966 $newdatabasename = $installdir . $installer::globals::separator . $newdatabasename;
967
968171.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
979sub 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
1000sub 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
{
1002176037.4s my ($number, $log) = @_;
1003
100411012.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 }
101611036.3s open (UUIDGEN, "$systemcall" ) or die("uuidgen is missing.");
# spent 36.3s making 110 calls to installer::windows::msiglobal::CORE:open, avg 330ms/call
1017110912ms my @uuidlist = <UUIDGEN>;
# spent 912ms making 110 calls to installer::windows::msiglobal::CORE:readline, avg 8.29ms/call
1018110193ms 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
1046sub 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
{
104881540395ms my ( $string ) = @_;
1049
1050 my $guid = "";
1051
1052906026.5ms my $md5 = Digest::MD5->new;
# spent 26.5ms making 9060 calls to Digest::MD5::new, avg 3µs/call
1053906015.9ms $md5->add($string);
# spent 15.9ms making 9060 calls to Digest::MD5::add, avg 2µs/call
1054906023.6ms my $digest = $md5->hexdigest;
# spent 23.6ms making 9060 calls to Digest::MD5::hexdigest, avg 3µs/call
1055 $digest = uc($digest);
1056
1057906034.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
1068sub 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
{
1070602555720.2s my ($idtdirbase, $allvariables) = @_;
1071
1072 my $componenttablename = $idtdirbase . $installer::globals::separator . "Componen.idt";
1073
10741094.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 = "";
10869875402.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 }
110618120401ms $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
11159875404.01s ${$componenttable}[$i] =~ s/COMPONENTGUID/$uuid/;
# spent 4.01s making 987540 calls to installer::windows::msiglobal::CORE:subst, avg 4µs/call
1116 }
1117
1118109600ms 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
1130sub 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
{
11323271.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
1224sub 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
{
1226294.97s my ($installdir) = @_;
1227
12281152µ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
1230120µs my $from = cwd();
# spent 20µs making 1 call to Cwd::__ANON__[Cwd.pm:406]
1231 my $to = $installdir;
1232
12331140µ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
1247137µ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.)
1250122µs $msifilename =~ s/\//\\\\/g;
# spent 22µs making 1 call to installer::windows::msiglobal::CORE:subst
1251 $extraslash = "\\";
1252
12531531µs my $allcabfiles = installer::systemactions::find_file_with_file_extension("cab", $installdir);
1254
1255 for ( my $i = 0; $i <= $#{$allcabfiles}; $i++ )
1256 {
1257 my $systemcall = $msidb . " -d " . $msifilename . " -a " . ${$allcabfiles}[$i];
1258
125914.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
1277132.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
12861278µ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
1294sub 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
{
1296166330933s my ($localpackjobref, $loggingdir, $allvariables) = @_;
1297
12981202µs installer::logger::include_header_into_logfile("Packaging process");
# spent 202µs making 1 call to installer::logger::include_header_into_logfile
1299
13001114µ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 = "";
1303116µs my $from = cwd();
# spent 16µs making 1 call to Cwd::__ANON__[Cwd.pm:406]
1304 my $to = $loggingdir;
1305
13061208µ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;
13121122µ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
1330111µ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
13391376ms open (DDF, "$systemcall");
# spent 376ms making 1 call to installer::windows::msiglobal::CORE:open
1340166292930s while (<DDF>) {push(@ddfoutput, $_); }
# spent 930s making 166292 calls to installer::windows::msiglobal::CORE:readline, avg 5.59ms/call
13411227µ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
13821330µ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
13871459µ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
1396sub 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
{
139829155µ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
14141473µ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 {
142635µ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 {
14551123ms 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
1456122µ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
14701407µs $codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile);
14711112µs $installer::globals::upgradecode = installer::windows::idtglobal::get_language_string_from_language_block($codeblock, $onelanguage, "");
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
1499sub 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
{
1501745µs my ( $allvariables ) = @_;
1502
1503 my $productversion = $allvariables->{'PACKAGEVERSION'};
1504
150518µ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
151413µ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
1525sub 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
{
15273179538.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 {
15351697µ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 {
15391721µ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
15421519µ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
1555sub 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
{
1557196229.4ms my ($basedir, $allvariables) = @_;
1558
1559 my $reglocatfilename = $basedir . $installer::globals::separator . "RegLocat.idt";
1560
1561 # Only do something, if this file exists
1562
156310920.8ms if ( -f $reglocatfilename )
# spent 20.8ms making 109 calls to installer::windows::msiglobal::CORE:ftfile, avg 191µs/call
1564 {
156510935.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 {
1589763565µ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
159310944.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
1607sub 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
{
160932722.2ms my ($basedir) = @_;
1610
1611 my $removeregistryfilename = $basedir . $installer::globals::separator . "RemoveRe.idt";
1612
1613 # Only do something, if this file exists
1614
161510920.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
1640sub 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
1786110µs1;
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
sub installer::windows::msiglobal::CORE:binmode; # opcode
# 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
sub installer::windows::msiglobal::CORE:chdir; # opcode
# 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
sub installer::windows::msiglobal::CORE:close; # opcode
# 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
sub installer::windows::msiglobal::CORE:ftfile; # opcode
# 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
sub installer::windows::msiglobal::CORE:ftsize; # opcode
# 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
sub installer::windows::msiglobal::CORE:match; # opcode
# 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
sub installer::windows::msiglobal::CORE:open; # opcode
# 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
sub installer::windows::msiglobal::CORE:readline; # opcode
# 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
sub installer::windows::msiglobal::CORE:regcomp; # opcode
# 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
sub installer::windows::msiglobal::CORE:rename; # opcode
# 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
sub installer::windows::msiglobal::CORE:subst; # opcode
# 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
sub installer::windows::msiglobal::CORE:substcont; # opcode
# 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
sub installer::windows::msiglobal::CORE:system; # opcode
# 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
sub installer::windows::msiglobal::CORE:unlink; # opcode
# 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
sub installer::windows::msiglobal::CORE:unpack; # opcode