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::control; 29 30use Cwd; 31use installer::converter; 32use installer::exiter; 33use installer::files; 34use installer::globals; 35use installer::pathanalyzer; 36use installer::scriptitems; 37use installer::systemactions; 38 39######################################################### 40# Function that can be used for additional controls. 41# Search happens in $installer::globals::patharray. 42######################################################### 43 44sub check_needed_files_in_path 45{ 46 my ( $filesref ) = @_; 47 48 foreach $onefile ( @{$filesref} ) 49 { 50 installer::logger::print_message( "...... searching $onefile ..." ); 51 52 my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$onefile, $installer::globals::patharray , 0); 53 54 if ( $$fileref eq "" ) 55 { 56 $error = 1; 57 installer::logger::print_error( "$onefile not found\n" ); 58 } 59 else 60 { 61 installer::logger::print_message( "\tFound: $$fileref\n" ); 62 } 63 } 64 65 if ( $error ) 66 { 67 installer::exiter::exit_program("ERROR: Could not find all needed files in path!", "check_needed_files_in_path"); 68 } 69} 70 71######################################################### 72# Checking the local system 73# Checking existence of needed files in include path 74######################################################### 75 76sub check_system_path 77{ 78 # The following files have to be found in the environment variable PATH 79 # All platforms: zip 80 # Windows only: msvcp70.dll, msvcr70.dll for regcomp.exe 81 # Windows only: "msiinfo.exe", "msidb.exe", "uuidgen.exe", "makecab.exe", "msitran.exe", "expand.exe" for msi database and packaging 82 83 my $onefile; 84 my $error = 0; 85 my $pathvariable = $ENV{'PATH'}; 86 my $local_pathseparator = $installer::globals::pathseparator; 87 88 if( $^O =~ /cygwin/i ) 89 { # When using cygwin's perl the PATH variable is POSIX style and ... 90 $pathvariable = qx{cygpath -mp "$pathvariable"} ; 91 # has to be converted to DOS style for further use. 92 $local_pathseparator = ';'; 93 } 94 my $patharrayref = installer::converter::convert_stringlist_into_array(\$pathvariable, $local_pathseparator); 95 96 $installer::globals::patharray = $patharrayref; 97 98 my @needed_files_in_path = (); 99 100 if (($installer::globals::iswin) && ($installer::globals::iswindowsbuild)) 101 { 102 @needed_files_in_path = ("zip.exe", "msiinfo.exe", "msidb.exe", "uuidgen.exe", "makecab.exe", "msitran.exe", "expand.exe"); 103 104 if ( $installer::globals::compiler eq "wntmsci8" ) 105 { 106 push(@needed_files_in_path, "msvcp70.dll"); 107 push(@needed_files_in_path, "msvcr70.dll"); 108 } 109 110 if ( $installer::globals::compiler eq "wntmsci10" ) 111 { 112 push(@needed_files_in_path, "msvcp71.dll"); 113 push(@needed_files_in_path, "msvcr71.dll"); 114 } 115 116 } 117 elsif ($installer::globals::iswin) 118 { 119 @needed_files_in_path = ("zip.exe"); 120 } 121 else 122 { 123 @needed_files_in_path = ("zip"); 124 } 125 126 foreach $onefile ( @needed_files_in_path ) 127 { 128 installer::logger::print_message( "...... searching $onefile ..." ); 129 130 my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$onefile, $patharrayref , 0); 131 132 if ( $$fileref eq "" ) 133 { 134 $error = 1; 135 installer::logger::print_error( "$onefile not found\n" ); 136 } 137 else 138 { 139 installer::logger::print_message( "\tFound: $$fileref\n" ); 140 # Saving the absolut path for msitran.exe. This is required for the determination of the checksum. 141 if ( $onefile eq "msitran.exe" ) { $installer::globals::msitranpath = $$fileref; } 142 } 143 } 144 145 if ( $error ) 146 { 147 installer::exiter::exit_program("ERROR: Could not find all needed files in path!", "check_system_path"); 148 } 149 150 # checking for epm, which has to be in the path or in the solver 151 152 if (( $installer::globals::call_epm ) && (!($installer::globals::iswindowsbuild))) 153 { 154 my $onefile = "epm"; 155 my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$onefile, $patharrayref , 0); 156 if (!( $$fileref eq "" )) 157 { 158 $installer::globals::epm_in_path = 1; 159 160 if ( $$fileref =~ /^\s*\.\/epm\s*$/ ) 161 { 162 my $currentdir = cwd(); 163 $$fileref =~ s/\./$currentdir/; 164 } 165 166 $installer::globals::epm_path = $$fileref; 167 } 168 } 169 170 # checking, if upx can be found in path 171 172 if ( $installer::globals::iswindowsbuild ) { $installer::globals::upxfile = "upx.exe"; } 173 else { $installer::globals::upxfile = "upx"; } 174 175 my $upxfilename = $installer::globals::upxfile; 176 my $upxfileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$upxfilename, $patharrayref , 0); 177 178 if (!( $$upxfileref eq "" )) 179 { 180 $installer::globals::upx_in_path = 1; 181 $installer::globals::upxfile = $$upxfileref; 182 installer::logger::print_message( "\tFound: $$upxfileref\n" ); 183 } 184 185} 186 187###################################################################### 188# Determining the version of file makecab.exe 189###################################################################### 190 191sub get_makecab_version 192{ 193 my $makecabversion = -1; 194 195 my $systemcall = "makecab.exe |"; 196 my @makecaboutput = (); 197 198 open (CAB, $systemcall); 199 while (<CAB>) { push(@makecaboutput, $_); } 200 close (CAB); 201 202 my $returnvalue = $?; # $? contains the return value of the systemcall 203 204 if ($returnvalue) 205 { 206 $infoline = "ERROR: Could not execute \"$systemcall\"!\n"; 207 push( @installer::globals::globallogfileinfo, $infoline); 208 } 209 else 210 { 211 $infoline = "Success: Executed \"$systemcall\" successfully!\n"; 212 push( @installer::globals::globallogfileinfo, $infoline); 213 214 my $versionline = ""; 215 216 for ( my $i = 0; $i <= $#makecaboutput; $i++ ) 217 { 218 if ( $makecaboutput[$i] =~ /\bVersion\b/i ) 219 { 220 $versionline = $makecaboutput[$i]; 221 last; 222 } 223 } 224 225 $infoline = $versionline; 226 push( @installer::globals::globallogfileinfo, $infoline); 227 228 if ( $versionline =~ /\bVersion\b\s+(\d+[\d\.]+\d+)\s+/ ) 229 { 230 $makecabversion = $1; 231 } 232 233 # Only using the first number 234 235 if ( $makecabversion =~ /^\s*(\d+?)\D*/ ) 236 { 237 $makecabversion = $1; 238 } 239 240 $infoline = "Using version: " . $makecabversion . "\n"; 241 push( @installer::globals::globallogfileinfo, $infoline); 242 } 243 244 return $makecabversion; 245} 246 247###################################################################### 248# Checking the version of file makecab.exe 249###################################################################### 250 251sub check_makecab_version 252{ 253 # checking version of makecab.exe 254 # Now it is guaranteed, that makecab.exe is in the path 255 256 my $do_check = 1; 257 258 my $makecabversion = get_makecab_version(); 259 260 my $infoline = "Tested version: " . $installer::globals::controlledmakecabversion . "\n"; 261 push( @installer::globals::globallogfileinfo, $infoline); 262 263 if ( $makecabversion < 0 ) { $do_check = 0; } # version could not be determined 264 265 if ( $do_check ) 266 { 267 if ( $makecabversion < $installer::globals::controlledmakecabversion ) 268 { 269 # warning for OOo, error for inhouse products 270 if ( $installer::globals::isopensourceproduct ) 271 { 272 installer::logger::print_warning("Old version of makecab.exe. Found version: \"$makecabversion\", tested version: \"$installer::globals::controlledmakecabversion\"!\n"); 273 } 274 else 275 { 276 installer::exiter::exit_program("makecab.exe too old. Found version: \"$makecabversion\", required version: \"$installer::globals::controlledmakecabversion\"!", "check_makecab_version"); 277 } 278 } 279 } 280 else 281 { 282 $infoline = "Warning: No version check of makecab.exe\n"; 283 push( @installer::globals::globallogfileinfo, $infoline); 284 } 285} 286 287###################################################################### 288# Reading the environment variables for the pathes in ziplist. 289# solarpath, solarenvpath, solarcommonpath, os, osdef, pmiscpath 290###################################################################### 291 292sub check_system_environment 293{ 294 my %variables = (); 295 my $key; 296 my $error = 0; 297 298 foreach $key ( @installer::globals::environmentvariables ) 299 { 300 my $value = ""; 301 if ( $ENV{$key} ) { $value = $ENV{$key}; } 302 $variables{$key} = $value; 303 304 if ( $value eq "" ) 305 { 306 installer::logger::print_error( "$key not set in environment\n" ); 307 $error = 1; 308 } 309 } 310 311 if ( $error ) 312 { 313 installer::exiter::exit_program("ERROR: Environment variable not set!", "check_system_environment"); 314 } 315 316 return \%variables; 317} 318 319############################################################# 320# Controlling the log file at the end of the 321# packaging process 322############################################################# 323 324sub check_logfile 325{ 326 my ($logfile) = @_; 327 328 my @errors = (); 329 my @output = (); 330 my $contains_error = 0; 331 332 my $ignore_error = 0; 333 my $make_error_to_warning = 0; 334 335 if (( ! $installer::globals::pro ) && ( $installer::globals::ignore_error_in_logfile )) { $ignore_error = 1; } 336 337 for ( my $i = 0; $i <= $#{$logfile}; $i++ ) 338 { 339 my $line = ${$logfile}[$i]; 340 341 # Errors are all errors, but not the Windows installer table "Error.idt" 342 343 my $compareline = $line; 344 $compareline =~ s/Error\.idt//g; # removing all occurences of "Error.idt" 345 $compareline =~ s/Error\.mlf//g; # removing all occurences of "Error.mlf" 346 $compareline =~ s/Error\.ulf//g; # removing all occurences of "Error.ulf" 347 $compareline =~ s/Error\.idl//g; # removing all occurences of "Error.idl" 348 $compareline =~ s/Error\.html//g; # removing all occurences of "Error.html" 349 350 if ( $compareline =~ /\bError\b/i ) 351 { 352 $contains_error = 1; 353 push(@errors, $line); 354 355 if ( $ignore_error ) 356 { 357 $contains_error = 0; 358 $make_error_to_warning = 1; 359 } 360 } 361 } 362 363 if ($contains_error) 364 { 365 my $line = "\n*********************************************************************\n"; 366 push(@output, $line); 367 $line = "ERROR: The following errors occured in packaging process:\n\n"; 368 push(@output, $line); 369 370 for ( my $i = 0; $i <= $#errors; $i++ ) 371 { 372 $line = "$errors[$i]"; 373 push(@output, $line); 374 } 375 376 $line = "*********************************************************************\n"; 377 push(@output, $line); 378# exit(-1); 379 } 380 else 381 { 382 my $line = ""; 383 384 if ( $make_error_to_warning ) 385 { 386 $line = "\n*********************************************************************\n"; 387 push(@output, $line); 388 $line = "The following errors in the log file were ignored:\n\n"; 389 push(@output, $line); 390 391 for ( my $i = 0; $i <= $#errors; $i++ ) 392 { 393 $line = "$errors[$i]"; 394 push(@output, $line); 395 } 396 397 $line = "*********************************************************************\n"; 398 push(@output, $line); 399 } 400 401 $line = "\n***********************************************************\n"; 402 push(@output, $line); 403 $line = "Successful packaging process!\n"; 404 push(@output, $line); 405 $line = "***********************************************************\n"; 406 push(@output, $line); 407 } 408 409 # printing the output file and adding it to the logfile 410 411 installer::logger::include_header_into_logfile("Summary:"); 412 413 my $force = 1; # print this message even in 'quiet' mode 414 for ( my $i = 0; $i <= $#output; $i++ ) 415 { 416 my $line = "$output[$i]"; 417 installer::logger::print_message( "$line", $force ); 418 push( @installer::globals::logfileinfo, $line); 419 push( @installer::globals::errorlogfileinfo, $line); 420 } 421 422 return $contains_error; 423} 424 425############################################################# 426# Determining the ship installation directory 427############################################################# 428 429sub determine_ship_directory 430{ 431 my ($languagesref) = @_; 432 433 if (!( $ENV{'SHIPDRIVE'} )) { installer::exiter::exit_program("ERROR: SHIPDRIVE must be set for updater!", "determine_ship_directory"); } 434 435 my $shipdrive = $ENV{'SHIPDRIVE'}; 436 437 my $languagestring = $$languagesref; 438 439 if (length($languagestring) > $installer::globals::max_lang_length ) 440 { 441 my $number_of_languages = installer::systemactions::get_number_of_langs($languagestring); 442 chomp(my $shorter = `echo $languagestring | md5sum | sed -e "s/ .*//g"`); 443 # $languagestring = $shorter; 444 my $id = substr($shorter, 0, 8); # taking only the first 8 digits 445 $languagestring = "lang_" . $number_of_languages . "_id_" . $id; 446 } 447 448 my $productstring = $installer::globals::product; 449 my $productsubdir = ""; 450 451 if ( $productstring =~ /^\s*(.+?)\_\_(.+?)\s*$/ ) 452 { 453 $productstring = $1; 454 $productsubdir = $2; 455 } 456 457 if ( $installer::globals::languagepack ) { $productstring = $productstring . "_languagepack"; } 458 if ( $installer::globals::patch ) { $productstring = $productstring . "_patch"; } 459 460 my $destdir = $shipdrive . $installer::globals::separator . $installer::globals::compiler . 461 $installer::globals::productextension . $installer::globals::separator . 462 $productstring . $installer::globals::separator; 463 464 if ( $productsubdir ) { $destdir = $destdir . $productsubdir . $installer::globals::separator; } 465 466 $destdir = $destdir . $installer::globals::installertypedir . $installer::globals::separator . 467 $installer::globals::build . "_" . $installer::globals::lastminor . "_" . 468 "native_inprogress-number_" . $languagestring . "\." . $installer::globals::buildid; 469 470 my $infoline = "\nSetting ship directory: $destdir\n"; 471 push(@installer::globals::globallogfileinfo, $infoline); 472 473 return $destdir; 474} 475 476############################################################# 477# Controlling if this is an official RE pack process 478############################################################# 479 480sub check_updatepack 481{ 482 my $shipdrive = ""; 483 my $filename = ""; 484 my $infoline = ""; 485 486 if ( $ENV{'UPDATER'} ) # the environment variable UPDATER has to be set 487 { 488 $infoline = "\nEnvironment variable UPDATER set\n"; 489 push(@installer::globals::globallogfileinfo, $infoline); 490 491 if ( ! $ENV{'CWS_WORK_STAMP'} ) # the environment variable CWS_WORK_STAMP must not be set (set only in CWS) 492 { 493 $infoline = "Environment variable CWS_WORK_STAMP not set\n"; 494 push(@installer::globals::globallogfileinfo, $infoline); 495 496 if ( $ENV{'SHIPDRIVE'} ) # the environment variable SHIPDRIVE must be set 497 { 498 $shipdrive = $ENV{'SHIPDRIVE'}; 499 $infoline = "Ship drive defined: $shipdrive\n"; 500 push(@installer::globals::globallogfileinfo, $infoline); 501 502 if ( -d $shipdrive ) # SHIPDRIVE must be a directory 503 { 504 $infoline = "Ship drive exists\n"; 505 push(@installer::globals::globallogfileinfo, $infoline); 506 507 # try to write into $shipdrive 508 509 $directory = $installer::globals::product . "_" . $installer::globals::compiler . "_" . $installer::globals::buildid . "_" . $installer::globals::languageproducts[0] . "_test_$$"; 510 $directory =~ s/\,/\_/g; # for the list of languages 511 $directory =~ s/\-/\_/g; # for en-US, pt-BR, ... 512 $directory = $shipdrive . $installer::globals::separator . $directory; 513 514 $infoline = "Try to create directory: $directory\n"; 515 push(@installer::globals::globallogfileinfo, $infoline); 516 517 # saving this directory for later removal 518 $installer::globals::shiptestdirectory = $directory; 519 520 if ( installer::systemactions::try_to_create_directory($directory)) 521 { 522 $infoline = "Write access on Ship drive\n"; 523 push(@installer::globals::globallogfileinfo, $infoline); 524 $infoline = "Ship test directory $installer::globals::shiptestdirectory was successfully created\n"; 525 push(@installer::globals::globallogfileinfo, $infoline); 526 my $systemcall = "rmdir $directory"; 527 my $returnvalue = system($systemcall); 528 529 # 5th condition: No local build environment. 530 # In this case the content of SOLARENV starts with the content of SOL_TMP 531 532 my $solarenv = ""; 533 my $sol_tmp; 534 if ( $ENV{'SOLARENV'} ) { $solarenv = $ENV{'SOLARENV'}; } 535 536 $infoline = "Environment variable SOLARENV: $solarenv\n"; 537 push(@installer::globals::globallogfileinfo, $infoline); 538 539 if ( $ENV{'SOL_TMP'} ) 540 { 541 $sol_tmp = $ENV{'SOL_TMP'}; 542 $infoline = "Environment variable SOL_TMP: $sol_tmp\n"; 543 } else { 544 $infoline = "Environment variable SOL_TMP not set\n"; 545 } 546 push(@installer::globals::globallogfileinfo, $infoline); 547 548 if ( defined $sol_tmp && ( $solarenv =~ /^\s*\Q$sol_tmp\E/ )) 549 { 550 $infoline = "Content of SOLARENV starts with the content of SOL_TMP\: Local environment -\> No Updatepack\n"; 551 push(@installer::globals::globallogfileinfo, $infoline); 552 } 553 else 554 { 555 $infoline = "Content of SOLARENV does not start with the content of SOL_TMP: No local environment\n"; 556 push(@installer::globals::globallogfileinfo, $infoline); 557 558 $installer::globals::updatepack = 1; # That's it 559 } 560 561 # Additional logging information for the temporary ship directory 562 563 if ( -d $installer::globals::shiptestdirectory ) 564 { 565 $infoline = "Ship test directory $installer::globals::shiptestdirectory still exists. Trying removal later again.\n"; 566 push(@installer::globals::globallogfileinfo, $infoline); 567 } 568 else 569 { 570 $infoline = "Ship test directory $installer::globals::shiptestdirectory was successfully removed.\n"; 571 push(@installer::globals::globallogfileinfo, $infoline); 572 } 573 } 574 else 575 { 576 $infoline = "No write access on Ship drive\n"; 577 push(@installer::globals::globallogfileinfo, $infoline); 578 $infoline = "Failed to create directory $directory\n"; 579 push(@installer::globals::globallogfileinfo, $infoline); 580 if ( defined $ENV{'BSCLIENT'} && ( uc $ENV{'BSCLIENT'} eq 'TRUE' ) ) { 581 installer::exiter::exit_program("ERROR: No write access to SHIPDRIVE allthough BSCLIENT is set.", "check_updatepack"); 582 } 583 } 584 } 585 else 586 { 587 $infoline = "Ship drive not found: No updatepack\n"; 588 push(@installer::globals::globallogfileinfo, $infoline); 589 } 590 } 591 else 592 { 593 $infoline = "Environment variable SHIPDRIVE not set: No updatepack\n"; 594 push(@installer::globals::globallogfileinfo, $infoline); 595 } 596 } 597 else 598 { 599 $infoline = "Environment variable CWS_WORK_STAMP defined: No updatepack\n"; 600 push(@installer::globals::globallogfileinfo, $infoline); 601 } 602 } 603 604 if ( $installer::globals::updatepack ) { $infoline = "Setting updatepack true\n\n"; } 605 else { $infoline = "\nNo updatepack\n"; } 606 push(@installer::globals::globallogfileinfo, $infoline); 607 608} 609 610############################################################# 611# Reading the Windows list file for language encodings 612############################################################# 613 614sub read_encodinglist 615{ 616 my ($patharrayref) = @_; 617 618 my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$installer::globals::encodinglistname, $patharrayref , 0); 619 620 if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Did not find Windows encoding list $installer::globals::encodinglistname!", "read_encodinglist"); } 621 622 my $infoline = "Found encoding file: $$fileref\n"; 623 push(@installer::globals::globallogfileinfo, $infoline); 624 625 my $encodinglist = installer::files::read_file($$fileref); 626 627 my %msiencoding = (); 628 my %msilanguage = (); 629 630 # Controlling the encoding list 631 632 for ( my $i = 0; $i <= $#{$encodinglist}; $i++ ) 633 { 634 my $line = ${$encodinglist}[$i]; 635 636 if ( $line =~ /^\s*\#/ ) { next; } # this is a comment line 637 638 if ( $line =~ /^(.*?)(\#.*)$/ ) { $line = $1; } # removing comments after "#" 639 640 if ( $line =~ /^\s*([\w-]+)\s*(\d+)\s*(\d+)\s*$/ ) 641 { 642 my $onelanguage = $1; 643 my $codepage = $2; 644 my $windowslanguage = $3; 645 646 $msiencoding{$onelanguage} = $codepage; 647 $msilanguage{$onelanguage} = $windowslanguage; 648 } 649 else 650 { 651 installer::exiter::exit_program("ERROR: Wrong syntax in Windows encoding list $installer::globals::encodinglistname : en-US 1252 1033 !", "read_encodinglist"); 652 } 653 } 654 655 $installer::globals::msiencoding = \%msiencoding; 656 $installer::globals::msilanguage = \%msilanguage; 657 658 # my $key; 659 # foreach $key (keys %{$installer::globals::msiencoding}) { print "A Key: $key : Value: $installer::globals::msiencoding->{$key}\n"; } 660 # foreach $key (keys %{$installer::globals::msilanguage}) { print "B Key: $key : Value: $installer::globals::msilanguage->{$key}\n"; } 661 662} 663 664############################################################# 665# Only for Windows and Linux (RPM)there is currently 666# a reliable mechanism to register extensions during 667# installation process. Therefore it is for all other 668# platforms forbidden to install oxt files into that 669# directory, in which they are searched for registration. 670############################################################# 671 672sub check_oxtfiles 673{ 674 my ( $filesarray ) = @_; 675 676 for ( my $i = 0; $i <= $#{$filesarray}; $i++ ) 677 { 678 my $onefile = ${$filesarray}[$i]; 679 680 if (( $onefile->{'Name'} ) && ( $onefile->{'Dir'} )) 681 { 682 if (( $onefile->{'Name'} =~ /\.oxt\s*$/ ) && ( $onefile->{'Dir'} eq $installer::globals::extensioninstalldir )) 683 { 684 installer::exiter::exit_program("There is currently only for Linux (RPM) and Windows a reliable mechanism to register extensions during installation.\nPlease remove file \"$onefile->{'gid'}\" from your installation set!\nYou can use \"\#ifdef WNT\" and \"\#ifdef LINUX\" in scp.", "check_oxtfiles"); 685 } 686 } 687 } 688} 689 690############################################################# 691# Check if Java is available to create xpd installer 692############################################################# 693 694sub check_java_for_xpd 695{ 696 my ( $allvariables ) = @_; 697 698 if ( ! $installer::globals::solarjavaset ) { $allvariables->{'XPDINSTALLER'} = 0; } 699} 700 701#################################################################### 702# Setting global variable "$installer::globals::addchildprojects" 703#################################################################### 704 705sub set_addchildprojects 706{ 707 my ($allvariables) = @_; 708 709 if (( $allvariables->{'JAVAPRODUCT'} ) || 710 ( $allvariables->{'ADAPRODUCT'} ) || 711 ( $allvariables->{'UREPRODUCT'} ) || 712 ( $allvariables->{'ADDREQUIREDPACKAGES'} )) { $installer::globals::addchildprojects = 1; } 713 714 if ( $installer::globals::patch ) 715 { 716 $installer::globals::addchildprojects = 0; # no child projects for patches 717 } 718 719 my $infoline = "Value of \$installer::globals::addchildprojects: $installer::globals::addchildprojects\n"; 720 push( @installer::globals::globallogfileinfo, $infoline); 721} 722 723#################################################################### 724# Setting global variable "$installer::globals::addjavainstaller" 725#################################################################### 726 727sub set_addjavainstaller 728{ 729 my ($allvariables) = @_; 730 731 if ( $allvariables->{'JAVAINSTALLER'} ) { $installer::globals::addjavainstaller = 1; } 732 733 if ( $installer::globals::patch ) { $installer::globals::addjavainstaller = 0; } 734 if ( $installer::globals::languagepack ) { $installer::globals::addjavainstaller = 0; } 735 if ( $allvariableshashref->{'XPDINSTALLER'} ) { $installer::globals::addjavainstaller = 0; } 736 737 my $infoline = "Value of \$installer::globals::addjavainstaller: $installer::globals::addjavainstaller\n"; 738 push( @installer::globals::globallogfileinfo, $infoline); 739} 740 741####################################################################### 742# Setting global variable "$installer::globals::addsystemintegration" 743####################################################################### 744 745sub set_addsystemintegration 746{ 747 my ($allvariables) = @_; 748 749 if ( $allvariables->{'ADDSYSTEMINTEGRATION'} ) { $installer::globals::addsystemintegration = 1; } 750 751 if ( $installer::globals::patch ) { $installer::globals::addsystemintegration = 0; } 752 if ( $installer::globals::languagepack ) { $installer::globals::addsystemintegration = 0; } 753 if (( $installer::globals::packageformat eq "native" ) || ( $installer::globals::packageformat eq "portable" )) { $installer::globals::addsystemintegration = 0; } 754 755 my $infoline = "Value of \$installer::globals::addsystemintegration: $installer::globals::addsystemintegration\n"; 756 push( @installer::globals::globallogfileinfo, $infoline); 757} 758 7591; 760