msiglobal.pm (a0a2b094) msiglobal.pm (fb67933c)
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 152 unchanged lines hidden (view full) ---

161 my @cabfilelist = ();
162
163 installer::logger::include_header_into_logfile("Generating ddf files");
164
165 $installer::logger::Lang->add_timestamp("Performance Info: ddf file generation start");
166
167 if ( $^O =~ /cygwin/i ) { installer::worker::generate_cygwin_pathes($filesref); }
168
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 152 unchanged lines hidden (view full) ---

161 my @cabfilelist = ();
162
163 installer::logger::include_header_into_logfile("Generating ddf files");
164
165 $installer::logger::Lang->add_timestamp("Performance Info: ddf file generation start");
166
167 if ( $^O =~ /cygwin/i ) { installer::worker::generate_cygwin_pathes($filesref); }
168
169 if ( $installer::globals::use_packages_for_cabs )
169 if (( $installer::globals::fix_number_of_cab_files ) && ( $installer::globals::updatedatabase ))
170 {
171 my $sequenceorder = get_sequenceorder($filesref);
172
173 my $counter = 1;
174 my $currentcabfile = "";
175
176 while ( ( exists($sequenceorder->{$counter}) ) || ( exists($installer::globals::allmergemodulefilesequences{$counter}) ) ) # Taking care of files from merge modules
177 {
170 {
171 my $sequenceorder = get_sequenceorder($filesref);
172
173 my $counter = 1;
174 my $currentcabfile = "";
175
176 while ( ( exists($sequenceorder->{$counter}) ) || ( exists($installer::globals::allmergemodulefilesequences{$counter}) ) ) # Taking care of files from merge modules
177 {
178 if ( exists($installer::globals::allmergemodulefilesequences{$counter}) )
179 {
180 # Skipping this sequence, it is not included in $filesref, because it is assigned to a file from a merge module.\n";
181 $counter++;
182 next;
183 }
184
185 # Files with increasing sequencerorder are included in one cab file
186 my $onefile = ${$filesref}[$sequenceorder->{$counter}];
187 my $cabinetfile = $onefile->{'assignedcabinetfile'};
188 my $sourcepath = $onefile->{'sourcepath'};
189 if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; }
190 my $uniquename = $onefile->{'uniquename'};
191
192 my $styles = "";
193 my $doinclude = 1;
194 if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; };
195 if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; }
196
197 # to avoid lines with more than 256 characters, it can be useful to use relative pathes
198 if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
199
200 # all files with the same cabinetfile have increasing sequencenumbers
201
202 my @ddffile = ();
203
204 write_ddf_file_header(\@ddffile, $cabinetfile, $installdir);
205
206 my $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
207 if ( $doinclude ) { push(@ddffile, $ddfline); }
208
209 $counter++; # increasing the counter
210 my $nextfile = "";
211 my $nextcabinetfile = "";
212 if ( exists($sequenceorder->{$counter}) ) { $nextfile = ${$filesref}[$sequenceorder->{$counter}]; }
213 if ( $nextfile->{'assignedcabinetfile'} ) { $nextcabinetfile = $nextfile->{'assignedcabinetfile'}; }
214
215 while ( $nextcabinetfile eq $cabinetfile )
216 {
217 $sourcepath = $nextfile->{'sourcepath'};
218 if ( $^O =~ /cygwin/i ) { $sourcepath = $nextfile->{'cyg_sourcepath'}; }
219 # to avoid lines with more than 256 characters, it can be useful to use relative pathes
220 if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
221 $uniquename = $nextfile->{'uniquename'};
222 my $localdoinclude = 1;
223 my $nextfilestyles = "";
224 if ( $nextfile->{'Styles'} ) { $nextfilestyles = $nextfile->{'Styles'}; }
225 if ( $nextfilestyles =~ /\bDONT_PACK\b/ ) { $localdoinclude = 0; }
226 $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
227 if ( $localdoinclude ) { push(@ddffile, $ddfline); }
228
229 $counter++; # increasing the counter!
230 $nextcabinetfile = "_lastfile_";
231 if ( exists($sequenceorder->{$counter}) )
232 {
233 $nextfile = ${$filesref}[$sequenceorder->{$counter}];
234 $nextcabinetfile = $nextfile->{'assignedcabinetfile'};
235 }
236 }
237
238 # creating the DDF file
239
240 my $ddffilename = $cabinetfile;
241 $ddffilename =~ s/.cab/.ddf/;
242 $ddfdir =~ s/\Q$installer::globals::separator\E\s*$//;
243 $ddffilename = $ddfdir . $installer::globals::separator . $ddffilename;
244
245 installer::files::save_file($ddffilename ,\@ddffile);
246 my $infoline = "Created ddf file: $ddffilename\n";
247 $installer::logger::Lang->print($infoline);
248
249 # lines in ddf files must not be longer than 256 characters
250 check_ddf_file(\@ddffile, $ddffilename);
251
252 # Writing the makecab system call
253
254 my $oneline = "makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n";
255
256 push(@cabfilelist, $oneline);
257
258 # collecting all ddf files
259 push(@installer::globals::allddffiles, $ddffilename);
260 }
261 }
262 elsif (( $installer::globals::fix_number_of_cab_files ) && ( $installer::globals::updatedatabase ))
263 {
264 my $sequenceorder = get_sequenceorder($filesref);
265
266 my $counter = 1;
267 my $currentcabfile = "";
268
269 while ( ( exists($sequenceorder->{$counter}) ) || ( exists($installer::globals::allmergemodulefilesequences{$counter}) ) ) # Taking care of files from merge modules
270 {
271# if ( exists($installer::globals::allmergemodulefilesequences{$counter}) )
272# {
273# # Skipping this sequence, it is not included in $filesref, because it is assigned to a file from a merge module.\n";
274# $counter++;
275# next;
276# }
277
278 my $onefile = ${$filesref}[$sequenceorder->{$counter}];

--- 2048 unchanged lines hidden ---
178# if ( exists($installer::globals::allmergemodulefilesequences{$counter}) )
179# {
180# # Skipping this sequence, it is not included in $filesref, because it is assigned to a file from a merge module.\n";
181# $counter++;
182# next;
183# }
184
185 my $onefile = ${$filesref}[$sequenceorder->{$counter}];

--- 2048 unchanged lines hidden ---