[ooo-build-commit] Branch 'ooo/OOO310' - 4 commits - scp2/source solenv/bin solenv/inc
Jan Holesovsky
kendy at kemper.freedesktop.org
Mon Jul 27 17:07:55 PDT 2009
scp2/source/ooo/ure.scp | 4
solenv/bin/gen_update_info.pl | 32 +
solenv/bin/make_download.pl | 69 +-
solenv/bin/modules/installer/download.pm | 81 ++
solenv/bin/modules/installer/downloadsigner.pm | 238 +++++++-
solenv/bin/modules/installer/followme.pm | 20
solenv/bin/modules/installer/globals.pm | 7
solenv/bin/modules/installer/windows/idtglobal.pm | 2
solenv/bin/modules/installer/windows/sign.pm | 637 ++++++++++++++++++++--
solenv/bin/modules/installer/worker.pm | 2
solenv/inc/unxsoli4.mk | 2
11 files changed, 1000 insertions(+), 94 deletions(-)
New commits:
commit e6a1edd93262d4ad417c325675f30e00edf1c7b6
Author: Kurt Zenker <kz at openoffice.org>
Date: Mon Jul 27 16:12:56 2009 +0000
CWS-TOOLING: integrate CWS hr64
2009-07-21 13:24:57 +0200 hr r274189 : #i99576#: re-enable optimization for tabcont.cxx
2009-07-21 13:17:18 +0200 hr r274188 : #i99592: disable -xspace optimization for Solaris x86 and SunStudio 12, due to some mis-optimzation in sc and elsewhere. SunStudio 12 update 1 is OK, but needs a few unrelated changes which will be implemented in DEV300 code line
diff --git a/solenv/inc/unxsoli4.mk b/solenv/inc/unxsoli4.mk
index 4567453..979a2c8 100644
--- a/solenv/inc/unxsoli4.mk
+++ b/solenv/inc/unxsoli4.mk
@@ -72,7 +72,7 @@ CFLAGSSLOCUIMT=-KPIC -mt
CFLAGSPROF=-xpg
CFLAGSDEBUG=-g
CFLAGSDBGUTIL=
-CFLAGSOPT=-xarch=generic -xO3 -xspace
+CFLAGSOPT=-xarch=generic -xO3
CFLAGSNOOPT=
CFLAGSOUTOBJ=-o
commit e147aa36516d66dc8f68b294fe479b96dfefa866
Author: Kurt Zenker <kz at openoffice.org>
Date: Mon Jul 27 15:50:22 2009 +0000
CWS-TOOLING: integrate CWS jl130
2009-07-15 08:29:18 +0200 jl r273988 : #160194# patch flag for javaldx and sunjavaplugin
diff --git a/scp2/source/ooo/ure.scp b/scp2/source/ooo/ure.scp
index 2e54ed1..ad669f7 100755
--- a/scp2/source/ooo/ure.scp
+++ b/scp2/source/ooo/ure.scp
@@ -134,7 +134,7 @@ File gid_File_Exe_Javaldx
BIN_FILE_BODY;
Dir = gid_Dir_Ure_Bin;
Name = EXENAME(javaldx);
- Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID);
+ Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID, PATCH);
// CompID = "291B5981-3E41-40E2-9C3F-115A7DF1C6A1";
End
#endif
@@ -336,7 +336,7 @@ File gid_File_Dl_Sunjavaplugin
TXT_FILE_BODY;
Dir = SCP2_URE_DL_DIR;
Name = SCP2_URE_DL_BARE("sunjavaplugin");
- Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID);
+ Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID, PATCH);
// CompID = "0AC6C688-876C-40C5-B24E-9257003FDC3E";
End
#endif
commit 55f776933d5ab011a1dfa80ddec900867d2c976e
Author: Kurt Zenker <kz at openoffice.org>
Date: Mon Jul 27 15:18:43 2009 +0000
CWS-TOOLING: integrate CWS native258
2009-07-16 13:55:09 +0200 is r274050 : #i103569# providing minor and micro for udpate database
diff --git a/solenv/bin/gen_update_info.pl b/solenv/bin/gen_update_info.pl
index fb9770a..cd5b951 100644
--- a/solenv/bin/gen_update_info.pl
+++ b/solenv/bin/gen_update_info.pl
@@ -79,6 +79,32 @@ if( $^O =~ /cygwin/i ) {
}
# read openoffice.lst
+# reading Globals section
+unless(open(LSTFILE, "sed -n \"/^Globals\$/,/^}\$/ p\" $lstfile |")) {
+ print STDERR "Can't open $lstfile file: $!\n";
+ return;
+}
+
+while (<LSTFILE>) {
+ if( /\bPRODUCTNAME / ) {
+ chomp;
+ s/.*PRODUCTNAME //;
+ $productname = $_;
+ }
+ if( /\bPACKAGEVERSION / ) {
+ chomp;
+ s/.*PACKAGEVERSION //;
+ $productversion = $_;
+ }
+ if( /\bPRODUCTEDITION / ) {
+ chomp;
+ s/.*PRODUCTEDITION //;
+ $productedition = $_;
+ }
+}
+
+close(LSTFILE);
+
### may be hierarchical ...
if(open(LSTFILE, "sed -n \"/^$product:/,/^}\$/ p\" $lstfile |")) {
while (<LSTFILE>) {
@@ -94,6 +120,8 @@ if(open(LSTFILE, "sed -n \"/^$product:/,/^}\$/ p\" $lstfile |")) {
}
close(LSTFILE);
+# Reading product specific settings
+
unless(open(LSTFILE, "sed -n \"/^$product\$/,/^}\$/ p\" $lstfile |")) {
print STDERR "Can't open $lstfile file: $!\n";
return;
@@ -105,9 +133,9 @@ while (<LSTFILE>) {
s/.*PRODUCTNAME //;
$productname = $_;
}
- if( /\bPRODUCTVERSION / ) {
+ if( /\bPACKAGEVERSION / ) {
chomp;
- s/.*PRODUCTVERSION //;
+ s/.*PACKAGEVERSION //;
$productversion = $_;
}
if( /\bPRODUCTEDITION / ) {
commit 1c20df018181067185db29525c00df6f77761028
Author: Kurt Zenker <kz at openoffice.org>
Date: Mon Jul 27 13:31:58 2009 +0000
CWS-TOOLING: integrate CWS native244
2009-05-07 14:16:01 +0200 is r271665 : #159613# expanding the sign process
2009-05-07 11:52:30 +0200 is r271649 : #159613# expanding the sign process
2009-05-07 11:52:09 +0200 is r271648 : #159613# expanding the sign process
2009-05-06 17:35:03 +0200 is r271605 : #159613# expanding the sign process
2009-05-06 17:34:43 +0200 is r271604 : #159613# expanding the sign process
2009-05-06 17:34:19 +0200 is r271603 : #159613# expanding the sign process
2009-05-06 14:18:54 +0200 is r271586 : #159613# expanding the sign process
2009-05-05 15:05:03 +0200 is r271521 : #159613# expanding the sign process
2009-05-05 14:41:26 +0200 is r271517 : #159613# expanding the sign process
2009-05-04 15:13:03 +0200 is r271461 : #159613# expanding the sign process
diff --git a/solenv/bin/make_download.pl b/solenv/bin/make_download.pl
index d39d42f..96a152a 100644
--- a/solenv/bin/make_download.pl
+++ b/solenv/bin/make_download.pl
@@ -52,6 +52,7 @@ use installer::windows::sign;
installer::downloadsigner::getparameter();
installer::downloadsigner::checkparameter();
+my $temppath = installer::downloadsigner::set_temp_path();
my $infofilelist = installer::downloadsigner::createproductlist();
installer::downloadsigner::publishproductlist($infofilelist);
@@ -62,19 +63,21 @@ foreach my $infofilename ( @{$infofilelist} )
my $success = 1;
my $do_copy = 1;
my $followmeinfohash = installer::followme::read_followme_info($infofilename);
- installer::downloadsigner::setlogfilename();
+ installer::downloadsigner::setlogfilename(); # Successful after reading followme file, resetting log file
+ if ( $installer::globals::writetotemp ) { installer::downloadsigner::set_output_pathes_to_temp($followmeinfohash, $temppath); }
+ if ( $installer::globals::useminor ) { installer::downloadsigner::set_minor_into_pathes($followmeinfohash, $temppath); }
if (( ! $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
{
installer::logger::print_message( "... WARNING: Signing only for Windows platforms active ...\n" );
}
- installer::logger::include_header_into_logfile("Reading include pathes");
- installer::worker::collect_all_files_from_includepathes($followmeinfohash->{'includepatharray'});
+ # installer::logger::include_header_into_logfile("Reading include pathes");
+ # installer::worker::collect_all_files_from_includepathes($followmeinfohash->{'includepatharray'});
if (( $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
{
- $followmeinfohash->{'finalinstalldir'} = installer::windows::sign::sign_install_set($followmeinfohash, $do_copy);
+ $followmeinfohash->{'finalinstalldir'} = installer::windows::sign::sign_install_set($followmeinfohash, $do_copy, $temppath);
($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
$followmeinfohash->{'finalinstalldir'},
@@ -86,37 +89,45 @@ foreach my $infofilename ( @{$infofilelist} )
if ( ! $success ) { installer::exiter::exit_program("ERROR: Signing installation set failed: $followmeinfohash->{'finalinstalldir'}", "Main"); }
}
- $followmeinfohash->{'finalinstalldir'} = installer::download::create_download_sets($followmeinfohash->{'finalinstalldir'},
- $followmeinfohash->{'includepatharray'},
- $followmeinfohash->{'allvariableshash'},
- $followmeinfohash->{'downloadname'},
- \$followmeinfohash->{'languagestring'},
- $followmeinfohash->{'languagesarray'});
-
- ($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
- $followmeinfohash->{'finalinstalldir'},
- $followmeinfohash->{'installlogdir'},
- "",
- \$followmeinfohash->{'languagestring'},
- $followmeinfohash->{'currentinstallnumber'});
-
- if (( $success ) && ( $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
+ if ( ! $installer::globals::nodownload )
{
- $do_copy = 0;
- $followmeinfohash->{'finalinstalldir'} = installer::windows::sign::sign_install_set($followmeinfohash, $do_copy);
-
- $followmeinfohash->{'finalinstalldir'} = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
- $followmeinfohash->{'finalinstalldir'},
- $followmeinfohash->{'installlogdir'},
- "",
- \$followmeinfohash->{'languagestring'},
- $followmeinfohash->{'currentinstallnumber'});
+ $followmeinfohash->{'finalinstalldir'} = installer::download::create_download_sets($followmeinfohash->{'finalinstalldir'},
+ $followmeinfohash->{'includepatharray'},
+ $followmeinfohash->{'allvariableshash'},
+ $followmeinfohash->{'downloadname'},
+ \$followmeinfohash->{'languagestring'},
+ $followmeinfohash->{'languagesarray'});
+
+ ($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
+ $followmeinfohash->{'finalinstalldir'},
+ $followmeinfohash->{'installlogdir'},
+ "",
+ \$followmeinfohash->{'languagestring'},
+ $followmeinfohash->{'currentinstallnumber'});
+
+ if (( $success ) && ( $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
+ {
+ $do_copy = 0;
+ $followmeinfohash->{'finalinstalldir'} = installer::windows::sign::sign_install_set($followmeinfohash, $do_copy, $temppath);
+
+ ($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
+ $followmeinfohash->{'finalinstalldir'},
+ $followmeinfohash->{'installlogdir'},
+ "",
+ \$followmeinfohash->{'languagestring'},
+ $followmeinfohash->{'currentinstallnumber'});
+ }
+ }
+
+ if ( $success )
+ {
+ installer::worker::clean_output_tree();
+ if ( $installer::globals::followme_from_directory ) { installer::downloadsigner::rename_followme_infofile($infofilename); }
}
installer::logger::stoptime();
}
-
####################################
# Main program end
####################################
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm
index c98c1a2..f2540a4 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -270,7 +270,18 @@ sub get_path_for_library
my ($includepatharrayref) = @_;
my $getuidlibraryname = "getuid.so";
- my $getuidlibraryref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$getuidlibraryname, $includepatharrayref, 0);
+
+ my $getuidlibraryref = "";
+
+ if ( $installer::globals::include_pathes_read )
+ {
+ $getuidlibraryref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$getuidlibraryname, $includepatharrayref, 0);
+ }
+ else
+ {
+ $getuidlibraryref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$getuidlibraryname, $includepatharrayref, 0);
+ }
+
if ($$getuidlibraryref eq "") { installer::exiter::exit_program("ERROR: Could not find $getuidlibraryname!", "get_path_for_library"); }
return $$getuidlibraryref;
@@ -782,12 +793,21 @@ sub put_banner_bmp_into_template
if ( ! $allvariables->{'DOWNLOADBANNER'} ) { installer::exiter::exit_program("ERROR: DOWNLOADBANNER not defined in product definition!", "put_banner_bmp_into_template"); }
my $filename = $allvariables->{'DOWNLOADBANNER'};
- my $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
+ my $completefilenameref = "";
- if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
+ if ( $installer::globals::include_pathes_read )
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
+ }
+ else
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0);
+ }
if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "put_banner_bmp_into_template"); }
+ if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
+
replace_one_variable($templatefile, "BANNERBMPPLACEHOLDER", $$completefilenameref);
}
@@ -803,12 +823,21 @@ sub put_welcome_bmp_into_template
if ( ! $allvariables->{'DOWNLOADBITMAP'} ) { installer::exiter::exit_program("ERROR: DOWNLOADBITMAP not defined in product definition!", "put_welcome_bmp_into_template"); }
my $filename = $allvariables->{'DOWNLOADBITMAP'};
- my $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
+ my $completefilenameref = "";
- if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
+ if ( $installer::globals::include_pathes_read )
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
+ }
+ else
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0);
+ }
if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "put_welcome_bmp_into_template"); }
+ if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
+
replace_one_variable($templatefile, "WELCOMEBMPPLACEHOLDER", $$completefilenameref);
}
@@ -824,12 +853,21 @@ sub put_setup_ico_into_template
if ( ! $allvariables->{'DOWNLOADSETUPICO'} ) { installer::exiter::exit_program("ERROR: DOWNLOADSETUPICO not defined in product definition!", "put_setup_ico_into_template"); }
my $filename = $allvariables->{'DOWNLOADSETUPICO'};
- my $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
+ my $completefilenameref = "";
- if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
+ if ( $installer::globals::include_pathes_read )
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
+ }
+ else
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0);
+ }
if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "put_setup_ico_into_template"); }
+ if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
+
replace_one_variable($templatefile, "SETUPICOPLACEHOLDER", $$completefilenameref);
}
@@ -1050,8 +1088,7 @@ sub nsis_language_converter
elsif ( $language eq "vi" ) { $nsislanguage = "Vietnamese"; }
elsif ( $language eq "zh-CN" ) { $nsislanguage = "SimpChinese"; }
elsif ( $language eq "zh-TW" ) { $nsislanguage = "TradChinese"; }
- else {
-
+ else {
my $infoline = "NSIS language_converter : Could not find nsis language for $language!\n";
push( @installer::globals::logfileinfo, $infoline);
$nsislanguage = "English";
@@ -1741,7 +1778,18 @@ sub create_download_sets
{
# find and read setup script template
my $scriptfilename = "downloadscript.sh";
- my $scriptref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$scriptfilename, $includepatharrayref, 0);
+
+ my $scriptref = "";
+
+ if ( $installer::globals::include_pathes_read )
+ {
+ $scriptref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$scriptfilename, $includepatharrayref, 0);
+ }
+ else
+ {
+ $scriptref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$scriptfilename, $includepatharrayref, 0);
+ }
+
if ($$scriptref eq "") { installer::exiter::exit_program("ERROR: Could not find script file $scriptfilename!", "create_download_sets"); }
my $scriptfile = installer::files::read_file($$scriptref);
@@ -1796,7 +1844,18 @@ sub create_download_sets
# find and read the nsi file template
my $templatefilename = "downloadtemplate.nsi";
- my $templateref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$templatefilename, $includepatharrayref, 0);
+
+ my $templateref = "";
+
+ if ( $installer::globals::include_pathes_read )
+ {
+ $templateref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$templatefilename, $includepatharrayref, 0);
+ }
+ else
+ {
+ $templateref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$templatefilename, $includepatharrayref, 0);
+ }
+
if ($$templateref eq "") { installer::exiter::exit_program("ERROR: Could not find nsi template file $templatefilename!", "create_download_sets"); }
my $templatefile = installer::files::read_file($$templateref);
diff --git a/solenv/bin/modules/installer/downloadsigner.pm b/solenv/bin/modules/installer/downloadsigner.pm
index e19e7c8..ba07973 100644
--- a/solenv/bin/modules/installer/downloadsigner.pm
+++ b/solenv/bin/modules/installer/downloadsigner.pm
@@ -45,12 +45,23 @@ sub usage
{
print <<Ende;
--------------------------------------------------------------------------------
-make_download V1.0 (c) Ingo Schmidt-Rosbiegal 2009
+make_download V1.0
The following parameter are needed:
-d: Full path to the file containing the follow-me info or to a directory
containing the follow-me info files. In the latter case, all follow-me
- info files are evaluated.
+ info files are evaluated. If a directory is used, the successfully used
+ follow-me info files are renamed using a string "success". Files with
+ this string are ignored in repeated processes using "-d" with a
+ directory.
+
The following parameter are optional:
+-nodownload: Only signing, no creation of download sets (Windows only)
+-useminor: Important for installation sets, created without minor set
+-writetotemp: Necessary, if you do not want to write into solver
+ This can be caused by missing privileges (Windows only)
+-internalcabinet: Not only the cabinet files are signed, but also all
+ files included in the cabinet files (Windows only).
+
-sign: Uses signing mechanism to sign installation sets
If \"-sign\" is set, the following two parameter are required:
-pfx: Full path to the pfx file
@@ -60,17 +71,19 @@ Examples:
Specifying an installation set (with "-d"):
-perl make_sign_and_download.pl -d <followmeinfofilename>
-perl make_sign_and_download.pl -d <followmeinfofilename>
- -sign
- -pfx <pfxfilename>
- -pw <passwordfilename>
+perl make_download.pl -d <followmeinfofilename>
+
+perl make_download.pl -d <followmeinfofilename>
+ -sign
+ -pfx <pfxfilename>
+ -pw <passwordfilename>
or without specifying an installation set:
-perl make_sign_and_download.pl -sign
- -pfx <pfxfilename>
- -pw <passwordfilename>
+perl make_download.pl -d <followmedirectory>
+ -sign
+ -pfx <pfxfilename>
+ -pw <passwordfilename>
--------------------------------------------------------------------------------
Ende
exit(-1);
@@ -92,6 +105,10 @@ sub getparameter
elsif ($param eq "-pw") { $installer::globals::pwfile = shift(@ARGV); }
elsif ($param eq "-pfx") { $installer::globals::pfxfile = shift(@ARGV); }
elsif ($param eq "-sign") { $installer::globals::dosign = 1; }
+ elsif ($param eq "-nodownload") { $installer::globals::nodownload = 1; }
+ elsif ($param eq "-writetotemp") { $installer::globals::writetotemp = 1; }
+ elsif ($param eq "-useminor") { $installer::globals::useminor = 1; }
+ elsif ($param eq "-internalcabinet") { $installer::globals::internal_cabinet_signing = 1; }
else
{
installer::logger::print_error( "unknown parameter: $param" );
@@ -150,6 +167,165 @@ sub checkparameter
}
#############################################
+# Setting the temporary path for the download
+# and signing process
+#############################################
+
+sub set_temp_path
+{
+ my $temppath = "";
+ my $pid = $$; # process id
+ my $time = time(); # time
+ my $helperdir = "unpackdir_" . $pid . $time;
+
+ if (( $ENV{'TMP'} ) || ( $ENV{'TEMP'} ))
+ {
+ if ( $ENV{'TMP'} ) { $temppath = $ENV{'TMP'}; }
+ elsif ( $ENV{'TEMP'} ) { $temppath = $ENV{'TEMP'}; }
+ $temppath =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes
+ $temppath = $temppath . $installer::globals::separator . $helperdir;
+
+ if( $^O =~ /cygwin/i )
+ {
+ $temppath = qx{cygpath -w "$temppath"};
+ $temppath =~ s/\\/\//g;
+ $temppath =~ s/\s*$//g;
+ }
+
+ installer::systemactions::create_directory_structure($temppath);
+ }
+ else
+ {
+ installer::logger::print_error( "Error: TMP and TEMP not defined. This is required for this process.\n" );
+ usage();
+ exit(-1);
+ }
+
+ installer::logger::print_message( "\n... using output path: $temppath ...\n" );
+
+ push(@installer::globals::removedirs, $temppath);
+
+ return $temppath;
+}
+
+#############################################
+# Setting output pathes to temp directory
+# This are the:
+# unpackpath and the loggingdir
+#############################################
+
+sub set_output_pathes_to_temp
+{
+ my ($followmeinfohash, $temppath) = @_;
+
+ $followmeinfohash->{'loggingdir'} = $temppath . $installer::globals::separator;
+ $installer::globals::unpackpath = $temppath;
+}
+
+#############################################
+# Setting the minor into the pathes. This is
+# required, if the original installation set
+# was created without minor
+# Value is always saved in
+# $installer::globals::lastminor
+# which is saved in the follow_me file
+#############################################
+
+sub set_minor_into_pathes
+{
+ my ($followmeinfohash, $temppath) = @_;
+
+ installer::logger::print_message( "\n... forcing into minor: $installer::globals::lastminor ...\n" );
+
+ my @pathnames = ("bin", "doc", "inc", "lib", "pck", "res", "xml");
+ my $sourcename = "src";
+ my $srcpath = $installer::globals::separator . $sourcename . $installer::globals::separator;
+
+ if ( $installer::globals::minor ne "" )
+ {
+ installer::logger::print_message( "\n... already defined minor: $installer::globals::minor -> ignoring parameter \"-useminor\" ...\n" );
+ return;
+ }
+
+ # Affected pathes:
+ # $contenthash{'installlogdir'}
+ # $contenthash{'includepatharray'}
+ # $installer::globals::unpackpath
+ # $installer::globals::idttemplatepath
+ # $installer::globals::idtlanguagepath
+
+ installer::logger::include_header_into_logfile("Changing saved pathes to add the minor");
+ my $infoline = "Old pathes:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$followmeinfohash->{'installlogdir'}: $followmeinfohash->{'installlogdir'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::unpackpath: $installer::globals::unpackpath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::idttemplatepath: $installer::globals::idttemplatepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::idtlanguagepath: $installer::globals::idtlanguagepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Include pathes:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ foreach my $path ( @{$followmeinfohash->{'includepatharray'}} ) { push( @installer::globals::logfileinfo, $path); }
+
+ foreach $onepath ( @pathnames )
+ {
+ my $oldvalue = $installer::globals::separator . $onepath . $installer::globals::separator;
+ my $newvalue = $installer::globals::separator . $onepath . "\." . $installer::globals::lastminor . $installer::globals::separator;
+
+ if (( $followmeinfohash->{'installlogdir'} =~ /\Q$oldvalue\E/ ) && ( ! ( $followmeinfohash->{'installlogdir'} =~ /\Q$srcpath\E/ ))) { $followmeinfohash->{'installlogdir'} =~ s/\Q$oldvalue\E/$newvalue/; }
+ if (( $installer::globals::unpackpath =~ /\Q$oldvalue\E/ ) && ( ! ( $installer::globals::unpackpath =~ /\Q$srcpath\E/ ))) { $installer::globals::unpackpath =~ s/\Q$oldvalue\E/$newvalue/; }
+ if (( $installer::globals::idttemplatepath =~ /\Q$oldvalue\E/ ) && ( ! ( $installer::globals::idttemplatepath =~ /\Q$srcpath\E/ ))) { $installer::globals::idttemplatepath =~ s/\Q$oldvalue\E/$newvalue/; }
+ if (( $installer::globals::idtlanguagepath =~ /\Q$oldvalue\E/ ) && ( ! ( $installer::globals::idtlanguagepath =~ /\Q$srcpath\E/ ))) { $installer::globals::idtlanguagepath =~ s/\Q$oldvalue\E/$newvalue/; }
+ foreach my $path ( @{$followmeinfohash->{'includepatharray'}} ) { if (( $path =~ /\Q$oldvalue\E/ ) && ( ! ( $path =~ /\Q$srcpath\E/ ))) { $path =~ s/\Q$oldvalue\E/$newvalue/; } }
+
+ # Checking for the end of the path
+ $oldvalue = $installer::globals::separator . $onepath;
+ $newvalue = $installer::globals::separator . $onepath . "\." . $installer::globals::lastminor;
+
+ if (( $followmeinfohash->{'installlogdir'} =~ /\Q$oldvalue\E\s*$/ ) && ( ! ( $followmeinfohash->{'installlogdir'} =~ /\Q$srcpath\E/ ))) { $followmeinfohash->{'installlogdir'} =~ s/\Q$oldvalue\E\s*$/$newvalue/; }
+ if (( $installer::globals::unpackpath =~ /\Q$oldvalue\E\s*$/ ) && ( ! ( $installer::globals::unpackpath =~ /\Q$srcpath\E/ ))) { $installer::globals::unpackpath =~ s/\Q$oldvalue\E\s*$/$newvalue/; }
+ if (( $installer::globals::idttemplatepath =~ /\Q$oldvalue\E\s*$/ ) && ( ! ( $installer::globals::idttemplatepath =~ /\Q$srcpath\E/ ))) { $installer::globals::idttemplatepath =~ s/\Q$oldvalue\E\s*$/$newvalue/; }
+ if (( $installer::globals::idtlanguagepath =~ /\Q$oldvalue\E\s*$/ ) && ( ! ( $installer::globals::idtlanguagepath =~ /\Q$srcpath\E/ ))) { $installer::globals::idtlanguagepath =~ s/\Q$oldvalue\E\s*$/$newvalue/; }
+ foreach my $path ( @{$followmeinfohash->{'includepatharray'}} )
+ {
+ if (( $path =~ /\Q$oldvalue\E\s*$/ ) && ( ! ( $path =~ /\Q$srcpath\E/ )))
+ {
+ $path =~ s/\Q$oldvalue\E\s*$/$newvalue/;
+ $path = $path . "\n";
+ }
+ }
+ }
+
+ # And now can follow the replacement for the source path "src". Subdirs like "bin" in the source tree
+ # must not get the minor. This is instead "src.m9/instsetoo_native/common.pro/bin/..."
+ # Directory "src" can never be the end of the path
+
+ my $newsrcpath = $installer::globals::separator . $sourcename . "\." . $installer::globals::lastminor . $installer::globals::separator;
+
+ if ( $followmeinfohash->{'installlogdir'} =~ /\Q$srcpath\E/ ) { $followmeinfohash->{'installlogdir'} =~ s/\Q$srcpath\E/$newsrcpath/; }
+ if ( $installer::globals::unpackpath =~ /\Q$srcpath\E/ ) { $installer::globals::unpackpath =~ s/\Q$srcpath\E/$newsrcpath/; }
+ if ( $installer::globals::idttemplatepath =~ /\Q$srcpath\E/ ) { $installer::globals::idttemplatepath =~ s/\Q$srcpath\E/$newsrcpath/; }
+ if ( $installer::globals::idtlanguagepath =~ /\Q$srcpath\E/ ) { $installer::globals::idtlanguagepath =~ s/\Q$srcpath\E/$newsrcpath/; }
+ foreach my $path ( @{$followmeinfohash->{'includepatharray'}} ) { if ( $path =~ /\Q$srcpath\E/ ) { $path =~ s/\Q$srcpath\E/$newsrcpath/; } }
+
+ $infoline = "\nNew pathes:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$followmeinfohash->{'installlogdir'}: $followmeinfohash->{'installlogdir'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::unpackpath: $installer::globals::unpackpath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::idttemplatepath: $installer::globals::idttemplatepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::idtlanguagepath: $installer::globals::idtlanguagepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Include pathes:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ foreach my $path ( @{$followmeinfohash->{'includepatharray'}} ) { push( @installer::globals::logfileinfo, $path); }
+}
+
+#############################################
# Setting the name of the log file
#############################################
@@ -291,10 +467,13 @@ sub createproductlist
# If "-d" specifies an installation set, there is only one product
my @infofilelist = ();
+ my @infofilelist2 = ();
if ( -f $installer::globals::followmeinfofilename )
{
push(@infofilelist, $installer::globals::followmeinfofilename);
+ # Saving info, that this is a file
+ $installer::globals::followme_from_directory = 0;
}
elsif ( -d $installer::globals::followmeinfofilename )
{
@@ -309,6 +488,9 @@ sub createproductlist
exit(-1);
}
+ # Saving info, that this is a directory
+ $installer::globals::followme_from_directory = 1;
+
# Collect all possible installation sets
# CWS: All installation sets
# Master: All installation sets with same major, minor and buildid. Additionally using the highest number.
@@ -322,7 +504,7 @@ sub createproductlist
{
my $fullfilename = $installer::globals::followmeinfofilename . $installer::globals::separator . $onefile;
my $installdir = get_property_from_file($fullfilename, "finalinstalldir");
- if (( $installdir ne "" ) && ( -d $installdir )) { push(@infofilelist, $fullfilename); }
+ if (( $installdir ne "" ) && ( -d $installdir )) { push(@infofilelist2, $fullfilename); }
}
}
else
@@ -334,10 +516,18 @@ sub createproductlist
my $fullfilename = $installer::globals::followmeinfofilename . $installer::globals::separator . $onefile;
# Check, if installation set still exists
my $installdir = get_property_from_file($fullfilename, "finalinstalldir");
- if (( $installdir ne "" ) && ( -d $installdir )) { push(@infofilelist, $fullfilename); }
+ if (( $installdir ne "" ) && ( -d $installdir )) { push(@infofilelist2, $fullfilename); }
}
- }
+ }
+ # Removing all files, starting with "follow_me_success_" in their names. This have already been used successfully.
+
+ foreach my $onefile ( @infofilelist2 )
+ {
+ if ( $onefile =~ /follow_me_success_/ ) { next; }
+ push(@infofilelist, $onefile);
+ }
+
# Checking, if there is content in the list
if ( ! ( $#infofilelist > -1 ))
{
@@ -374,4 +564,26 @@ sub logfollowmeinfohash
foreach my $key ( sort keys %{$followmehash->{'allvariableshash'}} ) { print "allvariableshash: $key : $followmehash->{'allvariableshash'}->{$key}\n"; }
}
+########################################################################
+# Renaming the follow me info file, if it was successfully used.
+# This can only be done, if the parameter "-d" was used with a
+# directory, not a name. In this case the repeated use of parameter
+# "-d" with this directory has to ignore this already successfully
+# used file.
+########################################################################
+
+sub rename_followme_infofile
+{
+ my ( $filename ) = @_;
+
+ my $newfilename = $filename;
+ $newfilename =~ s/follow_me_/follow_me_success_/; # including "_success" after "follow_me"
+
+ if ( $filename ne $newfilename )
+ {
+ my $returnvalue = rename($filename, $newfilename);
+ if ( $returnvalue ) { installer::logger::print_message( "\n... renamed file \"$filename\" to \"$newfilename\" ...\n" ); }
+ }
+}
+
1;
diff --git a/solenv/bin/modules/installer/followme.pm b/solenv/bin/modules/installer/followme.pm
index a38d40f..179d56a 100644
--- a/solenv/bin/modules/installer/followme.pm
+++ b/solenv/bin/modules/installer/followme.pm
@@ -144,13 +144,25 @@ sub read_followme_info
my $line = ${$filecontent}[$i];
if ( $line =~ /^\s*finalinstalldir:\s*(.*?)\s*$/ ) { $finalinstalldir = $1; }
+ if( $^O =~ /cygwin/i ) { $finalinstalldir =~ s/\\/\//; }
+ if (( $^O =~ /MSWin/i ) && ( $ENV{'USE_SHELL'} eq "4nt" )) { $finalinstalldir =~ s/\//\\/; }
if ( $line =~ /^\s*downloadname:\s*(.*?)\s*$/ ) { $downloadname = $1; }
if ( $line =~ /^\s*currentinstallnumber:\s*(.*?)\s*$/ ) { $currentinstallnumber = $1; }
if ( $line =~ /^\s*loggingdir:\s*(.*?)\s*$/ ) { $loggingdir = $1; }
+ if( $^O =~ /cygwin/i ) { $loggingdir =~ s/\\/\//; }
+ if (( $^O =~ /MSWin/i ) && ( $ENV{'USE_SHELL'} eq "4nt" )) { $loggingdir =~ s/\//\\/; }
if ( $line =~ /^\s*installlogdir:\s*(.*?)\s*$/ ) { $installlogdir = $1; }
+ if( $^O =~ /cygwin/i ) { $installlogdir =~ s/\\/\//; }
+ if (( $^O =~ /MSWin/i ) && ( $ENV{'USE_SHELL'} eq "4nt" )) { $installlogdir =~ s/\//\\/; }
if ( $line =~ /^\s*languagestring:\s*(.*?)\s*$/ ) { $languagestring = $1; }
if ( $line =~ /^\s*languagesarray:\s*(.*?)\s*$/ ) { push(@languagesarray, $1); }
- if ( $line =~ /^\s*includepatharray:\s*(.*?)\s*$/ ) { push(@includepatharray, $1 . "\n"); }
+ if ( $line =~ /^\s*includepatharray:\s*(.*?)\s*$/ )
+ {
+ my $path = $1;
+ if( $^O =~ /cygwin/i ) { $path =~ s/\\/\//; }
+ if (( $^O =~ /MSWin/i ) && ( $ENV{'USE_SHELL'} eq "4nt" )) { $path =~ s/\//\\/; }
+ push(@includepatharray, $path . "\n");
+ }
if ( $line =~ /^\s*allvariableshash:\s*(.*?)\s*:\s*(.*?)\s*$/ ) { $allvariableshash{$1} = $2; }
if ( $line =~ /^\s*globals:(.*?)\s*:\s*(.*?)\s*$/ )
{
@@ -176,8 +188,14 @@ sub read_followme_info
if ( $name eq "issolaris" ) { $installer::globals::issolaris = $value; }
if ( $name eq "islinux" ) { $installer::globals::islinux = $value; }
if ( $name eq "unpackpath" ) { $installer::globals::unpackpath = $value; }
+ if( $^O =~ /cygwin/i ) { $installer::globals::unpackpath =~ s/\\/\//; }
+ if (( $^O =~ /MSWin/i ) && ( $ENV{'USE_SHELL'} eq "4nt" )) { $installer::globals::unpackpath =~ s/\//\\/; }
if ( $name eq "idttemplatepath" ) { $installer::globals::idttemplatepath = $value; }
+ if( $^O =~ /cygwin/i ) { $installer::globals::idttemplatepath =~ s/\\/\//; }
+ if (( $^O =~ /MSWin/i ) && ( $ENV{'USE_SHELL'} eq "4nt" )) { $installer::globals::idttemplatepath =~ s/\//\\/; }
if ( $name eq "idtlanguagepath" ) { $installer::globals::idtlanguagepath = $value; }
+ if( $^O =~ /cygwin/i ) { $installer::globals::idtlanguagepath =~ s/\\/\//; }
+ if (( $^O =~ /MSWin/i ) && ( $ENV{'USE_SHELL'} eq "4nt" )) { $installer::globals::idtlanguagepath =~ s/\//\\/; }
if ( $name eq "logfilename" ) { $installer::globals::logfilename = $value; }
if ( $name eq "product" ) { $installer::globals::product = $value; }
if ( $name eq "patch" ) { $installer::globals::patch = $value; }
diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm
index f82f708..f8b126a 100644
--- a/solenv/bin/modules/installer/globals.pm
+++ b/solenv/bin/modules/installer/globals.pm
@@ -240,6 +240,11 @@ BEGIN
$exitlog = "";
$globalinfo_copied = 0;
$quiet = 0;
+ $nodownload = 0;
+ $writetotemp = 0;
+ $useminor = 0;
+ $followme_from_directory = 0;
+ $internal_cabinet_signing = 0;
$debug = 0;
$debugfilename = "debug.txt";
@@ -328,6 +333,7 @@ BEGIN
$patch = 0;
$patchincludepath = "";
$refresh_includepathes = 0;
+ $include_pathes_read = 0;
$patchfilelistname = "patchfilelist.txt";
@patchfilecollector = ();
$nopatchfilecollector = "";
@@ -357,6 +363,7 @@ BEGIN
$uredirgid = "";
$sundirgid = "";
+ %sign_extensions = ("dll" => "1", "exe" => "1", "cab" => "1");
%treestyles = ("UREDIRECTORY" => "INSTALLURE", "BASISDIRECTORY" => "INSTALLBASIS", "OFFICEDIRECTORY" => "INSTALLOFFICE");
%installlocations = ("INSTALLLOCATION" => "1", "BASISINSTALLLOCATION" => "1", "OFFICEINSTALLLOCATION" => "1", "UREINSTALLLOCATION" => "1");
%treelayername = ("UREDIRECTORY" => "URE", "BASISDIRECTORY" => "BASIS", "OFFICEDIRECTORY" => "BRAND");
diff --git a/solenv/bin/modules/installer/windows/idtglobal.pm b/solenv/bin/modules/installer/windows/idtglobal.pm
index 6541ab4..81f6130 100644
--- a/solenv/bin/modules/installer/windows/idtglobal.pm
+++ b/solenv/bin/modules/installer/windows/idtglobal.pm
@@ -1381,7 +1381,7 @@ sub add_custom_action_to_install_table
my $line = $actionname . "\t" . $actioncondition . "\t" . $actionposition . "\n";
push(@{$installtable}, $line);
- $infoline = "Added $actionname CustomAction into table $customactionidttablename (NO_FILE has been set)\n";
+ $infoline = "Added $actionname CustomAction into table $installtablename (NO_FILE has been set)\n";
push(@installer::globals::logfileinfo, $infoline);
return;
}
diff --git a/solenv/bin/modules/installer/windows/sign.pm b/solenv/bin/modules/installer/windows/sign.pm
index db20412..bd48139 100644
--- a/solenv/bin/modules/installer/windows/sign.pm
+++ b/solenv/bin/modules/installer/windows/sign.pm
@@ -125,6 +125,11 @@ sub check_system_path
# Windows : "msicert.exe", "msidb.exe", "signtool.exe"
my @needed_files_in_path = ("msicert.exe", "msidb.exe", "signtool.exe");
+ if ( $installer::globals::internal_cabinet_signing )
+ {
+ push(@needed_files_in_path, "cabarc.exe");
+ push(@needed_files_in_path, "makecab.exe");
+ }
my $onefile;
my $error = 0;
@@ -195,6 +200,82 @@ sub make_systemcall
return $success;
}
+######################################################
+# Making systemcall with warning
+######################################################
+
+sub make_systemcall_with_warning
+{
+ my ($systemcall, $displaysystemcall) = @_;
+
+ installer::logger::print_message( "... $displaysystemcall ...\n" );
+
+ my $success = 1;
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $displaysystemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "WARNING: Could not execute \"$displaysystemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $success = 0;
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$displaysystemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $success;
+}
+
+######################################################
+# Making systemcall with more return data
+######################################################
+
+sub execute_open_system_call
+{
+ my ( $systemcall ) = @_;
+
+ my @openoutput = ();
+ my $success = 1;
+
+ my $comspec = $ENV{COMSPEC};
+ $comspec = $comspec . " -c ";
+
+ if( $^O =~ /cygwin/i )
+ {
+ # $comspec =~ s/\\/\\\\/g;
+ # $comspec = qx{cygpath -u "$comspec"};
+ # $comspec =~ s/\s*$//g;
+ $comspec = "";
+ }
+
+ my $localsystemcall = "$comspec $systemcall 2>&1 |";
+
+ open( OPN, "$localsystemcall") or warn "Can't execute $localsystemcall\n";
+ while (<OPN>) { push(@openoutput, $_); }
+ close (OPN);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $success = 0;
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return ($success, \@openoutput);
+}
+
########################################################
# Reading first line of pw file.
########################################################
@@ -257,7 +338,7 @@ sub analyze_media_file
# Collect all DiskIds from database table "Media".
########################################################
-sub collect_diskid
+sub collect_diskid_from_media_table
{
my ($msidatabase, $languagestring) = @_;
@@ -267,7 +348,7 @@ sub collect_diskid
# Reading tables
my $filename = $workdir . $installer::globals::separator . "Media.idt";
- if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find required file: $filename !", "collect_diskid"); }
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find required file: $filename !", "collect_diskid_from_media_table"); }
my $filecontent = installer::files::read_file($filename);
my $diskidhash = analyze_media_file($filecontent);
@@ -275,6 +356,34 @@ sub collect_diskid
}
########################################################
+# Check, if this installation set contains
+# internal cabinet files included into the msi
+# database.
+########################################################
+
+sub check_for_internal_cabfiles
+{
+ my ($cabfilehash) = @_;
+
+ my $contains_internal_cabfiles = 0;
+ my %allcabfileshash = ();
+
+ foreach my $filename ( keys %{$cabfilehash} )
+ {
+ if ( $filename =~ /^\s*\#/ ) # starting with a hash
+ {
+ $contains_internal_cabfiles = 1;
+ # setting real filename without hash as key and name with hash as value
+ my $realfilename = $filename;
+ $realfilename =~ s/^\s*\#//;
+ $allcabfileshash{$realfilename} = $filename;
+ }
+ }
+
+ return ( $contains_internal_cabfiles, \%allcabfileshash );
+}
+
+########################################################
# Collecting all files in an installation set.
########################################################
@@ -291,20 +400,19 @@ sub analyze_installset_content
my %allcabfileshash = ();
my %allmsidatabaseshash = ();
my %allfileshash = ();
- my $contains_cab_file = 0;
+ my $contains_external_cabfiles = 0;
my $msidatabase = "";
+ my $contains_msidatabase = 0;
for ( my $j = 0; $j <= $#sourcefiles; $j++ )
{
if ( $sourcefiles[$j] =~ /\.cab\s*$/ ) { $allcabfileshash{$sourcefiles[$j]} = 1; }
else
{
- if ( $sourcefiles[$j] =~ /instmsi\w+.exe\s*$/ ) { next; } # no signing of instmsia.exe and instmsiw.exe
- if ( $sourcefiles[$j] =~ /vcredist_x86\.exe\s*$/ ) { next; } # no signing of vcredist_x86.exe
- if ( $sourcefiles[$j] =~ /jre[-\w]+.exe\s*$/ ) { next; } # no signing of java executable
if ( $sourcefiles[$j] =~ /\.txt\s*$/ ) { next; }
if ( $sourcefiles[$j] =~ /\.html\s*$/ ) { next; }
if ( $sourcefiles[$j] =~ /\.ini\s*$/ ) { next; }
+ if ( $sourcefiles[$j] =~ /\.bmp\s*$/ ) { next; }
if ( $sourcefiles[$j] =~ /\.msi\s*$/ )
{
if ( $msidatabase eq "" ) { $msidatabase = $sourcefiles[$j]; }
@@ -316,12 +424,14 @@ sub analyze_installset_content
# Is there at least one cab file in the installation set?
my $cabcounter = get_hash_count(\%allcabfileshash);
- if ( $cabcounter > 0 ) { $contains_cab_file = 1; }
+ if ( $cabcounter > 0 ) { $contains_external_cabfiles = 1; }
# How about a cab file without a msi database?
if (( $cabcounter > 0 ) && ( $msidatabase eq "" )) { installer::exiter::exit_program("ERROR: There is no msi database in the installation set, but an external cabinet file. Path: $installsetpath !", "collect_installset_content"); }
- return (\%allcabfileshash, \%allfileshash, $msidatabase, $contains_cab_file);
+ if ( $msidatabase ne "" ) { $contains_msidatabase = 1; }
+
+ return (\%allcabfileshash, \%allfileshash, $msidatabase, $contains_external_cabfiles, $contains_msidatabase);
}
########################################################
@@ -331,17 +441,17 @@ sub analyze_installset_content
sub msicert_database
{
- my ($msidatabase, $allcabfiles, $languagestring) = @_;
-
- # exclude media table from msi database and get all diskids.
- my $cabfilehash = collect_diskid($msidatabase, $languagestring);
-
+ my ($msidatabase, $allcabfiles, $cabfilehash, $internalcabfile) = @_;
+
my $fullsuccess = 1;
-
+
foreach my $cabfile ( keys %{$allcabfiles} )
{
- if ( ! exists($cabfilehash->{$cabfile}) ) { installer::exiter::exit_program("ERROR: Could not determine DiskId from media table for cabinet file \"$cabfile\" !", "msicert_database"); }
- my $diskid = $cabfilehash->{$cabfile};
+ my $mediacabfilename = $cabfile;
+ if ( $internalcabfile ) { $mediacabfilename = "\#" . $mediacabfilename; }
+ if ( ! exists($cabfilehash->{$mediacabfilename}) ) { installer::exiter::exit_program("ERROR: Could not determine DiskId from media table for cabinet file \"$cabfile\" !", "msicert_database"); }
+ my $diskid = $cabfilehash->{$mediacabfilename};
+
my $systemcall = "msicert.exe -d $msidatabase -m $diskid -c $cabfile -h";
$success = make_systemcall($systemcall, $systemcall);
if ( ! $success ) { $fullsuccess = 0; }
@@ -356,36 +466,453 @@ sub msicert_database
sub sign_files
{
- my ( $followmeinfohash, $allfiles, $pw ) = @_;
+ my ( $followmeinfohash, $allfiles, $pw, $cabinternal ) = @_;
my $infoline = "";
my $fullsuccess = 1;
+ my $maxcounter = 3;
my $productname = "";
if ( $followmeinfohash->{'allvariableshash'}->{'PRODUCTNAME'} ) { $productname = "/d " . "\"$followmeinfohash->{'allvariableshash'}->{'PRODUCTNAME'}\""; }
my $url = "";
- if ( $followmeinfohash->{'allvariableshash'}->{'OPENSOURCE'} == 0 ) { $url = "/du " . "\"http://www.sun.com\""; }
+ if (( ! exists($followmeinfohash->{'allvariableshash'}->{'OPENSOURCE'}) ) || ( $followmeinfohash->{'allvariableshash'}->{'OPENSOURCE'} == 0 )) { $url = "/du " . "\"http://www.sun.com\""; }
else { $url = "/du " . "\"http://www.openoffice.org\""; }
my $timestampurl = "http://timestamp.verisign.com/scripts/timestamp.dll";
-
- foreach my $onefile ( keys %{$allfiles} )
+
+ my $pfxfilepath = $installer::globals::pfxfile;
+
+ if( $^O =~ /cygwin/i )
{
- my $systemcall = "signtool.exe sign /f \"$installer::globals::pfxfile\" /p $pw $productname $url /t \"$timestampurl\" \"$onefile\"";
- my $displaysystemcall = "signtool.exe sign /f \"$installer::globals::pfxfile\" /p ***** $productname $url /t \"$timestampurl\" \"$onefile\"";
- my $success = make_systemcall($systemcall, $displaysystemcall);
- if ( ! $success ) { $fullsuccess = 0; }
+ $pfxfilepath = qx{cygpath -w "$pfxfilepath"};
+ $pfxfilepath =~ s/\\/\\\\/g;
+ $pfxfilepath =~ s/\s*$//g;
+ }
+
+ foreach my $onefile ( reverse sort keys %{$allfiles} )
+ {
+ if ( already_certified($onefile) )
+ {
+ $infoline = "Already certified: Skipping file $onefile\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ next;
+ }
+
+ my $counter = 1;
+ my $success = 0;
+
+ while (( $counter <= $maxcounter ) && ( ! $success ))
+ {
+ if ( $counter > 1 ) { installer::logger::print_message( "\n\n... repeating file $onefile ...\n" ); }
+ if ( $cabinternal ) { installer::logger::print_message(" Signing: $onefile\n"); }
+ my $systemcall = "signtool.exe sign /f \"$pfxfilepath\" /p $pw $productname $url /t \"$timestampurl\" \"$onefile\"";
+ my $displaysystemcall = "signtool.exe sign /f \"$pfxfilepath\" /p ***** $productname $url /t \"$timestampurl\" \"$onefile\"";
+ $success = make_systemcall_with_warning($systemcall, $displaysystemcall);
+ $counter++;
+ }
+
+ if ( ! $success )
+ {
+ $fullsuccess = 0;
+ installer::exiter::exit_program("ERROR: Could not sign file: $onefile!", "sign_files");
+ }
}
return $fullsuccess;
}
+##########################################################################
+# Lines in ddf files must not contain more than 256 characters
+##########################################################################
+
+sub check_ddf_file
+{
+ my ( $ddffile, $ddffilename ) = @_;
+
+ my $maxlength = 0;
+ my $maxline = 0;
+ my $linelength = 0;
+ my $linenumber = 0;
+
+ for ( my $i = 0; $i <= $#{$ddffile}; $i++ )
+ {
+ my $oneline = ${$ddffile}[$i];
+
+ $linelength = length($oneline);
+ $linenumber = $i + 1;
+
+ if ( $linelength > 256 )
+ {
+ installer::exiter::exit_program("ERROR \"$ddffilename\" line $linenumber: Lines in ddf files must not contain more than 256 characters!", "check_ddf_file");
+ }
+
+ if ( $linelength > $maxlength )
+ {
+ $maxlength = $linelength;
+ $maxline = $linenumber;
+ }
+ }
+
+ my $infoline = "Check of ddf file \"$ddffilename\": Maximum length \"$maxlength\" in line \"$maxline\" (allowed line length: 256 characters)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+#################################################################
+# Setting the path, where the cab files are unpacked.
+#################################################################
+
+sub get_cab_path
+{
+ my ($temppath) = @_;
+
+ my $cabpath = "cabs_" . $$;
+ $cabpath = $temppath . $installer::globals::separator . $cabpath;
+ if ( ! -d $cabpath ) { installer::systemactions::create_directory($cabpath); }
+
+ return $cabpath;
+}
+
+#################################################################
+# Exclude all cab files from the msi database.
+#################################################################
+
+sub extract_cabs_from_database
+{
+ my ($msidatabase, $allcabfiles) = @_;
+
+ installer::logger::include_header_into_logfile("Extracting cabs from msi database");
+
+ my $infoline = "";
+ my $fullsuccess = 1;
+ my $msidb = "msidb.exe"; # Has to be in the path
+
+ if ( $ENV{'USE_SHELL'} ne "4nt" ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $msidatabase =~ s/\//\\\\/g;
+ }
+
+ foreach my $onefile ( keys %{$allcabfiles} )
+ {
+ my $systemcall = $msidb . " -d " . $msidatabase . " -x " . $onefile;
+ my $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { $fullsuccess = 0; }
+
+ # and removing the stream from the database
+ $systemcall = $msidb . " -d " . $msidatabase . " -k " . $onefile;
+ $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { $fullsuccess = 0; }
+ }
+
+ return $fullsuccess;
+}
+
+#################################################################
+# Include cab files into the msi database.
+#################################################################
+
+sub include_cabs_into_database
+{
+ my ($msidatabase, $allcabfiles) = @_;
+
+ installer::logger::include_header_into_logfile("Including cabs into msi database");
+
+ my $infoline = "";
+ my $fullsuccess = 1;
+ my $msidb = "msidb.exe"; # Has to be in the path
+
+ if ( $ENV{'USE_SHELL'} ne "4nt" ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $msidatabase =~ s/\//\\\\/g;
+ }
+
+ foreach my $onefile ( keys %{$allcabfiles} )
+ {
+ my $systemcall = $msidb . " -d " . $msidatabase . " -a " . $onefile;
+ my $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { $fullsuccess = 0; }
+ }
+
+ return $fullsuccess;
+}
+
+########################################################
+# Reading the order of the files inside the
+# cabinet files.
+########################################################
+
+sub read_cab_file
+{
+ my ($cabfilename) = @_;
+
+ installer::logger::print_message( "\n... reading cabinet file $cabfilename ...\n" );
+ my $infoline = "Reading cabinet file $cabfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $systemcall = "cabarc.exe" . " L " . $cabfilename;
+ push(@logfile, "$systemcall\n");
+
+ my ($success, $fileorder) = execute_open_system_call($systemcall);
+
+ my @allfiles = ();
+
+ for ( my $i = 0; $i <= $#{$fileorder}; $i++ )
+ {
+ my $line = ${$fileorder}[$i];
+ if ( $line =~ /^\s*(.*?)\s+\d+\s+\d+\/\d+\/\d+\s+\d+\:\d+\:\d+\s+[\w-]+\s*$/ )
+ {
+ my $filename = $1;
+ push(@allfiles, $filename);
+ }
+ }
+
+ return \@allfiles;
+}
+
+########################################################
+# Unpacking a cabinet file.
+########################################################
+
+sub unpack_cab_file
+{
+ my ($cabfilename, $temppath) = @_;
+
+ installer::logger::print_message( "\n... unpacking cabinet file $cabfilename ...\n" );
+ my $infoline = "Unpacking cabinet file $cabfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $dirname = $cabfilename;
+ $dirname =~ s/\.cab\s*$//;
+ my $workingpath = $temppath . $installer::globals::separator . "unpack_". $dirname . "_" . $$;
+ if ( ! -d $workingpath ) { installer::systemactions::create_directory($workingpath); }
+
+ # changing into unpack directory
+ my $from = cwd();
+ chdir($workingpath);
+
+ my $fullcabfilename = $from . $installer::globals::separator . $cabfilename;
+
+ if( $^O =~ /cygwin/i )
+ {
+ $fullcabfilename = qx{cygpath -w "$fullcabfilename"};
+ $fullcabfilename =~ s/\\/\\\\/g;
+ $fullcabfilename =~ s/\s*$//g;
+ }
+
+ my $systemcall = "cabarc.exe" . " -p X " . $fullcabfilename;
+ $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { installer::exiter::exit_program("ERROR: Could not unpack cabinet file: $fullcabfilename!", "unpack_cab_file"); }
+
+ # returning to directory
+ chdir($from);
+
+ return $workingpath;
+}
+
+########################################################
+# Returning the header of a ddf file.
+########################################################
+
+sub get_ddf_file_header
+{
+ my ($ddffileref, $cabinetfile, $installdir) = @_;
+
+ my $oneline;
+ my $compressionlevel = 2;
+
+ if( $^O =~ /cygwin/i )
+ {
+ $installdir = qx{cygpath -w "$installdir"};
+ $installdir =~ s/\s*$//g;
+ }
+
+ $oneline = ".Set CabinetName1=" . $cabinetfile . "\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set ReservePerCabinetSize=128\n"; # This reserves space for a digital signature.
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set MaxDiskSize=CDROM\n"; # This allows the .cab file to be as large as needed.
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set CompressionType=LZX\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set Compress=ON\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set CompressionLevel=$compressionlevel\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set Cabinet=ON\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set DiskDirectoryTemplate=" . $installdir . "\n";
+ push(@{$ddffileref} ,$oneline);
+}
+
+########################################################
+# Writing content into ddf file.
+########################################################
+
+sub put_all_files_into_ddffile
+{
+ my ($ddffile, $allfiles, $workingpath) = @_;
+
+ $workingpath =~ s/\//\\/g;
+
+ for ( my $i = 0; $i <= $#{$allfiles}; $i++ )
+ {
+ my $filename = ${$allfiles}[$i];
+ if( $^O =~ /cygwin/i ) { $filename =~ s/\//\\/g; } # Backslash for Cygwin!
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find file: $filename!", "put_all_files_into_ddffile"); }
+ my $infoline = "\"" . $filename . "\"" . " " . ${$allfiles}[$i] . "\n";
+ push( @{$ddffile}, $infoline);
+ }
+}
+
+########################################################
+# Packing a cabinet file.
+########################################################
+
+sub do_pack_cab_file
+{
+ my ($cabfilename, $allfiles, $workingpath, $temppath) = @_;
+
+ installer::logger::print_message( "\n... packing cabinet file $cabfilename ...\n" );
+ my $infoline = "Packing cabinet file $cabfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( -f $cabfilename ) { unlink($cabfilename); } # removing cab file
+ if ( -f $cabfilename ) { installer::exiter::exit_program("ERROR: Failed to remove file: $cabfilename!", "do_pack_cab_file"); }
+
+ # generate ddf file for makecab.exe
+ my @ddffile = ();
+
+ my $dirname = $cabfilename;
+ $dirname =~ s/\.cab\s*$//;
+ my $ddfpath = $temppath . $installer::globals::separator . "ddf_". $dirname . "_" . $$;
+
+ my $ddffilename = $cabfilename;
+ $ddffilename =~ s/.cab/.ddf/;
+ $ddffilename = $ddfpath . $installer::globals::separator . $ddffilename;
+
+ if ( ! -d $ddfpath ) { installer::systemactions::create_directory($ddfpath); }
+
+ my $from = cwd();
+
+ chdir($workingpath); # changing into the directory with the unpacked files
+
+ get_ddf_file_header(\@ddffile, $cabfilename, $from);
+ put_all_files_into_ddffile(\@ddffile, $allfiles, $workingpath);
+ # lines in ddf files must not be longer than 256 characters
+ check_ddf_file(\@ddffile, $ddffilename);
+
+ installer::files::save_file($ddffilename, \@ddffile);
+
+ if( $^O =~ /cygwin/i )
+ {
+ $ddffilename = qx{cygpath -w "$ddffilename"};
+ $ddffilename =~ s/\\/\\\\/g;
+ $ddffilename =~ s/\s*$//g;
+ }
+
+ my $systemcall = "makecab.exe /V1 /F " . $ddffilename;
+ my $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { installer::exiter::exit_program("ERROR: Could not pack cabinet file!", "do_pack_cab_file"); }
+
+ chdir($from);
+
+ return ($success);
+}
+
+########################################################
+# Extraction the file extension from a file
+########################################################
+
+sub get_extension
+{
+ my ( $file ) = @_;
+
+ my $extension = "";
+
+ if ( $file =~ /^\s*(.*)\.(\w+?)\s*$/ ) { $extension = $2; }
+
+ return $extension;
+}
+
+########################################################
+# Checking, if a file already contains a certificate.
+# This must not be overwritten.
+########################################################
+
+sub already_certified
+{
+ my ( $filename ) = @_;
+
+ my $success = 1;
+ my $is_certified = 0;
+
+ my $systemcall = "signtool.exe verify /q /pa \"$filename\"";
+ my $returnvalue = system($systemcall);
+
+ if ( $returnvalue ) { $success = 0; }
+
+ # my $success = make_systemcall($systemcall, $systemcall);
+
+ if ( $success )
+ {
+ $is_certified = 1;
+ installer::logger::print_message( "... already certified -> skipping $filename ...\n" );
+ }
+
+ return $is_certified;
+}
+
+########################################################
+# Signing the files, that are included into
+# cabinet files.
+########################################################
+
+sub sign_files_in_cabinet_files
+{
+ my ( $followmeinfohash, $allcabfiles, $pw, $temppath ) = @_;
+
+ my $complete_success = 1;
+ my $from = cwd();
+
+ foreach my $cabfilename ( keys %{$allcabfiles} )
+ {
+ my $success = 1;
+
+ # saving order of files in cab file
+ my $fileorder = read_cab_file($cabfilename);
+
+ # unpack into $working path
+ my $workingpath = unpack_cab_file($cabfilename, $temppath);
+
+ chdir($workingpath);
+
+ # sign files
+ my %allfileshash = ();
+ foreach my $onefile ( @{$fileorder} )
+ {
+ my $extension = get_extension($onefile);
+ if ( exists( $installer::globals::sign_extensions{$extension} ) )
+ {
+ $allfileshash{$onefile} = 1;
+ }
+ }
+ $success = sign_files($followmeinfohash, \%allfileshash, $pw, 1);
+ if ( ! $success ) { $complete_success = 0; }
+
+ chdir($from);
+
+ # pack into new directory
+ do_pack_cab_file($cabfilename, $fileorder, $workingpath, $temppath);
+ }
+
+ return $complete_success;
+}
+
########################################################
# Signing an existing Windows installation set.
########################################################
sub sign_install_set
{
- my ($followmeinfohash, $make_copy) = @_;
+ my ($followmeinfohash, $make_copy, $temppath) = @_;
my $installsetpath = $followmeinfohash->{'finalinstalldir'};
@@ -408,24 +935,66 @@ sub sign_install_set
else { $installsetpath = rename_install_set($installsetpath); }
# collecting all files in the installation set
- my ($allcabfiles, $allfiles, $msidatabase, $contains_cab_file) = analyze_installset_content($installsetpath);
+ my ($allcabfiles, $allfiles, $msidatabase, $contains_external_cabfiles, $contains_msidatabase) = analyze_installset_content($installsetpath);
# changing into installation set
my $from = cwd();
+ my $fullmsidatabase = $installsetpath . $installer::globals::separator . $msidatabase;
+
+ if( $^O =~ /cygwin/i )
+ {
+ $fullmsidatabase = qx{cygpath -w "$fullmsidatabase"};
+ $fullmsidatabase =~ s/\\/\\\\/g;
+ $fullmsidatabase =~ s/\s*$//g;
+ }
+
chdir($installsetpath);
- # Warning: There might be a problem with very big cabinet files
- # signing all external cab files first
- if ( $contains_cab_file )
+ if ( $contains_msidatabase )
{
- $success = sign_files($followmeinfohash, $allcabfiles, $pw);
- if ( ! $success ) { $complete_success = 0; }
- $success = msicert_database($msidatabase, $allcabfiles, $followmeinfohash->{'languagestring'});
- if ( ! $success ) { $complete_success = 0; }
+ # exclude media table from msi database and get all diskids.
+ my $cabfilehash = collect_diskid_from_media_table($msidatabase, $followmeinfohash->{'languagestring'});
+
+ # Check, if there are internal cab files
+ my ( $contains_internal_cabfiles, $all_internal_cab_files) = check_for_internal_cabfiles($cabfilehash);
+
+ if ( $contains_internal_cabfiles )
+ {
+ my $cabpath = get_cab_path($temppath);
+ chdir($cabpath);
+
+ # Exclude all cabinet files from database
+ $success = extract_cabs_from_database($fullmsidatabase, $all_internal_cab_files);
+ if ( ! $success ) { $complete_success = 0; }
+
+ if ( $installer::globals::internal_cabinet_signing ) { sign_files_in_cabinet_files($followmeinfohash, $all_internal_cab_files, $pw, $temppath); }
+
+ $success = sign_files($followmeinfohash, $all_internal_cab_files, $pw, 0);
+ if ( ! $success ) { $complete_success = 0; }
+ $success = msicert_database($fullmsidatabase, $all_internal_cab_files, $cabfilehash, 1);
+ if ( ! $success ) { $complete_success = 0; }
+
+ # Include all cabinet files into database
+ $success = include_cabs_into_database($fullmsidatabase, $all_internal_cab_files);
+ if ( ! $success ) { $complete_success = 0; }
+ chdir($installsetpath);
+ }
+
+ # Warning: There might be a problem with very big cabinet files
+ # signing all external cab files first
+ if ( $contains_external_cabfiles )
+ {
+ if ( $installer::globals::internal_cabinet_signing ) { sign_files_in_cabinet_files($followmeinfohash, $allcabfiles, $pw, $temppath); }
+
+ $success = sign_files($followmeinfohash, $allcabfiles, $pw, 0);
+ if ( ! $success ) { $complete_success = 0; }
+ $success = msicert_database($msidatabase, $allcabfiles, $cabfilehash, 0);
+ if ( ! $success ) { $complete_success = 0; }
+ }
}
# finally all other files can be signed
- $success = sign_files($followmeinfohash, $allfiles, $pw);
+ $success = sign_files($followmeinfohash, $allfiles, $pw, 0);
if ( ! $success ) { $complete_success = 0; }
# and changing back
diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm
index 4080c7f..6a91e57 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -2398,6 +2398,8 @@ sub collect_all_files_from_includepathes
}
}
+ $installer::globals::include_pathes_read = 1;
+
installer::logger::globallog("Reading all directories: End");
push( @installer::globals::globallogfileinfo, "\n");
}
More information about the ooo-build-commit
mailing list