← 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:54 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
{
5314µs my ($ddffileref, $cabinetfile, $installdir) = @_;
54
551500ns my $oneline;
56
5714µs $oneline = ".Set CabinetName1=" . $cabinetfile . "\n";
5812µs push(@{$ddffileref} ,$oneline);
591500ns $oneline = ".Set ReservePerCabinetSize=128\n"; # This reserves space for a digital signature.
6012µs push(@{$ddffileref} ,$oneline);
6111µs $oneline = ".Set MaxDiskSize=2147483648\n"; # This allows the .cab file to get a size of 2 GB.
6211µs push(@{$ddffileref} ,$oneline);
6311µs $oneline = ".Set CompressionType=LZX\n";
6412µs push(@{$ddffileref} ,$oneline);
651500ns $oneline = ".Set Compress=ON\n";
6612µs 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
7014µs $oneline = ".Set CompressionMemory=$installer::globals::cabfilecompressionlevel\n";
7112µs push(@{$ddffileref} ,$oneline);
7210s $oneline = ".Set Cabinet=ON\n";
7312µs push(@{$ddffileref} ,$oneline);
7413µs $oneline = ".Set DiskDirectoryTemplate=" . $installdir . "\n";
75110µs 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
{
8414µs my ( $ddffile, $ddffilename ) = @_;
85
8611µs my $maxlength = 0;
871500ns my $maxline = 0;
881500ns my $linelength = 0;
891500ns my $linenumber = 0;
90
91116.3ms for ( my $i = 0; $i <= $#{$ddffile}; $i++ )
92 {
931592910.6ms my $oneline = ${$ddffile}[$i];
94
95159295.55ms $linelength = length($oneline);
96159296.08ms $linenumber = $i + 1;
97
98159295.87ms 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
103159296.58ms if ( $linelength > $maxlength )
104 {
105228µs $maxlength = $linelength;
106229µs $maxline = $linenumber;
107 }
108 }
109
110113µs my $infoline = "Check of ddf file \"$ddffilename\": Maximum length \"$maxlength\" in line \"$maxline\" (allowed line length: 256 characters)\n";
111129µs 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
{
1231592112.7ms my ( $sourcepath ) = @_;
124
125159218.52ms my $windowstemppath = $installer::globals::temppath;
126
1271592184.9ms1592129.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
13215921128ms3184233.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
1331592163.0ms1592117.3ms $sourcepath =~ s/^[\\\/]//;
# spent 17.3ms making 15921 calls to installer::windows::msiglobal::CORE:subst, avg 1µs/call
134
1351592175.9ms 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
{
16616µs my ($filesref, $installdir, $ddfdir, $allvariables) = @_;
167
16812µs my @cabfilelist = ();
169
17016µs1220µs installer::logger::include_header_into_logfile("Generating ddf files");
# spent 220µs making 1 call to installer::logger::include_header_into_logfile
171
17215µs1121µ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
174126µs23.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
17613µs 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 {
27518µs for ( my $i = 0; $i <= $#{$filesref}; $i++ )
276 {
27712µs my $onefile = ${$filesref}[$i];
27814µs my $cabinetfile = $onefile->{'cabinet'};
27913µs my $sourcepath = $onefile->{'sourcepath'};
280118µs16µs if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; }
# spent 6µs making 1 call to installer::windows::msiglobal::CORE:match
28113µs my $uniquename = $onefile->{'uniquename'};
282
28311µs my $styles = "";
2841500ns my $doinclude = 1;
28512µs if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; };
28618µs1500ns 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
29016µs187µ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
29412µs my @ddffile = ();
295
29616µs134µs write_ddf_file_header(\@ddffile, $cabinetfile, $installdir);
297
29814µs my $ddfline = "\"" . $sourcepath . "\" \"" . $uniquename . "\"\n";
29912µs if ( $doinclude ) { push(@ddffile, $ddfline); }
300
30112µs my $nextfile = ${$filesref}[$i+1];
30211µs my $nextcabinetfile = "";
303
30413µs if ( $nextfile->{'cabinet'} ) { $nextcabinetfile = $nextfile->{'cabinet'}; }
305
30612µs while ( $nextcabinetfile eq $cabinetfile )
307 {
3081592018.2ms $sourcepath = $nextfile->{'sourcepath'};
30915920113ms1592043.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
3111592046.3ms15920347ms $sourcepath = make_relative_ddf_path($sourcepath);
# spent 347ms making 15920 calls to installer::windows::msiglobal::make_relative_ddf_path, avg 22µs/call
3121592018.4ms $uniquename = $nextfile->{'uniquename'};
313159206.81ms my $localdoinclude = 1;
314159207.28ms my $nextfilestyles = "";
3151592017.6ms if ( $nextfile->{'Styles'} ) { $nextfilestyles = $nextfile->{'Styles'}; }
3161592058.5ms159209.54ms if ( $nextfilestyles =~ /\bDONT_PACK\b/ ) { $localdoinclude = 0; }
# spent 9.54ms making 15920 calls to installer::windows::msiglobal::CORE:match, avg 599ns/call
3171592016.2ms $ddfline = "\"" . $sourcepath . "\" \"" . $uniquename . "\"\n";
3181592017.8ms if ( $localdoinclude ) { push(@ddffile, $ddfline); }
319159205.99ms $i++; # increasing the counter!
3201592016.4ms $nextfile = ${$filesref}[$i+1];
3211592032.7ms if ( $nextfile ) { $nextcabinetfile = $nextfile->{'cabinet'}; }
32211µs else { $nextcabinetfile = "_lastfile_"; }
323 }
324
325 # creating the DDF file
326
32711µs my $ddffilename = $cabinetfile;
328112µs13µs $ddffilename =~ s/.cab/.ddf/;
# spent 3µs making 1 call to installer::windows::msiglobal::CORE:subst
329148µs236µ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
33012µs $ddffilename = $ddfdir . $installer::globals::separator . $ddffilename;
331
33217µs18.47ms installer::files::save_file($ddffilename ,\@ddffile);
# spent 8.47ms making 1 call to installer::files::save_file
33317µs my $infoline = "Created ddf file: $ddffilename\n";
33413µs push(@installer::globals::logfileinfo, $infoline);
335
336 # lines in ddf files must not be longer than 256 characters
337110µs151.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
34115µs my $oneline = "makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n";
34211µs if ( $installer::globals::isunix )
343 {
344 $oneline = "$ENV{'OUTDIR_FOR_BUILD'}/bin/makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n";
345 }
346
34712µs push(@cabfilelist, $oneline);
348
349 # collecting all ddf files
35017.16ms 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
358110µs1218µ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
360111µs 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
{
37314µs1119µs installer::logger::include_header_into_logfile("Saving pack order");
# spent 119µs making 1 call to installer::logger::include_header_into_logfile
374
37512µs1106µ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
37711µs my $packorderfilename = "packorder.txt";
37813µs $packorderfilename = $installer::globals::infodirectory . $installer::globals::separator . $packorderfilename;
379
38011µs my @packorder = ();
381
38211µs my $headerline = "\# Syntax\: Filetable_Sequence Cabinetfilename Physical_FileName Unique_FileName\n\n";
38312µs push(@packorder, $headerline);
384
38517µs for ( my $i = 0; $i <= $#installer::globals::allddffiles; $i++ )
386 {
38712µs my $ddffilename = $installer::globals::allddffiles[$i];
38815µs167.1ms my $ddffile = installer::files::read_file($ddffilename);
# spent 67.1ms making 1 call to installer::files::read_file
38912µs my $cabinetfile = "";
390
391129.1ms for ( my $j = 0; $j <= $#{$ddffile}; $j++ )
392 {
3931592913.3ms my $oneline = ${$ddffile}[$j];
394
395 # Getting the Cabinet file name
396
3971592964.6ms1592913.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
3981593754.5ms1592910.2ms if ( $oneline =~ /^\s*\.Set\s+/ ) { next; }
# spent 10.2ms making 15929 calls to installer::windows::msiglobal::CORE:match, avg 643ns/call
399
40015921111ms1592151.1ms if ( $oneline =~ /^\s*\"(.*?)\"\s+\"(.*?)\"\s*$/ )
# spent 51.1ms making 15921 calls to installer::windows::msiglobal::CORE:match, avg 3µs/call
401 {
4021592117.4ms my $sourcefile = $1;
4031592111.0ms my $uniquefilename = $2;
404
4051592144.1ms15921181ms 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
408159218.59ms my $filesequence = "";
4091592125.7ms 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
4121592125.8ms my $line = $filesequence . "\t" . $cabinetfile . "\t" . $sourcefile . "\t" . $uniquefilename . "\n";
4131592121.0ms push(@packorder, $line);
414 }
415 }
416 }
417
418111µs15.81ms installer::files::save_file($packorderfilename ,\@packorder);
# spent 5.81ms making 1 call to installer::files::save_file
419
42016.60ms1202µ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
{
429221609µs my ($allvariableshashref, $language) = @_;
430
4312211.03ms my $databasename = $allvariableshashref->{'PRODUCTNAME'} . $allvariableshashref->{'PRODUCTVERSION'};
432221479µs $databasename = lc($databasename);
4332214.67ms2212.99ms $databasename =~ s/\.//g;
# spent 2.99ms making 221 calls to installer::windows::msiglobal::CORE:subst, avg 14µs/call
4342211.19ms221184µs $databasename =~ s/\-//g;
# spent 184µs making 221 calls to installer::windows::msiglobal::CORE:subst, avg 834ns/call
4352211.24ms221330µ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
438221468µs if ( $allvariableshashref->{'DATABASENAME'} )
439 {
440 $databasename = $allvariableshashref->{'DATABASENAME'};
441 }
442
443221612µs if ( $language )
444 {
445 if (!($language eq ""))
446 {
447 $databasename .= "_$language";
448 }
449 }
450
451221112µs $databasename .= ".msi";
452
4532211.84ms 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
{
463109250µs 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
470109130µs my $msidb = "msidb.exe"; # Has to be in the path
47110990µs if ( $installer::globals::isunix )
472 {
473 $msidb = "$ENV{'OUTDIR_FOR_BUILD'}/bin/msidb.exe";
474 }
47510994µs my $extraslash = ""; # Has to be set for non-ActiveState perl
476
477109488µs10922.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
479109652µs1092.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
481109362µs1091.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
4831091.43ms109689µ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.63ms1092.03ms $idtdirbase =~ s/\//\\\\/g;
# spent 2.03ms making 109 calls to installer::windows::msiglobal::CORE:subst, avg 19µs/call
4861092.15ms1091.73ms $msifilename =~ s/\//\\\\/g;
# spent 1.73ms making 109 calls to installer::windows::msiglobal::CORE:subst, avg 16µs/call
48710995µs $extraslash = "\\";
488 }
489109617µs109147µs if ( $^O =~ /linux/i ) {
# spent 147µs making 109 calls to installer::windows::msiglobal::CORE:match, avg 1µs/call
490 $extraslash = "\\";
491 }
492109342µs my $systemcall = $msidb . " -f " . $idtdirbase . " -d " . $msifilename . " -c " . "-i " . $extraslash . "*";
493
494109230s109230s my $returnvalue = system($systemcall);
# spent 230s making 109 calls to installer::windows::msiglobal::CORE:system, avg 2.11s/call
495
4961091.60ms my $infoline = "Systemcall: $systemcall\n";
4971091.11ms push( @installer::globals::logfileinfo, $infoline);
498
4991091.78ms if ($returnvalue)
500 {
501 $infoline = "ERROR: Could not execute $msidb!\n";
502 push( @installer::globals::logfileinfo, $infoline);
503 }
504 else
505 {
506109197µs $infoline = "Success: Executed $msidb successfully!\n";
507109405µs 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
{
517436633µs my ($language, $languagefile, $searchstring) = @_;
518
5194361.59ms436951ms 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
5204362.51ms43620.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
521436785µs $newstring = "\"" . $newstring . "\"";
522
52343619.1ms 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
{
53210994µs my $msiversion = "200";
533109717µs 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
{
542109134µs my $wordcount = "0";
543109674µs 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
{
552109189µs my ( $language ) = @_;
553
554109605µs1091.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
557109183µs if ( $codepage == 65001 ) { $codepage = 0; }
558
559 # my $codepage = "1252"; # determine dynamically in a function
560 # my $codepage = "65001"; # UTF-8
561109668µs 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
{
570109173µs my ( $language, $allvariables ) = @_;
571
572109462µs109964µ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
57410996µs my $architecture = "Intel";
575
576109221µs if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $architecture = "x64"; }
577
578109197µs my $value = "\"" . $architecture . ";" . $windowslanguage; # adding the Windows language
579
58010955µs $value = $value . "\""; # adding ending '"'
581
582109684µs 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
593109505µs10937.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
5951093.44ms1092.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
597109244µs my $guid = "\{" . ${$guidref}[0] . "\}";
598
599109183µs my $infoline = "PackageCode: $guid\n";
600109165µs push( @installer::globals::logfileinfo, $infoline);
601
6021091.19ms 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
{
611109407µs my ( $language, $languagefile, $searchstring ) = @_;
612
613109477µs109103ms 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
615109719µs 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
{
624109171µs my $author = $installer::globals::longmanufacturer;
625
626109143µs $author = "\"" . $author . "\"";
627
628109668µs 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
{
637109181µs my ( $allvariableshashref ) = @_;
638
639109525µs my $subject = $allvariableshashref->{'PRODUCTNAME'} . " " . $allvariableshashref->{'PRODUCTVERSION'};
640
641109138µs $subject = "\"" . $subject . "\"";
642
643109695µs 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
{
652109241µs my ( $language, $languagefile, $searchstring ) = @_;
653
654109378µs109195ms 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
656109743µs 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
{
665109278µs my ( $language, $languagefile, $searchstring ) = @_;
666
667109381µs109294ms 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
669109716µs 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
{
678109262µs my ( $language, $languagefile, $searchstring ) = @_;
679
680109383µs109404ms 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
682109752µs 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
{
691109128µs my $security = "0";
692109723µs 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
{
702109433µs my ($msifilename, $language, $languagefile, $allvariableshashref) = @_;
703
704 # -g : required msi version
705 # -c : codepage
706 # -p : template
707
708109466µs10922.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
710109100µs my $msiinfo = "msiinfo.exe"; # Has to be in the path
71110962µs if ( $installer::globals::isunix )
712 {
713 $msiinfo = "$ENV{'OUTDIR_FOR_BUILD'}/bin/msiinfo.exe";
714 }
715
716109100µs my $sislanguage = "en-US"; # title, comment, keyword, and appname are always in English
717
718109508µs109551µ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
719109434µs1093.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
720109475µs1092.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
721109568µs10937.3s my $guid = get_packagecode_for_sis();
# spent 37.3s making 109 calls to installer::windows::msiglobal::get_packagecode_for_sis, avg 342ms/call
722109972µs109105ms 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
723109552µs109727µ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
724109455µs1091.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
725109512µs109197ms 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
7261092.99ms3271.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
727109585µs109296ms 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
728109619µs109406ms 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
729109587µs109597µ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
730109532µs109509µ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
732109706µs1092.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
7341091.15ms 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.4s10964.4s my $returnvalue = system($systemcall);
# spent 64.4s making 109 calls to installer::windows::msiglobal::CORE:system, avg 591ms/call
740
7411091.24ms my $infoline = "Systemcall: $systemcall\n";
7421092.39ms push( @installer::globals::logfileinfo, $infoline);
743
7441092.32ms if ($returnvalue)
745 {
746 $infoline = "ERROR: Could not execute $systemcall (return $returnvalue)\n";
747 push( @installer::globals::logfileinfo, $infoline);
748 }
749 else
750 {
751109245µs $infoline = "Success: Executed $msiinfo successfully!\n";
752109397µs 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
{
76314µs my ($languagesarray, $defaultlanguage, $installdir, $allvariableshashref) = @_;
764
76515µs1200µs installer::logger::include_header_into_logfile("Creating Transforms");
# spent 200µs making 1 call to installer::logger::include_header_into_logfile
766
76711µs my $cscript = "cscript.exe"; # Has to be in the path
76811µs my $msitran = "msitran.exe"; # Has to be in the path
76911µs my $msidb = "msidb.exe"; # Has to be in the path
7701500ns 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 }
77514µs my $tmpdir = $ENV{TMPDIR}; # Variable %TEMP% will be set to it for WiLangId.vbs to work
77614µs my $wilangid = $ENV{WINDOWS_SDK_HOME} . "/Samples/SysMgmt/Msi/scripts/WiLangId.vbs";
777
77816µs115µs my $from = cwd();
# spent 15µs making 1 call to Cwd::__ANON__[Cwd.pm:406]
779
78011µs my $templatevalue = "1033";
781
78215µs124µ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
78715µs142µs my $basedbname = get_msidatabasename($allvariableshashref, $defaultlanguage);
78813µs $basedbname = $installdir . $installer::globals::separator . $basedbname;
789
79011µs my $errorhandling = "f"; # Suppress "change codepage" error
791
792 # Iterating over all files
793
79417µs foreach ( @{$languagesarray} )
795 {
796109194µs my $onelanguage = $_;
797
798110132µs if ( $onelanguage eq $defaultlanguage ) { next; }
799
8001081.12ms1087.40ms my $referencedbname = get_msidatabasename($allvariableshashref, $onelanguage);
# spent 7.40ms making 108 calls to installer::windows::msiglobal::get_msidatabasename, avg 69µs/call
801108317µs $referencedbname = $installdir . $installer::globals::separator . $referencedbname;
802
803108683µs1081.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
804108147µs my $transformfile = $installdir . $installer::globals::separator . $windowslanguage;
805
806108453µs my $systemcall = $msitran . " " . " -g " . $basedbname . " " . $referencedbname . " " . $transformfile . " " . $errorhandling;
807
80810890.3s10890.3s my $returnvalue = system($systemcall);
# spent 90.3s making 108 calls to installer::windows::msiglobal::CORE:system, avg 836ms/call
809
810108501µs my $infoline = "Systemcall: $systemcall\n";
8111081.03ms 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
819108224µs if ($returnvalue)
820 {
821108263µs $infoline = "WARNING: Returnvalue of $msitran is not 0. Checking version of $msitran!\n";
822108195µs push( @installer::globals::logfileinfo, $infoline);
823
82410834.9ms10833.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
8251081.25ms108436µs binmode(FILE);
# spent 436µs making 108 calls to installer::windows::msiglobal::CORE:binmode, avg 4µs/call
82610852.1ms32447.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
8271084.10ms2163.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
829108632µs my @problemchecksums = ("b66190a70145a57773ec769e16777b29", "aa25d3445b94ffde8ef0c1efb77a56b8", "748206e54fc93efe6a1aaa9d491f3ad1");
83010886µs my $isproblemchecksum = 0;
831
832108457µs foreach my $problemchecksum ( @problemchecksums )
833 {
834324334µs $infoline = "Checksum of problematic MsiTran.exe: $problemchecksum\n";
835324451µs push( @installer::globals::logfileinfo, $infoline);
836324255µs $infoline = "Checksum of used MsiTran.exe: $digest\n";
837324409µs push( @installer::globals::logfileinfo, $infoline);
838324709µs if ( $digest eq $problemchecksum ) { $isproblemchecksum = 1; }
839 }
840
841108427µs if ( $isproblemchecksum )
842 {
843 # Check existence of mst
84410826.4ms10825.4ms if ( -f $transformfile )
# spent 25.4ms making 108 calls to installer::windows::msiglobal::CORE:ftfile, avg 235µs/call
845 {
846108185µs $infoline = "File $transformfile exists.\n";
847108218µs push( @installer::globals::logfileinfo, $infoline);
84810820.1ms10819.1ms my $filesize = ( -s $transformfile );
# spent 19.1ms making 108 calls to installer::windows::msiglobal::CORE:ftsize, avg 177µs/call
849108416µs $infoline = "Size of $transformfile: $filesize\n";
850108233µs push( @installer::globals::logfileinfo, $infoline);
851
852108304µs if ( $filesize > 0 )
853 {
854108191µs $infoline = "Info: Returnvalue $returnvalue of $msitran is no problem :-) .\n";
855108132µs push( @installer::globals::logfileinfo, $infoline);
856108109µs $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
877108144µs if ($returnvalue)
878 {
879 $infoline = "ERROR: Could not execute $msitran!\n";
880 push( @installer::globals::logfileinfo, $infoline);
881 }
882 else
883 {
884108154µs $infoline = "Success: Executed $msitran successfully!\n";
885108110µs push( @installer::globals::logfileinfo, $infoline);
886 }
887
888 # The reference database can be deleted
889
890108143ms108141ms 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
893108154µs 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
90010821.0ms10819.9ms chdir($installdir);
# spent 19.9ms making 108 calls to installer::windows::msiglobal::CORE:chdir, avg 184µs/call
901108540µs $systemcall = $msidb . " " . " -d " . $basedbname . " -r " . $windowslanguage;
90210865.5s10865.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
905108324µs if($windowslanguage eq '1028')
906 {
9071932µs1903µs rename 1028,3076;
# spent 903µs making 1 call to installer::windows::msiglobal::CORE:rename
908110µs $systemcall = $msidb . " " . " -d " . $basedbname . " -r " . 3076;
9091594ms1594ms system($systemcall);
# spent 594ms making 1 call to installer::windows::msiglobal::CORE:system
91011.01ms1992µs rename 3076,5124;
# spent 992µs making 1 call to installer::windows::msiglobal::CORE:rename
911112µs $systemcall = $msidb . " " . " -d " . $basedbname . " -r " . 5124;
9121582ms1582ms system($systemcall);
# spent 582ms making 1 call to installer::windows::msiglobal::CORE:system
913115µs $templatevalue = $templatevalue . "," . 3076 . "," . 5124;
9141921µs1903µs rename 5124,1028;
# spent 903µs making 1 call to installer::windows::msiglobal::CORE:rename
915 }
91610822.4ms10821.4ms chdir($from);
# spent 21.4ms making 108 calls to installer::windows::msiglobal::CORE:chdir, avg 198µs/call
91710836.8ms10835.7ms unlink($transformfile);
# spent 35.7ms making 108 calls to installer::windows::msiglobal::CORE:unlink, avg 331µs/call
918
919108469µs $infoline = "Systemcall: $systemcall\n";
920108922µs push( @installer::globals::logfileinfo, $infoline);
921
9221081.06ms if ( $windowslanguage ne '1033')
923 {
924 $templatevalue = $templatevalue . "," . $windowslanguage;
925 }
926 }
927
928112µs $systemcall = "TEMP=" . $tmpdir . " " . $cscript . " " . $wilangid . " " . $basedbname . " Package " . $templatevalue;
929
9301794ms1794ms $returnvalue = system($systemcall);
# spent 794ms making 1 call to installer::windows::msiglobal::CORE:system
931
932111µs $infoline = "Systemcall: $systemcall\n";
93314µs push( @installer::globals::logfileinfo, $infoline);
934
935122µs if ($returnvalue)
936 {
937 $infoline = "ERROR: Could not execute WiLangId.vbs!\n";
938 push( @installer::globals::logfileinfo, $infoline);
939 }
940 else
941 {
94211µs $infoline = "Success: Executed WiLangId.vbs successfully!\n";
94313µs 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
{
95516µs my ($defaultlanguage, $installdir, $allvariableshashref) = @_;
956
95715µs1197µs installer::logger::include_header_into_logfile("Renaming msi database");
# spent 197µs making 1 call to installer::logger::include_header_into_logfile
958
95916µs148µs my $olddatabasename = get_msidatabasename($allvariableshashref, $defaultlanguage);
96014µs $olddatabasename = $installdir . $installer::globals::separator . $olddatabasename;
961
96213µs123µs my $newdatabasename = get_msidatabasename($allvariableshashref);
963
96411µs $installer::globals::shortmsidatabasename = $newdatabasename;
965
96613µs $newdatabasename = $installdir . $installer::globals::separator . $newdatabasename;
967
96815µs171.5ms installer::systemactions::rename_one_file($olddatabasename, $newdatabasename);
# spent 71.5ms making 1 call to installer::systemactions::rename_one_file
969
970117µs $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
{
1002110150µs my ($number, $log) = @_;
1003
1004110418µs11012.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
1006110277µs my $uuidgen = $ENV{'UUIDGEN'}; # Has to be in the path
1007
1008 # "-c" for uppercase output
1009
1010110155µs my $systemcall = "$uuidgen -n$number |";
101111087µs 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.3s11036.3s open (UUIDGEN, "$systemcall" ) or die("uuidgen is missing.");
# spent 36.3s making 110 calls to installer::windows::msiglobal::CORE:open, avg 330ms/call
1017110916ms110912ms my @uuidlist = <UUIDGEN>;
# spent 912ms making 110 calls to installer::windows::msiglobal::CORE:readline, avg 8.29ms/call
1018110195ms110193ms close (UUIDGEN);
# spent 193ms making 110 calls to installer::windows::msiglobal::CORE:close, avg 1.75ms/call
1019
1020110658µs my $infoline = "Systemcall: $systemcall\n";
1021110696µs if ( $log ) { push( @installer::globals::logfileinfo, $infoline); }
1022
1023110511µs my $comparenumber = $#uuidlist + 1;
1024
1025110367µs if ( $comparenumber == $number )
1026 {
1027110253µs $infoline = "Success: Executed $uuidgen successfully!\n";
1028110326µs 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
1037110979µs for ( my $i = 0; $i <= $#uuidlist; $i++ ) { $uuidlist[$i] = uc($uuidlist[$i]); }
1038
10391101.68ms 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
{
104890606.93ms my ( $string ) = @_;
1049
105090604.09ms my $guid = "";
1051
1052906066.4ms906026.5ms my $md5 = Digest::MD5->new;
# spent 26.5ms making 9060 calls to Digest::MD5::new, avg 3µs/call
1053906048.0ms906015.9ms $md5->add($string);
# spent 15.9ms making 9060 calls to Digest::MD5::add, avg 2µs/call
1054906059.8ms906023.6ms my $digest = $md5->hexdigest;
# spent 23.6ms making 9060 calls to Digest::MD5::hexdigest, avg 3µs/call
105590605.70ms $digest = uc($digest);
1056
1057906083.1ms906034.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
1058906012.7ms $guid = "$first-$second-$third-$fourth-$fifth";
1059
10609060108ms 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
{
1070109192µs my ($idtdirbase, $allvariables) = @_;
1071
1072109187µs my $componenttablename = $idtdirbase . $installer::globals::separator . "Componen.idt";
1073
1074109531µs1094.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
1079109161µs my $infoline = "";
108010980µs my $counter = 0;
1081
10821091.41s for ( my $i = 3; $i <= $#{$componenttable}; $i++ ) # ignoring the first three lines
1083 {
1084987540855ms my $oneline = ${$componenttable}[$i];
1085987540426ms my $componentname = "";
10869875406.60s9875402.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
1088987540460ms my $uuid = "";
1089
10909875402.08s 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.
109790603.81ms my $useproductversion = 1;
109890606.47ms if ( exists($installer::globals::base_independent_components{$componentname})) { $useproductversion = 0; }
109990604.28ms my $sourcestring = $componentname;
1100
110190607.18ms if ( $useproductversion )
1102 {
110390076.23ms if ( ! exists($allvariables->{'PRODUCTVERSION'}) ) { installer::exiter::exit_program("ERROR: Could not find variable \"PRODUCTVERSION\" (required value for GUID creation)!", "set_uuid_into_component_table"); }
110490079.83ms $sourcestring = $sourcestring . "_" . $allvariables->{'PRODUCTVERSION'};
1105 }
1106906026.9ms18120401ms $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
110790603.62ms $counter++;
1108
1109 # checking, if there is a conflict with an already created guid
111090607.88ms if ( exists($installer::globals::allcalculated_guids{$uuid}) ) { installer::exiter::exit_program("ERROR: \"$uuid\" was already created before!", "set_uuid_into_component_table"); }
1111906016.7ms $installer::globals::allcalculated_guids{$uuid} = 1;
1112906020.4ms $installer::globals::calculated_component_guids{$componentname} = $uuid;
1113 }
1114
11159875407.85s9875404.01s ${$componenttable}[$i] =~ s/COMPONENTGUID/$uuid/;
# spent 4.01s making 987540 calls to installer::windows::msiglobal::CORE:subst, avg 4µs/call
1116 }
1117
1118109444ms109600ms 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
{
1132109532µs my ($basedir, $allvariables) = @_;
1133
1134109166µs my $infoline = "";
1135
11361091.05ms 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
{
122615µs my ($installdir) = @_;
1227
122815µs1152µ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
123019µs120µs my $from = cwd();
# spent 20µs making 1 call to Cwd::__ANON__[Cwd.pm:406]
123112µs my $to = $installdir;
1232
12331149µs1140µs chdir($to);
# spent 140µs making 1 call to installer::windows::msiglobal::CORE:chdir
1234
123514µs my $infoline = "Changing into directory: $to";
123612µs push( @installer::globals::logfileinfo, $infoline);
1237
123812µs my $msidb = "msidb.exe"; # Has to be in the path
123911µs if ( $installer::globals::isunix )
1240 {
1241 $msidb = "$ENV{'OUTDIR_FOR_BUILD'}/bin/msidb.exe";
1242 }
124311µs my $extraslash = ""; # Has to be set for non-ActiveState perl
1244
124512µs my $msifilename = $installer::globals::msidatabasename;
1246
124718µs137µ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.)
1250140µs122µs $msifilename =~ s/\//\\\\/g;
# spent 22µs making 1 call to installer::windows::msiglobal::CORE:subst
125111µs $extraslash = "\\";
1252
125318µs1531µs my $allcabfiles = installer::systemactions::find_file_with_file_extension("cab", $installdir);
1254
125519µs for ( my $i = 0; $i <= $#{$allcabfiles}; $i++ )
1256 {
125715µs my $systemcall = $msidb . " -d " . $msifilename . " -a " . ${$allcabfiles}[$i];
1258
125914.94s14.94s my $returnvalue = system($systemcall);
# spent 4.94s making 1 call to installer::windows::msiglobal::CORE:system
1260
1261114µs $infoline = "Systemcall: $systemcall\n";
126216µs push( @installer::globals::logfileinfo, $infoline);
1263
126414µs if ($returnvalue)
1265 {
1266 $infoline = "ERROR: Could not execute $systemcall !\n";
1267 push( @installer::globals::logfileinfo, $infoline);
1268 }
1269 else
1270 {
127115µs $infoline = "Success: Executed $systemcall successfully!\n";
127214µs push( @installer::globals::logfileinfo, $infoline);
1273 }
1274
1275 # deleting the cab file
1276
1277132.9ms132.9ms unlink(${$allcabfiles}[$i]);
# spent 32.9ms making 1 call to installer::windows::msiglobal::CORE:unlink
1278
1279113µs $infoline = "Deleted cab file: ${$allcabfiles}[$i]\n";
128017µs push( @installer::globals::logfileinfo, $infoline);
1281 }
1282
128311µs $infoline = "Changing back into directory: $from";
128411µs push( @installer::globals::logfileinfo, $infoline);
1285
12861308µs1278µ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
{
129615µs my ($localpackjobref, $loggingdir, $allvariables) = @_;
1297
129814µs1202µs installer::logger::include_header_into_logfile("Packaging process");
# spent 202µs making 1 call to installer::logger::include_header_into_logfile
1299
130014µs1114µ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
130211µs my $infoline = "";
130316µs116µs my $from = cwd();
# spent 16µs making 1 call to Cwd::__ANON__[Cwd.pm:406]
130412µs my $to = $loggingdir;
1305
13061218µs1208µs chdir($to);
# spent 208µs making 1 call to installer::windows::msiglobal::CORE:chdir
130713µs $infoline = "chdir: $to \n";
130812µs push( @installer::globals::logfileinfo, $infoline);
1309
1310 # the ddf file contains relative paths, it is necessary to change into the temp directory
131112µs $to = $installer::globals::temppath;
13121131µs1122µs chdir($to);
# spent 122µs making 1 call to installer::windows::msiglobal::CORE:chdir
131313µs $infoline = "chdir: $to \n";
131412µs push( @installer::globals::logfileinfo, $infoline);
1315
1316 # changing the tmp directory, because makecab.exe generates temporary cab files
131712µs my $origtemppath = "";
131814µs if ( $ENV{'TMP'} ) { $origtemppath = $ENV{'TMP'}; }
13191130µs $ENV{'TMP'} = $installer::globals::temppath; # setting TMP to the new unique directory!
1320
13211500ns my $maxmakecabcalls = 3;
132213µs my $allmakecabcalls = $#{$localpackjobref} + 1;
1323
1324118µs for ( my $i = 0; $i <= $#{$localpackjobref}; $i++ )
1325 {
132613µs my $systemcall = ${$localpackjobref}[$i];
1327
13281500ns my $callscounter = $i + 1;
1329
133017µs111µs installer::logger::print_message( "... makecab.exe ($callscounter/$allmakecabcalls) ... \n" );
# spent 11µs making 1 call to installer::logger::print_message
1331
133212µs for ( my $n = 1; $n <= $maxmakecabcalls; $n++ )
1333 {
133412µs my @ddfoutput = ();
1335
133612µs $infoline = "Systemcall: $systemcall";
133712µs push( @installer::globals::logfileinfo, $infoline);
1338
13391376ms1376ms open (DDF, "$systemcall");
# spent 376ms making 1 call to installer::windows::msiglobal::CORE:open
1340166292932s166292930s while (<DDF>) {push(@ddfoutput, $_); }
# spent 930s making 166292 calls to installer::windows::msiglobal::CORE:readline, avg 5.59ms/call
13411258µs1227µs close (DDF);
# spent 227µs making 1 call to installer::windows::msiglobal::CORE:close
1342
134318µs my $returnvalue = $?; # $? contains the return value of the systemcall
1344
134513µs 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 {
1375115µs $infoline = "Success (Try $n): $systemcall";
137615µs push( @installer::globals::logfileinfo, $infoline);
1377174.8ms last;
1378 }
1379 }
1380 }
1381
1382123µs1330µ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
1385121µs $ENV{'TMP'} = $origtemppath;
1386
13871473µs1459µs chdir($from);
# spent 459µs making 1 call to installer::windows::msiglobal::CORE:chdir
138814µs $infoline = "chdir: $from \n";
1389116µs 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
{
139813µ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
140512µs 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
141114µs my $infoline = "Using Codes file: $installer::globals::codefilename \n";
141212µs push( @installer::globals::logfileinfo, $infoline);
1413
141413µs1473µs my $codefile = installer::files::read_file($installer::globals::codefilename);
# spent 473µs making 1 call to installer::files::read_file
1415
141612µs my $onelanguage = "";
1417
141812µs if ( $#{$languagesref} > 0 ) # more than one language
1419 {
142012µs 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 {
1426123µs35µ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 {
143412µs $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
144412µs 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 {
145516µs1123ms 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
1456136µs122µs ${$guidref}[0] =~ s/\s*$//; # removing ending spaces
# spent 22µs making 1 call to installer::windows::msiglobal::CORE:subst
145715µs $installer::globals::productcode = "\{" . ${$guidref}[0] . "\}";
1458 }
1459
146012µs 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
146911µs $searchstring = "UPGRADECODE"; # searching in the codes.txt file
147019µs1407µs $codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile);
147117µs1112µs $installer::globals::upgradecode = installer::windows::idtglobal::get_language_string_from_language_block($codeblock, $onelanguage, "");
1472 }
1473
14741500ns if ( $installer::globals::upgradecode eq "" ) { installer::exiter::exit_program("ERROR: UpgradeCode not defined in $installer::globals::codefilename !", "set_global_code_variables"); }
1475
147614µs $infoline = "Setting ProductCode to: $installer::globals::productcode \n";
147711µs push( @installer::globals::logfileinfo, $infoline);
147813µs $infoline = "Setting UpgradeCode to: $installer::globals::upgradecode \n";
14791500ns push( @installer::globals::logfileinfo, $infoline);
1480
1481 # Adding both variables into the variables array
1482
148314µs $allvariableshashref->{'PRODUCTCODE'} = $installer::globals::productcode;
148412µs $allvariableshashref->{'UPGRADECODE'} = $installer::globals::upgradecode;
1485
148612µs $infoline = "Defined variable PRODUCTCODE: $installer::globals::productcode \n";
148712µs push( @installer::globals::logfileinfo, $infoline);
1488
148912µs $infoline = "Defined variable UPGRADECODE: $installer::globals::upgradecode \n";
1490122µs 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
{
150112µs my ( $allvariables ) = @_;
1502
150313µs my $productversion = $allvariables->{'PACKAGEVERSION'};
1504
1505115µs18µ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
151012µs $installer::globals::msiproductversion = $productversion;
1511
1512 # Setting $installer::globals::msimajorproductversion, to differ between old version in upgrade table
1513
1514115µs13µs if ( $installer::globals::msiproductversion =~ /^\s*(\d+)\./ )
# spent 3µs making 1 call to installer::windows::msiglobal::CORE:match
1515 {
151615µs my $major = $1;
151713µs $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
{
152712µs my ($filesref) = @_;
1528
1529115.8ms for ( my $i = 0; $i <= $#{$filesref}; $i++ )
1530 {
1531158867.74ms my $onefile = ${$filesref}[$i];
1532
15331588614.7ms if ( $onefile->{'gid'} eq "gid_Brand_Profile_Version_Ini" )
1534 {
1535116µs1697µs my $file = installer::files::read_file($onefile->{'sourcepath'});
# spent 697µs making 1 call to installer::files::read_file
1536
1537122µs for ( my $j = 0; $j <= $#{$file}; $j++ )
1538 {
15391784µs1721µ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
154216µs1519µs installer::files::save_file($onefile->{'sourcepath'}, $file);
# spent 519µs making 1 call to installer::files::save_file
1543
1544116µs 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
{
1557109204µs my ($basedir, $allvariables) = @_;
1558
1559109227µs my $reglocatfilename = $basedir . $installer::globals::separator . "RegLocat.idt";
1560
1561 # Only do something, if this file exists
1562
156310922.3ms10920.8ms if ( -f $reglocatfilename )
# spent 20.8ms making 109 calls to installer::windows::msiglobal::CORE:ftfile, avg 191µs/call
1564 {
1565109474µs10935.4ms my $reglocatfile = installer::files::read_file($reglocatfilename);
# spent 35.4ms making 109 calls to installer::files::read_file, avg 325µs/call
1566
1567109121µs my $layername = "";
1568109244µs 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
1583109479µs if ( $layername ne "" )
1584 {
1585 # Updating the layername in
1586
15871091.19ms for ( my $i = 0; $i <= $#{$reglocatfile}; $i++ )
1588 {
15897633.38ms763565µ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
1593109403µs10944.1ms installer::files::save_file($reglocatfilename ,$reglocatfile);
# spent 44.1ms making 109 calls to installer::files::save_file, avg 405µs/call
1594109240µs my $infoline = "Updated idt file: $reglocatfilename\n";
1595109222µs 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
{
1609109175µs my ($basedir) = @_;
1610
1611109216µs my $removeregistryfilename = $basedir . $installer::globals::separator . "RemoveRe.idt";
1612
1613 # Only do something, if this file exists
1614
161510921.8ms10920.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