diff options
author | Kurt Zenker <kz@openoffice.org> | 2007-09-06 08:55:56 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2007-09-06 08:55:56 +0000 |
commit | 436ebc958b350554289ea6b99e03f3089e6b35df (patch) | |
tree | 3582f11dcffd350249feb127d2e557b21ad6b05f /solenv/bin/modules/installer/windows/msiglobal.pm | |
parent | c29c56447a9e661c6f236de416c0c95dec4408c9 (diff) |
INTEGRATION: CWS native100 (1.40.42); FILE MERGED
2007/08/23 15:10:35 is 1.40.42.1: #i80937,i80938# introducing module order, package restructuring
Diffstat (limited to 'solenv/bin/modules/installer/windows/msiglobal.pm')
-rw-r--r-- | solenv/bin/modules/installer/windows/msiglobal.pm | 119 |
1 files changed, 112 insertions, 7 deletions
diff --git a/solenv/bin/modules/installer/windows/msiglobal.pm b/solenv/bin/modules/installer/windows/msiglobal.pm index de8e95617b43..c8733105d44f 100644 --- a/solenv/bin/modules/installer/windows/msiglobal.pm +++ b/solenv/bin/modules/installer/windows/msiglobal.pm @@ -4,9 +4,9 @@ # # $RCSfile: msiglobal.pm,v $ # -# $Revision: 1.40 $ +# $Revision: 1.41 $ # -# last change: $Author: ihi $ $Date: 2007-07-12 11:17:01 $ +# last change: $Author: kz $ $Date: 2007-09-06 09:55:56 $ # # The Contents of this file are made available subject to # the terms of GNU Lesser General Public License Version 2.1. @@ -141,6 +141,26 @@ sub make_relative_ddf_path } ########################################################################## +# Returning the order of the sequences in the files array. +########################################################################## + +sub get_sequenceorder +{ + my ($filesref) = @_; + + my %order = (); + + for ( my $i = 0; $i <= $#{$filesref}; $i++ ) + { + my $onefile = ${$filesref}[$i]; + if ( ! $onefile->{'assignedsequencenumber'} ) { installer::exiter::exit_program("ERROR: Sequence number assigned to $onefile->{'gid'}!", "get_sequenceorder"); } + $order{$onefile->{'assignedsequencenumber'}} = $i; + } + + return \%order; +} + +########################################################################## # Generation the list, in which the source of the files is connected # with the cabinet destination file. Because more than one file needs # to be included into a cab file, this has to be done via ddf files. @@ -158,7 +178,93 @@ sub generate_cab_file_list if ( $^O =~ /cygwin/i ) { installer::worker::generate_cygwin_pathes($filesref); } - if (( $installer::globals::cab_file_per_component ) || ( $installer::globals::fix_number_of_cab_files )) + if ( $installer::globals::use_packages_for_cabs ) + { + my $sequenceorder = get_sequenceorder($filesref); + + my $counter = 1; + my $currentcabfile = ""; + + while ( exists($sequenceorder->{$counter}) ) + { + # Files with increasing sequencerorder are included in one cab file + my $onefile = ${$filesref}[$sequenceorder->{$counter}]; + my $cabinetfile = $onefile->{'assignedcabinetfile'}; + my $sourcepath = $onefile->{'sourcepath'}; + if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; } + my $uniquename = $onefile->{'uniquename'}; + + my $styles = ""; + my $doinclude = 1; + if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }; + if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; } + + # to avoid lines with more than 256 characters, it can be useful to use relative pathes + if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } + + # all files with the same cabinetfile have increasing sequencenumbers + + my @ddffile = (); + + write_ddf_file_header(\@ddffile, $cabinetfile, $installdir); + + my $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n"; + if ( $doinclude ) { push(@ddffile, $ddfline); } + + $counter++; # increasing the counter + my $nextfile = ""; + my $nextcabinetfile = ""; + if ( exists($sequenceorder->{$counter}) ) { $nextfile = ${$filesref}[$sequenceorder->{$counter}]; } + if ( $nextfile->{'assignedcabinetfile'} ) { $nextcabinetfile = $nextfile->{'assignedcabinetfile'}; } + + while ( $nextcabinetfile eq $cabinetfile ) + { + $sourcepath = $nextfile->{'sourcepath'}; + if ( $^O =~ /cygwin/i ) { $sourcepath = $nextfile->{'cyg_sourcepath'}; } + # to avoid lines with more than 256 characters, it can be useful to use relative pathes + if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } + $uniquename = $nextfile->{'uniquename'}; + my $localdoinclude = 1; + my $nextfilestyles = ""; + if ( $nextfile->{'Styles'} ) { $nextfilestyles = $nextfile->{'Styles'}; } + if ( $nextfilestyles =~ /\bDONT_PACK\b/ ) { $localdoinclude = 0; } + $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n"; + if ( $localdoinclude ) { push(@ddffile, $ddfline); } + + $counter++; # increasing the counter! + $nextcabinetfile = "_lastfile_"; + if ( exists($sequenceorder->{$counter}) ) + { + $nextfile = ${$filesref}[$sequenceorder->{$counter}]; + $nextcabinetfile = $nextfile->{'assignedcabinetfile'}; + } + } + + # creating the DDF file + + my $ddffilename = $cabinetfile; + $ddffilename =~ s/.cab/.ddf/; + $ddfdir =~ s/\Q$installer::globals::separator\E\s*$//; + $ddffilename = $ddfdir . $installer::globals::separator . $ddffilename; + + installer::files::save_file($ddffilename ,\@ddffile); + my $infoline = "Created ddf file: $ddffilename\n"; + push(@installer::globals::logfileinfo, $infoline); + + # lines in ddf files must not be longer than 256 characters + check_ddf_file(\@ddffile, $ddffilename); + + # Writing the makecab system call + + my $oneline = "makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n"; + + push(@cabfilelist, $oneline); + + # collecting all ddf files + push(@installer::globals::allddffiles, $ddffilename); + } + } + elsif (( $installer::globals::cab_file_per_component ) || ( $installer::globals::fix_number_of_cab_files )) { for ( my $i = 0; $i <= $#{$filesref}; $i++ ) { @@ -334,8 +440,6 @@ sub get_file_sequence sub save_packorder { - my ( $filesref ) = @_; - installer::logger::include_header_into_logfile("Saving pack order"); installer::logger::include_timestamp_into_logfile("Performance Info: saving pack order start"); @@ -773,7 +877,7 @@ sub create_transforms { $infoline = "File $transformfile exists.\n"; push( @installer::globals::logfileinfo, $infoline); - my $filesize = (stat($transformfile))[7]; + my $filesize = ( -s $transformfile ); $infoline = "Size of $transformfile: $filesize\n"; push( @installer::globals::logfileinfo, $infoline); @@ -1445,6 +1549,7 @@ sub execute_packaging $ENV{'TMP'} = $installer::globals::temppath; # setting TMP to the new unique directory! my $maxmakecabcalls = 3; + my $allmakecabcalls = $#{$localpackjobref} + 1; for ( my $i = 0; $i <= $#{$localpackjobref}; $i++ ) { @@ -1452,7 +1557,7 @@ sub execute_packaging my $callscounter = $i + 1; - installer::logger::print_message( "... makecab.exe ($callscounter) ... \n" ); + installer::logger::print_message( "... makecab.exe ($callscounter/$allmakecabcalls) ... \n" ); # my $returnvalue = system($systemcall); |