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