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