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