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