msiglobal.pm (d1fa6344) | msiglobal.pm (f30bf281) |
---|---|
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::fix_number_of_cab_files ) && ( $installer::globals::updatedatabase )) | 169 if ( $installer::globals::fix_number_of_cab_files ) |
170 { | 170 { |
171 my $sequenceorder = get_sequenceorder($filesref); 172 173 my $counter = 1; 174 my $currentcabfile = ""; 175 176 while ( exists($sequenceorder->{$counter}) ) 177 { 178 my $onefile = ${$filesref}[$sequenceorder->{$counter}]; 179 $counter++; 180 181 my $cabinetfile = $onefile->{'cabinet'}; 182 my $sourcepath = $onefile->{'sourcepath'}; 183 if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; } 184 my $uniquename = $onefile->{'uniquename'}; 185 186 my $styles = ""; 187 my $doinclude = 1; 188 if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }; 189 if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; } 190 191 # to avoid lines with more than 256 characters, it can be useful to use relative pathes 192 if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } 193 194 my @ddffile = (); 195 196 write_ddf_file_header(\@ddffile, $cabinetfile, $installdir); 197 198 my $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n"; 199 if ( $doinclude ) { push(@ddffile, $ddfline); } 200 201 my $nextfile = ""; 202 if ( ${$filesref}[$sequenceorder->{$counter}] ) { $nextfile = ${$filesref}[$sequenceorder->{$counter}]; } 203 204 my $nextcabinetfile = ""; 205 206 if ( $nextfile->{'cabinet'} ) { $nextcabinetfile = $nextfile->{'cabinet'}; } 207 208 while ( $nextcabinetfile eq $cabinetfile ) 209 { 210 $sourcepath = $nextfile->{'sourcepath'}; 211 if ( $^O =~ /cygwin/i ) { $sourcepath = $nextfile->{'cyg_sourcepath'}; } 212 # to avoid lines with more than 256 characters, it can be useful to use relative pathes 213 if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } 214 $uniquename = $nextfile->{'uniquename'}; 215 my $localdoinclude = 1; 216 my $nextfilestyles = ""; 217 if ( $nextfile->{'Styles'} ) { $nextfilestyles = $nextfile->{'Styles'}; } 218 if ( $nextfilestyles =~ /\bDONT_PACK\b/ ) { $localdoinclude = 0; } 219 $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n"; 220 if ( $localdoinclude ) { push(@ddffile, $ddfline); } 221 $counter++; # increasing the counter! 222 $nextfile = ""; 223 $nextcabinetfile = "_lastfile_"; 224 if (( exists($sequenceorder->{$counter}) ) && ( ${$filesref}[$sequenceorder->{$counter}] )) 225 { 226 $nextfile = ${$filesref}[$sequenceorder->{$counter}]; 227 $nextcabinetfile = $nextfile->{'cabinet'}; 228 } 229 } 230 231 # creating the DDF file 232 233 my $ddffilename = $cabinetfile; 234 $ddffilename =~ s/.cab/.ddf/; 235 $ddfdir =~ s/\Q$installer::globals::separator\E\s*$//; 236 $ddffilename = $ddfdir . $installer::globals::separator . $ddffilename; 237 238 installer::files::save_file($ddffilename ,\@ddffile); 239 my $infoline = "Created ddf file: $ddffilename\n"; 240 $installer::logger::Lang->print($infoline); 241 242 # lines in ddf files must not be longer than 256 characters 243 check_ddf_file(\@ddffile, $ddffilename); 244 245 # Writing the makecab system call 246 247 my $oneline = "makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n"; 248 249 push(@cabfilelist, $oneline); 250 251 # collecting all ddf files 252 push(@installer::globals::allddffiles, $ddffilename); 253 } 254 } 255 elsif ( $installer::globals::fix_number_of_cab_files ) 256 { | |
257 for ( my $i = 0; $i <= $#{$filesref}; $i++ ) 258 { 259 my $onefile = ${$filesref}[$i]; 260 my $cabinetfile = $onefile->{'cabinet'}; 261 my $sourcepath = $onefile->{'sourcepath'}; 262 if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; } 263 my $uniquename = $onefile->{'uniquename'}; 264 --- 1561 unchanged lines hidden (view full) --- 1826 } 1827 } 1828 else # only one language 1829 { 1830 $onelanguage = ${$languagesref}[0]; 1831 } 1832 1833 # ProductCode must not change, if Windows patches shall be applied | 171 for ( my $i = 0; $i <= $#{$filesref}; $i++ ) 172 { 173 my $onefile = ${$filesref}[$i]; 174 my $cabinetfile = $onefile->{'cabinet'}; 175 my $sourcepath = $onefile->{'sourcepath'}; 176 if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; } 177 my $uniquename = $onefile->{'uniquename'}; 178 --- 1561 unchanged lines hidden (view full) --- 1740 } 1741 } 1742 else # only one language 1743 { 1744 $onelanguage = ${$languagesref}[0]; 1745 } 1746 1747 # ProductCode must not change, if Windows patches shall be applied |
1834 if ( $installer::globals::updatedatabase ) 1835 { 1836 $installer::globals::productcode = $alloldproperties->{'ProductCode'}; 1837 } 1838 elsif ( $installer::globals::prepare_winpatch ) | 1748 if ( $installer::globals::prepare_winpatch ) |
1839 { 1840 # ProductCode has to be specified in each language 1841 my $searchstring = "PRODUCTCODE"; 1842 my $codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile); 1843 $installer::globals::productcode = installer::windows::idtglobal::get_code_from_code_block($codeblock, $onelanguage); 1844 } else { 1845 my $guidref = get_guid_list(1, 1); # only one GUID shall be generated 1846 ${$guidref}[0] =~ s/\s*$//; # removing ending spaces --- 358 unchanged lines hidden --- | 1749 { 1750 # ProductCode has to be specified in each language 1751 my $searchstring = "PRODUCTCODE"; 1752 my $codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile); 1753 $installer::globals::productcode = installer::windows::idtglobal::get_code_from_code_block($codeblock, $onelanguage); 1754 } else { 1755 my $guidref = get_guid_list(1, 1); # only one GUID shall be generated 1756 ${$guidref}[0] =~ s/\s*$//; # removing ending spaces --- 358 unchanged lines hidden --- |