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