xref: /aoo41x/main/solenv/bin/make_installer.pl (revision f3c13b8d)
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
24#################
25# use
26#################
27
28use lib ("$ENV{SOLARENV}/bin/modules");
29
30use Cwd;
31use File::Copy;
32use installer::archivefiles;
33use installer::control;
34use installer::converter;
35use installer::copyproject;
36use installer::download;
37use installer::environment;
38use installer::epmfile;
39use installer::exiter;
40use installer::files;
41use installer::followme;
42use installer::globals;
43use installer::javainstaller;
44use installer::languagepack;
45use installer::languages;
46use installer::logger;
47use installer::mail;
48use installer::packagelist;
49use installer::packagepool;
50use installer::parameter;
51use installer::pathanalyzer;
52use installer::profiles;
53use installer::scppatchsoname;
54use installer::scpzipfiles;
55use installer::scriptitems;
56use installer::setupscript;
57use installer::simplepackage;
58use installer::sorter;
59use installer::strip;
60use installer::substfilenamefiles;
61use installer::upx;
62use installer::systemactions;
63use installer::windows::assembly;
64use installer::windows::binary;
65use installer::windows::component;
66use installer::windows::createfolder;
67use installer::windows::directory;
68use installer::windows::feature;
69use installer::windows::featurecomponent;
70use installer::windows::file;
71use installer::windows::font;
72use installer::windows::icon;
73use installer::windows::idtglobal;
74use installer::windows::inifile;
75use installer::windows::java;
76use installer::windows::media;
77use installer::windows::msiglobal;
78use installer::windows::patch;
79use installer::windows::property;
80use installer::windows::removefile;
81use installer::windows::registry;
82use installer::windows::selfreg;
83use installer::windows::shortcut;
84use installer::windows::strip;
85use installer::windows::upgrade;
86use installer::worker;
87use installer::xpdinstaller;
88use installer::ziplist;
89use installer::patch::InstallationSet;
90use installer::patch::Msi;
91use strict;
92
93
94sub GetSetupScriptLines ($$$)
95{
96    my ($allsettingsarrayref, $allvariableshashref, $includepatharrayref) = @_;
97
98    if ($installer::globals::setupscript_defined_in_productlist)
99    {
100        installer::setupscript::set_setupscript_name($allsettingsarrayref, $includepatharrayref);
101    }
102
103    $installer::logger::Info->print( "... analyzing script: $installer::globals::setupscriptname ... \n" );
104    installer::logger::globallog("setup script file: $installer::globals::setupscriptname");
105    $installer::logger::Info->print( "... analyzing script: $installer::globals::setupscriptname ... \n" );
106
107    # Reading the setup script file
108    my $setupscriptref = installer::files::read_file($installer::globals::setupscriptname);
109
110    # Resolving variables defined in the zip list file into setup
111    # script.  All the variables are defined in $allvariablesarrayref
112    installer::scpzipfiles::replace_all_ziplistvariables_in_file($setupscriptref, $allvariableshashref);
113
114    # Resolving %variables defined in the installation object
115    my $allscriptvariablesref = installer::setupscript::get_all_scriptvariables_from_installation_object(
116        $setupscriptref,
117        $installer::globals::setupscriptname);
118    installer::setupscript::add_lowercase_productname_setupscriptvariable($allscriptvariablesref);
119    installer::setupscript::resolve_lowercase_productname_setupscriptvariable($allscriptvariablesref);
120
121    $setupscriptref = installer::setupscript::replace_all_setupscriptvariables_in_script(
122        $setupscriptref,
123        $allscriptvariablesref);
124
125    # Adding all variables defined in the installation object into the
126    # hash of all variables.  This is needed if variables are defined
127    # in the installation object, but not in the zip list file.  If
128    # there is a definition in the zip list file and in the
129    # installation object, the installation object is more important
130    installer::setupscript::add_installationobject_to_variables($allvariableshashref, $allscriptvariablesref);
131
132    # Adding also all variables, that must be included into the $allvariableshashref.
133    installer::setupscript::add_forced_properties($allvariableshashref);
134
135    # Replacing preset properties, not using the default mechanisms (for example for UNIXPRODUCTNAME)
136    installer::setupscript::replace_preset_properties($allvariableshashref);
137
138    # We did this already.  Can this or the other one be removed.
139    installer::scpzipfiles::replace_all_ziplistvariables_in_file($setupscriptref, $allvariableshashref);
140
141    return $setupscriptref;
142}
143
144
145
146=head2 MakeWindowsBuild (...)
147
148	Create an MSI installation set for Windows that is based on IDT tables.
149
150=cut
151sub MakeWindowsBuild ($$$$$$$$$$$$$$$$$$$$)
152{
153    my (
154        $allvariableshashref,
155        $allsettingsarrayref,
156        $current_install_number,
157        $directoriesforepmarrayref,
158        $filesinproductlanguageresolvedarrayref,
159        $folderitemsinproductlanguageresolvedarrayref,
160        $includepatharrayref,
161        $includepatharrayref_lang,
162        $installdir,
163        $languagesarrayref,
164        $languagestringref,
165        $linksinproductlanguageresolvedarrayref,
166        $loggingdir,
167        $modulesinproductlanguageresolvedarrayref,
168        $packages,
169        $profileitemsinproductlanguageresolvedarrayref,
170        $registryitemsinproductlanguageresolvedarrayref,
171        $shipinstalldir,
172        $windowscustomactionsarrayref,
173        $folderinproductlanguageresolvedarrayref) = @_;
174
175    ###########################################
176    # Stripping libraries
177    ###########################################
178
179    # Building for gcc build in cws requires, that all files are stripped before packaging:
180    # 1. copy all files that need to be stripped locally
181    # 2. strip all these files
182
183    if ( $installer::globals::compiler =~ /wntgcci/ )
184    {
185        installer::windows::strip::strip_binaries($filesinproductlanguageresolvedarrayref, $languagestringref);
186    }
187
188    $installdir = installer::worker::create_installation_directory($shipinstalldir, $languagestringref, \$current_install_number);
189
190    my $idtdirbase = installer::systemactions::create_directories("idt_files", $languagestringref);
191    $installer::globals::infodirectory = installer::systemactions::create_directories("info_files", $languagestringref);
192    my $installlogdir = installer::systemactions::create_directory_next_to_directory($installdir, "log");
193    # my $installchecksumdir = installer::systemactions::create_directory_next_to_directory($installdir, "checksum");
194
195    #################################################################################
196    # Preparing cabinet files from package definitions
197    #################################################################################
198
199    # installer::packagelist::prepare_cabinet_files($packages, $allvariableshashref, $$languagestringref);
200    installer::packagelist::prepare_cabinet_files($packages, $allvariableshashref);
201    # printing packages content:
202    installer::packagelist::log_cabinet_assignments();
203
204    #################################################################################
205    # Begin of functions that are used for the creation of idt files (Windows only)
206    #################################################################################
207
208    $installer::logger::Info->print( "... creating idt files ...\n" );
209
210    installer::logger::include_header_into_logfile("Creating idt files:");
211
212    my $newidtdir = $idtdirbase . $installer::globals::separator . "00";	# new files into language independent directory "00"
213    installer::systemactions::create_directory($newidtdir);
214
215    # Collecting all files with flag "BINARYTABLE"
216    my $binarytablefiles = installer::worker::collect_all_items_with_special_flag(
217        $filesinproductlanguageresolvedarrayref,
218        "BINARYTABLE");
219
220    # Removing all files with flag "BINARYTABLE_ONLY"
221    @installer::globals::binarytableonlyfiles = ();
222    $filesinproductlanguageresolvedarrayref = installer::worker::remove_all_items_with_special_flag(
223        $filesinproductlanguageresolvedarrayref,
224        "BINARYTABLE_ONLY");
225
226    # Collecting all profileitems with flag "INIFILETABLE" for table "IniFile"
227    my $inifiletableentries = installer::worker::collect_all_items_with_special_flag($profileitemsinproductlanguageresolvedarrayref ,"INIFILETABLE");
228
229    # Creating the important dynamic idt files
230    installer::windows::msiglobal::set_msiproductversion($allvariableshashref);
231    installer::windows::msiglobal::put_msiproductversion_into_bootstrapfile($filesinproductlanguageresolvedarrayref);
232
233    # Add cabinet assignments to files
234    installer::windows::file::assign_cab_to_files($filesinproductlanguageresolvedarrayref);
235    installer::windows::file::assign_sequencenumbers_to_files($filesinproductlanguageresolvedarrayref);
236
237    # Collection all available directory trees
238    installer::windows::directory::collectdirectorytrees($directoriesforepmarrayref);
239
240    $filesinproductlanguageresolvedarrayref = installer::windows::file::filter_files(
241        $filesinproductlanguageresolvedarrayref,
242        $allvariableshashref);
243    installer::windows::file::prepare_file_table_creation(
244        $filesinproductlanguageresolvedarrayref,
245        $directoriesforepmarrayref,
246        $allvariableshashref);
247    my $file_table_data = installer::windows::file::create_file_table_data(
248        $filesinproductlanguageresolvedarrayref,
249        $allvariableshashref);
250    installer::windows::file::create_file_table($file_table_data, $newidtdir);
251    installer::windows::file::create_filehash_table($filesinproductlanguageresolvedarrayref, $newidtdir);
252    my @allfilecomponents = installer::windows::file::collect_components($filesinproductlanguageresolvedarrayref);
253
254
255    installer::windows::directory::prepare_directory_table_creation(
256        $directoriesforepmarrayref,
257        $allvariableshashref);
258    installer::windows::directory::create_directory_table(
259        $directoriesforepmarrayref,
260        $newidtdir,
261        $allvariableshashref);
262
263    # Attention: The table "Registry.idt" contains language specific strings -> parameter: $languagesarrayref !
264    my $registry_table_data = installer::windows::registry::prepare_registry_table(
265        $registryitemsinproductlanguageresolvedarrayref,
266        $languagesarrayref,
267        $allvariableshashref);
268    my @allregistrycomponents = installer::windows::registry::collect_registry_components($registry_table_data);
269
270    my $target_registry_component_translation = installer::windows::component::prepare_component_table_creation(
271        \@allfilecomponents,
272        \@allregistrycomponents,
273        $allvariableshashref);
274
275    @allregistrycomponents = installer::windows::component::apply_component_translation(
276        $target_registry_component_translation,
277        @allregistrycomponents);
278    installer::windows::registry::translate_component_names(
279        $target_registry_component_translation,
280        $registryitemsinproductlanguageresolvedarrayref,
281        $registry_table_data);
282
283    installer::windows::registry::create_registry_table_32(
284        $newidtdir,
285        $languagesarrayref,
286        $allvariableshashref,
287        $registry_table_data);
288    installer::windows::registry::create_registry_table_64(
289        $newidtdir,
290        $languagesarrayref,
291        $allvariableshashref,
292        $registry_table_data);
293
294    my $component_table_data = installer::windows::component::create_component_table_data (
295        $filesinproductlanguageresolvedarrayref,
296        $registryitemsinproductlanguageresolvedarrayref,
297        $directoriesforepmarrayref,
298        \@allfilecomponents,
299        \@allregistrycomponents,
300        $allvariableshashref);
301    installer::windows::component::create_component_table(
302        $component_table_data,
303        $newidtdir);
304
305    # Attention: The table "Feature.idt" contains language specific strings -> parameter: $languagesarrayref !
306    installer::windows::feature::add_uniquekey($modulesinproductlanguageresolvedarrayref);
307    $modulesinproductlanguageresolvedarrayref = installer::windows::feature::sort_feature(
308        $modulesinproductlanguageresolvedarrayref);
309
310	foreach my $onelanguage (@$languagesarrayref)
311	{
312        my $features = installer::windows::feature::prepare_feature_table(
313            $modulesinproductlanguageresolvedarrayref,
314            $onelanguage,
315            $allvariableshashref);
316        $features = installer::windows::feature::add_missing_features($features);
317        installer::windows::feature::create_feature_table(
318            $newidtdir,
319            $onelanguage,
320            $features);
321    }
322
323    installer::windows::featurecomponent::create_featurecomponent_table(
324        $filesinproductlanguageresolvedarrayref,
325        $registryitemsinproductlanguageresolvedarrayref,
326        $newidtdir);
327
328    installer::windows::media::create_media_table(
329        $filesinproductlanguageresolvedarrayref,
330        $newidtdir,
331        $allvariableshashref);
332
333    installer::windows::font::create_font_table(
334        $filesinproductlanguageresolvedarrayref,
335        $newidtdir);
336
337    # Attention: The table "Shortcut.idt" contains language specific strings -> parameter: $languagesarrayref !
338    # Attention: Shortcuts (Folderitems) have icon files, that have to be copied into the Icon directory (last parameter)
339    my @iconfilecollector = ();
340
341    installer::windows::shortcut::create_shortcut_table(
342        $filesinproductlanguageresolvedarrayref,
343        $linksinproductlanguageresolvedarrayref,
344        $folderinproductlanguageresolvedarrayref,
345        $folderitemsinproductlanguageresolvedarrayref,
346        $directoriesforepmarrayref,
347        $newidtdir,
348        $languagesarrayref,
349        $includepatharrayref,
350        \@iconfilecollector);
351
352    installer::windows::inifile::create_inifile_table(
353        $inifiletableentries,
354        $filesinproductlanguageresolvedarrayref,
355        $newidtdir);
356
357    installer::windows::icon::create_icon_table(
358        \@iconfilecollector,
359        $newidtdir);	 # creating the icon table with all iconfiles used as shortcuts (FolderItems)
360
361    installer::windows::createfolder::create_createfolder_table(
362        $directoriesforepmarrayref,
363        $filesinproductlanguageresolvedarrayref,
364        $newidtdir,
365        $allvariableshashref);
366
367    installer::windows::upgrade::create_upgrade_table(
368        $newidtdir,
369        $allvariableshashref);
370
371    if ( ! $installer::globals::languagepack )	 # the following tables not for language packs
372    {
373        installer::windows::removefile::create_removefile_table($folderitemsinproductlanguageresolvedarrayref, $newidtdir);
374
375        installer::windows::selfreg::create_selfreg_table($filesinproductlanguageresolvedarrayref, $newidtdir);
376
377        # Adding Assemblies into the tables MsiAssembly and MsiAssemblyName dynamically
378        installer::windows::assembly::create_msiassembly_table($filesinproductlanguageresolvedarrayref, $newidtdir);
379        installer::windows::assembly::create_msiassemblyname_table($filesinproductlanguageresolvedarrayref, $newidtdir);
380        installer::windows::assembly::add_assembly_condition_into_component_table($filesinproductlanguageresolvedarrayref, $newidtdir);
381    }
382
383    $installer::logger::Lang->print("\n");
384
385    # Localizing the language dependent idt files
386    # For every language there will be a localized msi database
387    # For multilingual installation sets, the differences of this
388    # databases have to be stored in transforms.
389
390    for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ )
391    {
392        my $onelanguage = ${$languagesarrayref}[$m];
393
394        my $is_bidi = 0;
395        if ( installer::existence::exists_in_array($onelanguage, \@installer::globals::bidilanguages) ) { $is_bidi = 1; }
396
397        my $languageidtdir = $idtdirbase . $installer::globals::separator . $onelanguage;
398        if ( -d $languageidtdir ) { installer::systemactions::remove_complete_directory($languageidtdir, 1); }
399        installer::systemactions::create_directory($languageidtdir);
400
401        # Copy the template idt files and the new created idt files into this language directory
402
403        $installer::logger::Info->print( "... copying idt files ...\n" );
404
405        installer::logger::include_header_into_logfile("Copying idt files to $languageidtdir:");
406
407        installer::windows::idtglobal::prepare_language_idt_directory(
408            $languageidtdir,
409            $newidtdir,
410            $onelanguage,
411            $filesinproductlanguageresolvedarrayref,
412            \@iconfilecollector,
413            $binarytablefiles,
414            $allvariableshashref);
415
416        if (( ! $installer::globals::languagepack ) && ( ! $allvariableshashref->{'NOLANGUAGESELECTIONPRODUCT'} ))
417        {
418            # For multilingual installation sets, the dialog for the language selection can now be prepared, with
419            # a checkbox for each available language. This has to happen before the following translation.
420            # The new controls have to be added into the Control.idt
421
422            my $controlidttablename = $languageidtdir . $installer::globals::separator . "Control.idt";
423            my $controlidttable = installer::files::read_file($controlidttablename);
424            installer::windows::idtglobal::add_language_checkboxes_to_database($controlidttable, $languagesarrayref);
425            installer::files::save_file($controlidttablename, $controlidttable);
426            $installer::logger::Lang->printf("Added checkboxes for language selection dialog into table %s\n",
427                $controlidttablename);
428        }
429
430        # Now all files are copied into a language specific directory
431        # The template idt files can be translated
432
433        $installer::logger::Info->print( "... localizing idt files (language: $onelanguage) ...\n" );
434
435        installer::logger::include_header_into_logfile("Localizing idt files (Language: $onelanguage):");
436
437        my @translationfiles = ();			# all idt files, that need a translation
438        push(@translationfiles, "ActionTe.idt");
439        push(@translationfiles, "Control.idt");
440        push(@translationfiles, "CustomAc.idt");
441        push(@translationfiles, "Error.idt");
442        push(@translationfiles, "LaunchCo.idt");
443        push(@translationfiles, "RadioBut.idt");
444        push(@translationfiles, "Property.idt");
445        push(@translationfiles, "UIText.idt");
446
447        my $oneidtfilename;
448        my $oneidtfile;
449
450        foreach $oneidtfilename (@translationfiles)
451        {
452            my $languagefilename = installer::windows::idtglobal::get_languagefilename($oneidtfilename, $installer::globals::idtlanguagepath);
453            my $languagefile = installer::files::read_file($languagefilename);
454
455            $oneidtfilename = $languageidtdir . $installer::globals::separator . $oneidtfilename;
456            $oneidtfile = installer::files::read_file($oneidtfilename);
457
458            # Now the substitution can start
459            installer::windows::idtglobal::translate_idtfile($oneidtfile, $languagefile, $onelanguage);
460
461            installer::files::save_file($oneidtfilename, $oneidtfile);
462
463            $installer::logger::Lang->printf("Translated idt file: %s into language %s\n",
464                $oneidtfilename,
465                $onelanguage);
466            $installer::logger::Lang->printf("Used languagefile: %s\n", $languagefilename);
467        }
468
469        # setting the encoding in every table (replacing WINDOWSENCODINGTEMPLATE)
470
471        installer::windows::idtglobal::setencoding($languageidtdir, $onelanguage);
472
473        # setting bidi attributes, if required
474
475        if ( $is_bidi ) { installer::windows::idtglobal::setbidiattributes($languageidtdir, $onelanguage); }
476
477        # setting the encoding in every table (replacing WINDOWSENCODINGTEMPLATE)
478        installer::windows::idtglobal::set_multilanguageonly_condition($languageidtdir);
479
480        # include the license text into the table Control.idt
481
482        if ( ! $allvariableshashref->{'HIDELICENSEDIALOG'} )
483        {
484            my $licensefilesource = installer::windows::idtglobal::get_rtflicensefilesource($onelanguage, $includepatharrayref_lang);
485            my $licensefile = installer::files::read_file($licensefilesource);
486            installer::scpzipfiles::replace_all_ziplistvariables_in_rtffile(
487                $licensefile,
488                $allvariableshashref);
489            my $controltablename = $languageidtdir . $installer::globals::separator . "Control.idt";
490            my $controltable = installer::files::read_file($controltablename);
491            installer::windows::idtglobal::add_licensefile_to_database($licensefile, $controltable);
492            installer::files::save_file($controltablename, $controltable);
493
494            $installer::logger::Lang->printf("Added licensefile %s into database %s\n",
495                $licensefilesource,
496                $controltablename);
497        }
498
499        # include a component into environment table if required
500
501        installer::windows::component::set_component_in_environment_table($languageidtdir, $filesinproductlanguageresolvedarrayref);
502
503        # include the ProductCode and the UpgradeCode from codes-file into the Property.idt
504
505        installer::windows::property::set_codes_in_property_table($languageidtdir);
506
507        # the language specific properties can now be set in the Property.idt
508
509        installer::windows::property::update_property_table($languageidtdir, $onelanguage, $allvariableshashref, $languagestringref);
510
511        # replacing variables in RegLocat.idt
512
513        installer::windows::msiglobal::update_reglocat_table($languageidtdir, $allvariableshashref);
514
515        # replacing variables in RemoveRe.idt (RemoveRegistry.idt)
516
517        installer::windows::msiglobal::update_removere_table($languageidtdir);
518
519        # adding language specific properties for multilingual installation sets
520
521        installer::windows::property::set_languages_in_property_table($languageidtdir, $languagesarrayref);
522
523        # adding settings into CheckBox.idt
524        installer::windows::property::update_checkbox_table($languageidtdir, $allvariableshashref);
525
526        # adding the files from the binary directory into the binary table
527        installer::windows::binary::update_binary_table(
528            $languageidtdir,
529            $filesinproductlanguageresolvedarrayref,
530            $binarytablefiles);
531
532        # setting patch codes to detect installed products
533
534        if (( $installer::globals::patch ) || ( $installer::globals::languagepack ) || ( $allvariableshashref->{'PDFCONVERTER'} )) { installer::windows::patch::update_patch_tables($languageidtdir, $allvariableshashref); }
535
536        # Adding Windows Installer CustomActions
537
538        installer::windows::idtglobal::addcustomactions($languageidtdir, $windowscustomactionsarrayref, $filesinproductlanguageresolvedarrayref);
539
540        # Adding child projects if specified
541
542        if ($installer::globals::addchildprojects)
543        {
544            # Adding child projects to installation dynamically (also in feature table)
545            installer::windows::idtglobal::add_childprojects($languageidtdir, $filesinproductlanguageresolvedarrayref, $allvariableshashref);
546            # setting Java variables for Java products
547            if ( $allvariableshashref->{'JAVAPRODUCT'} ) { installer::windows::java::update_java_tables($languageidtdir, $allvariableshashref); }
548        }
549
550        # Then the language specific msi database can be created
551
552        if ( $installer::globals::iswin )	# only possible on a Windows platform
553        {
554            my $msidatabasename = installer::windows::msiglobal::get_msidatabasename($allvariableshashref, $onelanguage);
555            my $msifilename = $languageidtdir . $installer::globals::separator . $msidatabasename;
556
557            $installer::logger::Info->print( "... creating msi database (language $onelanguage) ... \n" );
558
559            # setting new GUID for the components using the tool uuidgen.exe
560#            installer::windows::msiglobal::set_uuid_into_component_table(
561#                $languageidtdir,
562#                $allvariableshashref);
563
564            installer::windows::msiglobal::prepare_64bit_database($languageidtdir, $allvariableshashref);	# making last 64 bit changes
565            installer::windows::msiglobal::create_msi_database($languageidtdir ,$msifilename);
566
567            # validating the database 	# ToDo
568
569            my $languagefile = installer::files::read_file($installer::globals::idtlanguagepath . $installer::globals::separator . "SIS.mlf");
570            # my $languagefile = installer::files::read_file($installer::globals::idtlanguagepath . $installer::globals::separator . "SIS.ulf");
571
572            installer::windows::msiglobal::write_summary_into_msi_database($msifilename, $onelanguage, $languagefile, $allvariableshashref);
573
574            # copy msi database into installation directory
575
576            my $msidestfilename = $installdir . $installer::globals::separator . $msidatabasename;
577            installer::systemactions::copy_one_file($msifilename, $msidestfilename);
578        }
579    }
580
581    # Creating transforms, if the installation set has more than one language
582    # renaming the msi database and generating the setup.ini file
583
584    my $defaultlanguage = installer::languages::get_default_language($languagesarrayref);
585
586    if ( $installer::globals::iswin )	# only possible on a Windows platform
587    {
588        if  ( $#{$languagesarrayref} > 0 )
589        {
590            installer::windows::msiglobal::create_transforms($languagesarrayref, $defaultlanguage, $installdir, $allvariableshashref);
591        }
592
593        installer::windows::msiglobal::rename_msi_database_in_installset($defaultlanguage, $installdir, $allvariableshashref);
594
595        if ( $allvariableshashref->{'ADDLANGUAGEINDATABASENAME'} ) { installer::windows::msiglobal::add_language_to_msi_database($defaultlanguage, $installdir, $allvariableshashref); }
596
597        $installer::logger::Info->print( "... generating setup.ini ...\n" );
598
599        if ( ! $allvariableshashref->{'NOLOADERREQUIRED'} ) { installer::windows::msiglobal::create_setup_ini($languagesarrayref, $defaultlanguage, $installdir, $allvariableshashref); }
600    }
601
602    # Analyzing the ScpActions and copying the files into the installation set
603    # At least the loader.exe
604
605    $installer::logger::Info->print( "... copying files into installation set ...\n" );
606
607    # installer::windows::msiglobal::copy_scpactions_into_installset($defaultlanguage, $installdir, $scpactionsinproductlanguageresolvedarrayref);
608    installer::worker::put_scpactions_into_installset($installdir);
609
610    # ... copying the setup.exe
611
612    installer::windows::msiglobal::copy_windows_installer_files_into_installset($installdir, $includepatharrayref, $allvariableshashref);
613
614    # ... copying the child projects
615
616    if ($installer::globals::addchildprojects)
617    {
618        installer::windows::msiglobal::copy_child_projects_into_installset($installdir, $allvariableshashref);
619    }
620
621    $installer::logger::Info->print( "... creating ddf files ...\n" );
622
623    # Creating all needed ddf files and generating a list
624    # for the package process containing all system calls
625
626    my $ddfdir = installer::systemactions::create_directories("ddf", $languagestringref);
627
628    $installer::globals::packjobref = installer::windows::msiglobal::generate_cab_file_list($filesinproductlanguageresolvedarrayref, $installdir, $ddfdir, $allvariableshashref);
629
630    $installer::logger::Info->print("\n");
631
632    #######################################################
633    # Finally really create the installation packages,
634    # Only for Windows and only on a windows platform.
635    #######################################################
636
637    if ( $installer::globals::iswin )	# only possible on a Windows platform
638    {
639        $installer::logger::Info->print( "... packaging installation set ... \n" );
640        installer::windows::msiglobal::execute_packaging($installer::globals::packjobref, $loggingdir, $allvariableshashref);
641        if ( $installer::globals::include_cab_in_msi ) { installer::windows::msiglobal::include_cabs_into_msi($installdir); }
642    }
643
644    #######################################################
645    # Analyzing the log file
646    #######################################################
647
648    my $is_success = 0;
649    my $finalinstalldir = "";
650    installer::worker::clean_output_tree();	# removing directories created in the output tree
651    ($is_success, $finalinstalldir) = installer::worker::analyze_and_save_logfile($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
652
653    #######################################################
654    # Creating download installation set
655    #######################################################
656
657    my $create_download = 0;
658    my $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "downloadname");
659    if ( $installer::globals::languagepack ) { $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "langpackdownloadname"); }
660    if ( $installer::globals::patch ) { $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "patchdownloadname"); }
661
662    if ( $is_success ) { installer::followme::save_followme_info($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref, $current_install_number, $loggingdir, $installlogdir); }
663
664    if ( $$downloadname ne "" ) { $create_download = 1; }
665    if (( $is_success ) && ( $create_download ) && ( $ENV{'ENABLE_DOWNLOADSETS'} ))
666    {
667        my $downloaddir = installer::download::create_download_sets($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref);
668        installer::worker::analyze_and_save_logfile($loggingdir, $downloaddir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
669    }
670
671}
672
673
674
675
676=head2 MakeNonWindowsBuild (...)
677
678	Create an installation set for non-windows platforms based on EPM files.
679
680=cut
681sub MakeNonWindowsBuild ($$$$$$$$$$$$$$$)
682{
683    my (
684        $allvariableshashref,
685        $allsettingsarrayref,
686        $current_install_number,
687        $directoriesforepmarrayref,
688        $filesinproductlanguageresolvedarrayref,
689        $includepatharrayref,
690        $languagesarrayref,
691        $languagestringref,
692        $linksinproductlanguageresolvedarrayref,
693        $unixlinksinproductlanguageresolvedarrayref,
694        $loggingdir,
695        $modulesinproductarrayref,
696        $packages,
697        $shipinstalldir,
698        $currentdir
699        ) = @_;
700
701    ####################################################
702    # Creating directories
703    ####################################################
704
705    my $installdir = installer::worker::create_installation_directory($shipinstalldir, $languagestringref, \$current_install_number);
706
707    my $listfiledir = installer::systemactions::create_directories("listfile", $languagestringref);
708    my $installlogdir = installer::systemactions::create_directory_next_to_directory($installdir, "log");
709
710    ####################################################
711    # Reading for Solaris all package descriptions
712    # from file defined in property PACKAGEMAP
713    ####################################################
714
715    if (  $installer::globals::issolarisbuild ) { installer::epmfile::read_packagemap($allvariableshashref, $includepatharrayref, $languagesarrayref); }
716
717    my $epmexecutable = "";
718    my $found_epm = 0;
719
720    # shuffle array to reduce parallel packaging process in pool
721    installer::worker::shuffle_array($packages);
722
723    # iterating over all packages
724    for ( my $k = 0; $k <= $#{$packages}; $k++ )
725    {
726        my $onepackage = ${$packages}[$k];
727
728        # checking, if this is a language pack or a project pack.
729        # Creating language packs only, if $installer::globals::languagepack is set. Parameter: -languagepack
730
731        if ( $installer::globals::languagepack ) { installer::languagepack::replace_languagestring_variable($onepackage, $languagestringref); }
732
733        my $onepackagename = $onepackage->{'module'};			# name of the top module (required)
734
735        my $shellscriptsfilename = "";
736        if ( $onepackage->{'script'} ) { $shellscriptsfilename = $onepackage->{'script'}; }
737        # no scripts for Solaris patches!
738        if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild )) { $shellscriptsfilename = ""; }
739
740        ###########################
741        # package name
742        ###########################
743
744        my $packagename = "";
745
746        if ( $installer::globals::issolarisbuild )	 # only for Solaris
747        {
748            if ( $onepackage->{'solarispackagename'} ) { $packagename = $onepackage->{'solarispackagename'}; }
749        }
750        else # not Solaris
751        {
752            if ( $onepackage->{'packagename'} ) { $packagename = $onepackage->{'packagename'}; }
753        }
754
755        if (!($packagename eq ""))
756        {
757            installer::packagelist::resolve_packagevariables(\$packagename, $allvariableshashref, 0);
758        }
759
760        # Debian allows no underline in package name
761        if ( $installer::globals::debian ) { $packagename =~ s/_/-/g; }
762
763        # Debian allows no underline in package name
764        if ( $installer::globals::debian ) { $packagename =~ s/_/-/g; }
765
766        my $linkaddon = "";
767        my $linkpackage = 0;
768        $installer::globals::add_required_package = "";
769        $installer::globals::linuxlinkrpmprocess = 0;
770
771        if ( $installer::globals::makelinuxlinkrpm )
772        {
773            my $oldpackagename = $packagename;
774            $installer::globals::add_required_package = $oldpackagename;	# the link rpm requires the non-linked version
775            if ( $installer::globals::languagepack ) { $packagename = $packagename . "_u"; }
776            else { $packagename = $packagename . "u"; }
777            my $savestring = $oldpackagename . "\t" . $packagename;
778            push(@installer::globals::linkrpms, $savestring);
779            $linkaddon = "_links";
780            $installer::globals::linuxlinkrpmprocess = 1;
781            $linkpackage = 1;
782        }
783
784        ####################################################
785        # Header for this package into log file
786        ####################################################
787
788        installer::logger::include_header_into_logfile("Creating package: $packagename ($k)");
789
790        ####################################################
791        # Pool check: If package is created at the moment
792        # try it again later.
793        ####################################################
794
795        if (( $installer::globals::patch ) ||
796            ( $installer::globals::languagepack ) ||
797            ( $installer::globals::packageformat eq "native" ) ||
798            ( $installer::globals::packageformat eq "portable" ) ||
799            ( $installer::globals::packageformat eq "osx" )) { $allvariableshashref->{'POOLPRODUCT'} = 0; }
800
801        if ( $allvariableshashref->{'POOLPRODUCT'} )
802        {
803            if ( ! $installer::globals::sessionidset ) { installer::packagepool::set_sessionid(); }
804            if ( ! $installer::globals::poolpathset ) { installer::packagepool::set_pool_path(); }
805            if (( ! $installer::globals::getuidpathset ) && ( $installer::globals::issolarisbuild )) { installer::worker::set_getuid_path($includepatharrayref); }
806
807            my $package_is_creatable = installer::packagepool::check_package_availability($packagename);
808
809            if (( ! $package_is_creatable ) && ( ! exists($installer::globals::poolshiftedpackages{$packagename}) ))
810            {
811                splice(@{$packages}, $k, 1);	# removing package ...
812                push(@{$packages}, $onepackage);  # ... and adding it to the end
813                $installer::globals::poolshiftedpackages{$packagename} = 1;	# only shifting each package once
814                $k--;														# decreasing the counter
815                $installer::logger::Info->printf("Pool: Package \"%s\" cannot be created at the moment. Trying again later (1).\n", $packagename);
816                $installer::logger::Lang->printf("Pool: Package \"%s\" cannot be created at the moment. Trying again later (1).\n", $packagename);
817                next;														# repeating this iteration with new package
818            }
819        }
820
821        ###########################################
822        # Root path, can be defined as parameter
823        ###########################################
824
825        my $packagerootpath = "";
826
827        if ($installer::globals::rootpath eq "")
828        {
829            $packagerootpath = $onepackage->{'destpath'};
830            installer::packagelist::resolve_packagevariables(\$packagerootpath, $allvariableshashref, 1);
831            if ( $^O =~ /darwin/i ) { $packagerootpath =~ s/\/opt\//\/Applications\//; }
832        }
833        else
834        {
835            $packagerootpath = $installer::globals::rootpath;
836        }
837
838        #############################################
839        # copying the collectors for each package
840        #############################################
841
842        my $filesinpackage = installer::converter::copy_collector($filesinproductlanguageresolvedarrayref);
843        my $linksinpackage = installer::converter::copy_collector($linksinproductlanguageresolvedarrayref);
844        my $unixlinksinpackage = installer::converter::copy_collector($unixlinksinproductlanguageresolvedarrayref);
845        my $dirsinpackage = installer::converter::copy_collector($directoriesforepmarrayref);
846
847        ###########################################
848        # setting the root path for the packages
849        ###########################################
850
851        installer::scriptitems::add_rootpath_to_directories($dirsinpackage, $packagerootpath);
852        installer::scriptitems::add_rootpath_to_files($filesinpackage, $packagerootpath);
853        installer::scriptitems::add_rootpath_to_links($linksinpackage, $packagerootpath);
854        installer::scriptitems::add_rootpath_to_files($unixlinksinpackage, $packagerootpath);
855
856        #################################
857        # collecting items for package
858        #################################
859
860        $filesinpackage = installer::packagelist::find_files_for_package($filesinpackage, $onepackage);
861        $unixlinksinpackage = installer::packagelist::find_files_for_package($unixlinksinpackage, $onepackage);
862        $linksinpackage = installer::packagelist::find_links_for_package($linksinpackage, $filesinpackage);
863        $dirsinpackage = installer::packagelist::find_dirs_for_package($dirsinpackage, $onepackage);
864
865        ###############################################
866        # nothing to do, if $filesinpackage is empty
867        ###############################################
868
869        if ( ! ( $#{$filesinpackage} > -1 ))
870        {
871            push(@installer::globals::emptypackages, $packagename);
872            $installer::logger::Lang->print("\n");
873            $installer::logger::Lang->print("\n");
874            $installer::logger::Lang->print("No file in package: %s \-\> Skipping\n\n", $packagename);
875            next;	# next package, end of loop !
876        }
877
878        #################################################################
879        # nothing to do for Linux patches, if no file has flag PATCH
880        #################################################################
881
882        # Linux Patch: The complete RPM has to be built, if one file in the RPM has the flag PATCH (also for DEBs)
883        if (( $installer::globals::patch ) && (( $installer::globals::islinuxrpmbuild ) || ( $installer::globals::islinuxdebbuild )))
884        {
885            my $patchfiles = installer::worker::collect_all_items_with_special_flag($filesinpackage ,"PATCH");
886            if ( ! ( $#{$patchfiles} > -1 ))
887            {
888                $installer::logger::Lang->print("\n");
889                $installer::logger::Lang->print("\n");
890                $installer::logger::Lang->print("Linux Patch: No patch file in package: %s \-\> Skipping\n\n",
891                    $packagename);
892                next;
893            }
894        }
895
896        ###########################################
897        # Stripping libraries
898        ###########################################
899
900        # Building for non Windows platforms in cws requires, that all files are stripped before packaging:
901        # 1. copy all files that need to be stripped locally
902        # 2. strip all these files
903
904        if ( $installer::globals::strip )
905        {
906            installer::strip::strip_libraries($filesinpackage, $languagestringref);
907        }
908
909        ###############################################################
910        # Searching for files in $filesinpackage with flag LINUXLINK
911        ###############################################################
912
913        if (( $installer::globals::islinuxbuild ) && ( ! $installer::globals::simple ))	# for rpms and debian packages
914        {
915            # special handling for all RPMs in $installer::globals::linuxlinkrpms
916
917            # if (( $installer::globals::linuxlinkrpms =~ /\b$onepackagename\b/ ) || ( $installer::globals::languagepack ))
918            if ( $installer::globals::linuxlinkrpms =~ /\b$onepackagename\b/ )
919            {
920                my $run = 0;
921
922                if (( $installer::globals::makelinuxlinkrpm ) && ( ! $run ))
923                {
924                    $filesinpackage = \@installer::globals::linuxpatchfiles;
925                    $linksinpackage = \@installer::globals::linuxlinks;
926                    $installer::globals::makelinuxlinkrpm = 0;
927                    if ( $installer::globals::patch ) { $installer::globals::call_epm = 1; }	 # enabling packing again
928                    $run = 1;
929                }
930
931                if (( ! $installer::globals::makelinuxlinkrpm ) && ( ! $run ))
932                {
933                    $filesinpackage = installer::worker::prepare_linuxlinkfiles($filesinpackage);
934                    $linksinpackage = installer::worker::prepare_forced_linuxlinkfiles($linksinpackage);
935                    $installer::globals::makelinuxlinkrpm = 1;
936                    if ( $allvariableshashref->{'OPENSOURCE'} ) { $installer::globals::add_required_package = $packagename . "u"; }
937                    if ( $installer::globals::patch ) { $installer::globals::call_epm = 0; }	 # no packing of core module in patch
938                    $shellscriptsfilename = "";	# shell scripts only need to be included into the link rpm
939                    $run = 1;
940                }
941            }
942        }
943
944        ###########################################
945        # Simple installation mechanism
946        ###########################################
947
948        if ( $installer::globals::simple ) { installer::worker::install_simple($onepackagename, $$languagestringref, $dirsinpackage, $filesinpackage, $linksinpackage, $unixlinksinpackage); }
949
950        ###########################################
951        # Checking epm state
952        ###########################################
953
954        if (( $installer::globals::call_epm ) && ( ! $found_epm ))
955        {
956            $epmexecutable = installer::epmfile::find_epm_on_system($includepatharrayref);
957            installer::epmfile::set_patch_state($epmexecutable);	# setting $installer::globals::is_special_epm
958            $found_epm = 1;	# searching only once
959        }
960
961        ###########################################
962        # Creating epm list file
963        ###########################################
964
965        if ( ! $installer::globals::simple )
966        {
967            # epm list file format:
968            # type mode owner group destination source options
969            # Example for a file: f 755 root sys /usr/bin/foo foo
970            # Example for a directory: d 755 root sys /var/spool/foo -
971            # Example for a link: l 000 root sys /usr/bin/linkname filename
972            # The source field specifies the file to link to
973
974            my $epmfilename = "epm_" . $onepackagename . $linkaddon . ".lst";
975
976            $installer::logger::Info->print( "... creating epm list file $epmfilename ... \n" );
977
978            my $completeepmfilename = $listfiledir . $installer::globals::separator . $epmfilename;
979
980            my @epmfile = ();
981
982            my $epmheaderref = installer::epmfile::create_epm_header($allvariableshashref, $filesinproductlanguageresolvedarrayref, $languagesarrayref, $onepackage);
983            installer::epmfile::adding_header_to_epm_file(\@epmfile, $epmheaderref);
984
985            if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild ))
986            {
987                $filesinpackage = installer::worker::analyze_patch_files($filesinpackage);
988
989                if ( ! ( $#{$filesinpackage} > -1 ))
990                {
991                    push(@installer::globals::emptypackages, $packagename);
992                    $installer::logger::Lang->print("\n");
993                    $installer::logger::Lang->print("No file in package: %s \-\> Skipping\n", $packagename);
994                    next;	# next package, end of loop !
995                }
996            }
997
998            # adding directories, files and links into epm file
999
1000            installer::epmfile::put_directories_into_epmfile($dirsinpackage, \@epmfile, $allvariableshashref, $packagerootpath);
1001            installer::epmfile::put_files_into_epmfile($filesinpackage, \@epmfile );
1002            installer::epmfile::put_links_into_epmfile($linksinpackage, \@epmfile );
1003            installer::epmfile::put_unixlinks_into_epmfile($unixlinksinpackage, \@epmfile );
1004
1005            if ((!( $shellscriptsfilename eq "" )) && (!($installer::globals::iswindowsbuild))) { installer::epmfile::adding_shellscripts_to_epm_file(\@epmfile, $shellscriptsfilename, $packagerootpath, $allvariableshashref, $filesinpackage); }
1006
1007            installer::files::save_file($completeepmfilename ,\@epmfile);
1008
1009            # ... splitting the rootpath into a relocatable part and a static part, if possible
1010
1011            my $staticpath = "";
1012            my $relocatablepath = "";
1013            # relocatable path can be defined in package list
1014            if ( $onepackage->{'relocatablepath'} ) { $relocatablepath = $onepackage->{'relocatablepath'}; }
1015            # setting fix part and variable part of destination path
1016            installer::epmfile::analyze_rootpath($packagerootpath, \$staticpath, \$relocatablepath, $allvariableshashref);
1017
1018            # ... replacing the variable PRODUCTDIRECTORYNAME in the shellscriptfile by $staticpath
1019
1020            installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "PRODUCTDIRECTORYNAME", $staticpath);
1021            installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "SOLSUREPACKAGEPREFIX", $allvariableshashref->{'SOLSUREPACKAGEPREFIX'});
1022            installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "UREPACKAGEPREFIX", $allvariableshashref->{'UREPACKAGEPREFIX'});
1023            # installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "BASISDIRECTORYVERSION", $allvariableshashref->{'OOOBASEVERSION'});
1024            installer::files::save_file($completeepmfilename ,\@epmfile);
1025
1026            #######################################################
1027            # Now the complete content of the package is known,
1028            # including variables and shell scripts.
1029            # Create the package or using the package pool?
1030            #######################################################
1031
1032            my $use_package_from_pool = 0;
1033            if ( $allvariableshashref->{'POOLPRODUCT'} ) { $use_package_from_pool = installer::packagepool::package_is_up_to_date($allvariableshashref, $onepackage, $packagename, \@epmfile, $filesinpackage, $installdir, $installer::globals::epmoutpath, $languagestringref); }
1034
1035            if ( $use_package_from_pool == 3 ) # repeat this package later
1036            {
1037                my $package_is_creatable = installer::packagepool::check_package_availability($packagename);
1038
1039                if (( ! $package_is_creatable ) && ( ! exists($installer::globals::poolshiftedpackages{$packagename}) ))
1040                {
1041                    splice(@{$packages}, $k, 1);	# removing package ...
1042                    push(@{$packages}, $onepackage);  # ... and adding it to the end
1043                    $installer::globals::poolshiftedpackages{$packagename} = 1;	# only shifting each package once
1044                    $k--;														# decreasing the counter
1045                    $installer::logger::Info->print("\n");
1046                    $installer::logger::Info->print("Pool: Package \"%s\" cannot be created at the moment. Trying again later (2).\n", $packagename);
1047                    $installer::logger::Lang->print("\n");
1048                    $installer::logger::Lang->print("Pool: Package \"%s\" cannot be created at the moment. Trying again later (2).\n", $packagename);
1049                    next;														# repeating this iteration with new package
1050                }
1051            }
1052
1053            if ( $use_package_from_pool == 4 ) # There was a problem with pooling. Repeat this package immediately.
1054            {
1055                $k--;														# decreasing the counter
1056                $installer::logger::Info->print("\n");
1057                $installer::logger::Info->print("Pool: Package \"%s\" had pooling problems. Repeating packaging immediately (3).\n", $packagename);
1058                $installer::logger::Lang->print("\n");
1059                $installer::logger::Lang->print("Pool: Package \"%s\" had pooling problems. Repeating packaging immediately (3).\n", $packagename);
1060                next;														# repeating this iteration
1061            }
1062
1063            if ( $use_package_from_pool == 0 )
1064            {
1065                # changing into the "install" directory to create installation sets
1066
1067                my $currentdir = cwd();	# $currentdir is global in this file
1068
1069                chdir($installdir);		# changing into install directory ($installdir is global in this file)
1070
1071                ###########################################
1072                # Starting epm
1073                ###########################################
1074
1075                # With a patched epm, it is now possible to set the relocatable directory, change
1076                # the directory in which the packages are created, setting "requires" and "provides"
1077                # (Linux) or creating the "depend" file (Solaris) and finally to begin
1078                # the packaging process with standard tooling and standard parameter
1079                # Linux: Adding into the spec file: Prefix: /opt
1080                # Solaris: Adding into the pkginfo file: BASEDIR=/opt
1081                # Attention: Changing of the path can influence the shell scripts
1082
1083                if (( $installer::globals::is_special_epm ) && ( ($installer::globals::islinuxrpmbuild) || ($installer::globals::issolarispkgbuild) ))	# special handling only for Linux RPMs and Solaris Packages
1084                {
1085                    if ( $installer::globals::call_epm )	# only do something, if epm is really executed
1086                    {
1087                        # ... now epm can be started, to create the installation sets
1088
1089                        $installer::logger::Info->print( "... starting patched epm ... \n" );
1090
1091                        installer::epmfile::call_epm($epmexecutable, $completeepmfilename, $packagename, $includepatharrayref);
1092
1093                        my $newepmdir = installer::epmfile::prepare_packages($loggingdir, $packagename, $staticpath, $relocatablepath, $onepackage, $allvariableshashref, $filesinpackage, $languagestringref);	# adding the line for Prefix / Basedir, include rpmdir
1094
1095                        installer::epmfile::create_packages_without_epm($newepmdir, $packagename, $includepatharrayref, $allvariableshashref, $languagestringref);	# start to package
1096
1097                        # finally removing all temporary files
1098
1099                        installer::epmfile::remove_temporary_epm_files($newepmdir, $loggingdir, $packagename);
1100
1101                        # Installation:
1102                        # Install: pkgadd -a myAdminfile -d ./SUNWso8m34.pkg
1103                        # Install: rpm -i --prefix=/opt/special --nodeps so8m35.rpm
1104
1105                        installer::epmfile::create_new_directory_structure($newepmdir);
1106                        $installer::globals::postprocess_specialepm = 1;
1107
1108                        # solaris patch not needed anymore
1109                        # if (( $installer::globals::patch ) && ( $installer::globals::issolarisx86build )) { installer::worker::fix2_solaris_x86_patch($packagename, $installer::globals::epmoutpath); }
1110                    }
1111                }
1112                else	# this is the standard epm (not relocatable) or ( nonlinux and nonsolaris )
1113                {
1114                    installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "\$\$PRODUCTINSTALLLOCATION", $relocatablepath);
1115                    installer::files::save_file($completeepmfilename ,\@epmfile);	# Warning for pool, content of epm file is changed.
1116
1117                    if ( $installer::globals::call_epm )
1118                    {
1119                        # ... now epm can be started, to create the installation sets
1120
1121                        $installer::logger::Info->print( "... starting unpatched epm ... \n" );
1122
1123                        if ( $installer::globals::call_epm ) { installer::epmfile::call_epm($epmexecutable, $completeepmfilename, $packagename, $includepatharrayref); }
1124
1125                        if (($installer::globals::islinuxrpmbuild) || ($installer::globals::issolarispkgbuild) || ($installer::globals::debian))
1126                        {
1127                            $installer::globals::postprocess_standardepm = 1;
1128                        }
1129                    }
1130                }
1131
1132                if ( $allvariableshashref->{'POOLPRODUCT'} ) { installer::packagepool::put_content_into_pool($packagename, $installdir, $installer::globals::epmoutpath, $filesinpackage, \@epmfile); }
1133
1134                chdir($currentdir);	# changing back into start directory
1135
1136            } # end of "if ( ! $use_package_from_pool )
1137
1138        } # end of "if ( ! $installer::globals::simple )
1139
1140        ###########################################
1141        # xpd installation mechanism
1142        ###########################################
1143
1144        # Creating the xpd file for the package. This has to happen always, not determined by $use_package_from_pool
1145
1146        if ( $installer::globals::isxpdplatform )
1147        {
1148            if (( ! $installer::globals::languagepack ) && ( ! $installer::globals::patch ))
1149            {
1150                if (( $allvariableshashref->{'XPDINSTALLER'} ) && ( $installer::globals::call_epm != 0 ))
1151                {
1152                    installer::xpdinstaller::create_xpd_file($onepackage, $packages, $languagestringref, $allvariableshashref, $modulesinproductarrayref, $installdir, $installer::globals::epmoutpath, $linkpackage, \%installer::globals::xpdpackageinfo);
1153                    $installer::globals::xpd_files_prepared = 1;
1154                    %installer::globals::xpdpackageinfo = ();
1155                }
1156            }
1157        }
1158
1159        if ( $installer::globals::makelinuxlinkrpm ) { $k--; }	# decreasing the counter to create the link rpm!
1160
1161    }	# end of "for ( my $k = 0; $k <= $#{$packages}; $k++ )"
1162
1163    installer::packagepool::log_pool_statistics();
1164
1165    ##############################################################
1166    # Post epm functionality, after the last package is packed
1167    ##############################################################
1168
1169    if ( $installer::globals::postprocess_specialepm )
1170    {
1171        installer::logger::include_header_into_logfile("Post EPM processes (Patched EPM):");
1172
1173        chdir($installdir);
1174
1175        # Copying the cde, kde and gnome packages into the installation set
1176        if ( $installer::globals::addsystemintegration ) { installer::epmfile::put_systemintegration_into_installset($installer::globals::epmoutpath, $includepatharrayref, $allvariableshashref, $modulesinproductarrayref); }
1177
1178        # Adding license and readme into installation set
1179        # if ($installer::globals::addlicensefile) { installer::epmfile::put_installsetfiles_into_installset($installer::globals::epmoutpath); }
1180        if ($installer::globals::addlicensefile) { installer::worker::put_scpactions_into_installset("."); }
1181
1182        # Adding child projects to installation dynamically
1183        if ($installer::globals::addchildprojects) { installer::epmfile::put_childprojects_into_installset($installer::globals::epmoutpath, $allvariableshashref, $modulesinproductarrayref, $includepatharrayref); }
1184
1185        # Adding license file into setup
1186        if ( $allvariableshashref->{'PUT_LICENSE_INTO_SETUP'} ) { installer::worker::put_license_into_setup(".", $includepatharrayref); }
1187
1188        # Creating installation set for Unix language packs, that are not part of multi lingual installation sets
1189        if ( ( $installer::globals::languagepack ) && ( ! $installer::globals::debian ) && ( ! $installer::globals::makedownload ) ) { installer::languagepack::build_installer_for_languagepack($installer::globals::epmoutpath, $allvariableshashref, $includepatharrayref, $languagesarrayref, $languagestringref); }
1190
1191        # Finalizing patch installation sets
1192        if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild )) { installer::epmfile::finalize_patch($installer::globals::epmoutpath, $allvariableshashref); }
1193        if (( $installer::globals::patch ) && ( $installer::globals::islinuxrpmbuild )) { installer::epmfile::finalize_linux_patch($installer::globals::epmoutpath, $allvariableshashref, $includepatharrayref); }
1194
1195        # Copying the xpd installer into the installation set
1196        if (( $allvariableshashref->{'XPDINSTALLER'} ) && ( $installer::globals::isxpdplatform ) && ( $installer::globals::xpd_files_prepared ))
1197        {
1198            installer::xpdinstaller::create_xpd_installer($installdir, $allvariableshashref, $languagestringref);
1199            $installer::globals::addjavainstaller = 0;	# only one java installer possible
1200        }
1201
1202        # Copying the java installer into the installation set
1203        chdir($currentdir);	# changing back into start directory
1204        if ( $installer::globals::addjavainstaller ) { installer::javainstaller::create_java_installer($installdir, $installer::globals::epmoutpath, $languagestringref, $languagesarrayref, $allvariableshashref, $includepatharrayref, $modulesinproductarrayref); }
1205    }
1206
1207    if ( $installer::globals::postprocess_standardepm )
1208    {
1209        installer::logger::include_header_into_logfile("Post EPM processes (Standard EPM):");
1210
1211        chdir($installdir);
1212
1213        # determine the destination directory
1214        my $newepmdir = installer::epmfile::determine_installdir_ooo();
1215
1216        # Copying the cde, kde and gnome packages into the installation set
1217        if ( $installer::globals::addsystemintegration ) { installer::epmfile::put_systemintegration_into_installset($newepmdir, $includepatharrayref, $allvariableshashref, $modulesinproductarrayref); }
1218
1219        # Adding license and readme into installation set
1220        # if ($installer::globals::addlicensefile) { installer::epmfile::put_installsetfiles_into_installset($newepmdir); }
1221        if ($installer::globals::addlicensefile) { installer::worker::put_scpactions_into_installset("."); }
1222
1223        # Adding license file into setup
1224        if ( $allvariableshashref->{'PUT_LICENSE_INTO_SETUP'} ) { installer::worker::put_license_into_setup(".", $includepatharrayref); }
1225
1226        # Creating installation set for Unix language packs, that are not part of multi lingual installation sets
1227        if ( ( $installer::globals::languagepack ) && ( ! $installer::globals::debian ) && ( ! $installer::globals::makedownload ) ) { installer::languagepack::build_installer_for_languagepack($newepmdir, $allvariableshashref, $includepatharrayref, $languagesarrayref, $languagestringref); }
1228
1229        chdir($currentdir);	# changing back into start directory
1230    }
1231
1232    if (( $installer::globals::issolarispkgbuild ) && ( $allvariableshashref->{'COLLECT_PKGMAP'} )) { installer::worker::collectpackagemaps($installdir, $languagestringref, $allvariableshashref); }
1233
1234    #######################################################
1235    # Analyzing the log file
1236    #######################################################
1237
1238    my $is_success = 0;
1239    my $finalinstalldir = "";
1240
1241    installer::worker::clean_output_tree();	# removing directories created in the output tree
1242    ($is_success, $finalinstalldir) = installer::worker::analyze_and_save_logfile($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
1243    my $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "downloadname");
1244    if ( $is_success ) { installer::followme::save_followme_info($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref, $current_install_number, $loggingdir, $installlogdir); }
1245
1246    #######################################################
1247    # Creating download installation set
1248    #######################################################
1249
1250    if ( $installer::globals::makedownload )
1251    {
1252        my $create_download = 0;
1253        if ( $$downloadname ne "" ) { $create_download = 1; }
1254        if (( $is_success ) && ( $create_download ) && ( $ENV{'ENABLE_DOWNLOADSETS'} ))
1255        {
1256            my $downloaddir = installer::download::create_download_sets($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref);
1257            installer::worker::analyze_and_save_logfile($loggingdir, $downloaddir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
1258        }
1259    }
1260
1261    #######################################################
1262    # Creating jds installation set
1263    #######################################################
1264
1265    if ( $installer::globals::makejds )
1266    {
1267        my $create_jds = 0;
1268
1269        if ( $allvariableshashref->{'JDSBUILD'} ) { $create_jds = 1; }
1270        if (! $installer::globals::issolarispkgbuild ) { $create_jds = 0; }
1271
1272        if (( $is_success ) && ( $create_jds ))
1273        {
1274            if ( ! $installer::globals::jds_language_controlled )
1275            {
1276                my $correct_language = installer::worker::check_jds_language($allvariableshashref, $languagestringref);
1277                $installer::globals::correct_jds_language = $correct_language;
1278                $installer::globals::jds_language_controlled = 1;
1279            }
1280
1281            if ( $installer::globals::correct_jds_language )
1282            {
1283                my $jdsdir = installer::worker::create_jds_sets($finalinstalldir, $allvariableshashref, $languagestringref, $languagesarrayref, $includepatharrayref);
1284                installer::worker::clean_jds_temp_dirs();
1285                installer::worker::analyze_and_save_logfile($loggingdir, $jdsdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
1286            }
1287        }
1288    }
1289}
1290
1291
1292#################################################
1293# Main program
1294#################################################
1295
1296#################################################
1297# Part 1: The platform independent part
1298#################################################
1299
1300#################################################
1301# Part 1a: The language independent part
1302#################################################
1303
1304installer::logger::starttime();
1305$installer::logger::Global->add_timestamp("starting logging");
1306
1307# While there is no language set and logger::Lang is not yet tied to a log file,
1308# forward its output to logger::Global.
1309$installer::logger::Lang->set_forward($installer::logger::Global);
1310$installer::logger::Info->set_forward($installer::logger::Global);
1311
1312#########################################
1313# Checking the environment and setting
1314# most important variables
1315#########################################
1316
1317$installer::logger::Info->print( "... checking environment variables ...\n" );
1318my $environmentvariableshashref = installer::control::check_system_environment();
1319
1320installer::environment::set_global_environment_variables($environmentvariableshashref);
1321
1322#################################
1323# Check and output of parameter
1324#################################
1325
1326installer::parameter::saveparameter();
1327installer::parameter::getparameter();
1328
1329# debugging can start after function "getparameter"
1330
1331installer::parameter::control_fundamental_parameter();
1332installer::parameter::setglobalvariables();
1333installer::parameter::control_required_parameter();
1334
1335if (!($installer::globals::languages_defined_in_productlist)) { installer::languages::analyze_languagelist(); }
1336installer::parameter::outputparameter();
1337
1338installer::control::check_updatepack();
1339
1340$installer::globals::build = uc($installer::globals::build);	# using "SRC680" instead of "src680"
1341
1342######################################
1343# Creating the log directory
1344######################################
1345
1346my $loggingdir = installer::systemactions::create_directories("logging", "");
1347$loggingdir = $loggingdir . $installer::globals::separator;
1348$installer::globals::exitlog = $loggingdir;
1349
1350my $installdir = "";
1351my $currentdir = cwd();
1352my $shipinstalldir = "";
1353my $current_install_number = "";
1354
1355######################################
1356# Checking the system requirements
1357######################################
1358
1359$installer::logger::Info->print("... checking required files ...\n");
1360installer::control::check_system_path();
1361
1362my $pathvariableshashref = installer::environment::create_pathvariables($environmentvariableshashref);
1363
1364###################################################
1365# Analyzing the settings and variables in zip.lst
1366###################################################
1367
1368$installer::logger::Info->print( "... analyzing $installer::globals::ziplistname ... \n" );
1369
1370my ($allvariableshashref,
1371    $allsettingsarrayref)
1372    = installer::ziplist::read_openoffice_lst_file(
1373        $installer::globals::ziplistname,
1374        $installer::globals::product,
1375        $loggingdir);
1376$installer::logger::Lang->printf("variables:\n");
1377foreach my $key (sort keys %$allvariableshashref)
1378{
1379    $installer::logger::Global->printf("    %s -> %s\n", $key, $allvariableshashref->{$key});
1380}
1381
1382
1383# When we are building a release (-release option was given on the command line)
1384# then we need additional information.
1385if ($installer::globals::is_release)
1386{
1387    $installer::logger::Info->print("...  building a release, checking required values  ... \n");
1388    $installer::globals::target_version = $allvariableshashref->{'PRODUCTVERSION'};
1389    $installer::globals::source_version = $allvariableshashref->{'PREVIOUS_VERSION'};
1390    if ( ! defined $installer::globals::source_version)
1391    {
1392        $installer::globals::source_version = installer::patch::ReleasesList::GetPreviousVersion(
1393            $installer::globals::target_version);
1394    }
1395    if ( ! defined $installer::globals::source_version)
1396    {
1397        installer::exiter::exit_program(
1398            "can not detect the previous version number.  Please add a 'PREVIOUS_VERSION' variable to openoffice.lst",
1399            "make_installer.pl");
1400    }
1401
1402    # Determine if we are building a new major release, ie if target_version is ?.0.0
1403    $installer::globals::is_major_release
1404        = installer::patch::Version::IsMajorVersion($installer::globals::target_version);
1405
1406    $installer::logger::Info->printf("    building version %s\n", $installer::globals::target_version);
1407    $installer::logger::Info->printf("        which is %sa major version\n",
1408        $installer::globals::is_major_release
1409            ? ""
1410            : "not ");
1411    $installer::logger::Info->printf("    previous version is %s\n", $installer::globals::source_version);
1412}
1413
1414
1415########################################################
1416# Check if this is simple packaging mechanism
1417########################################################
1418
1419installer::simplepackage::check_simple_packager_project($allvariableshashref);
1420
1421####################################################################
1422# setting global variables
1423####################################################################
1424
1425installer::control::set_addchildprojects($allvariableshashref);
1426installer::control::set_addjavainstaller($allvariableshashref);
1427installer::control::set_addsystemintegration($allvariableshashref);
1428
1429########################################################
1430# Re-define logging dir, after all variables are set
1431########################################################
1432
1433my $oldloggingdir = $loggingdir;
1434installer::systemactions::remove_empty_directory($oldloggingdir);
1435$loggingdir = installer::systemactions::create_directories("logging", "");
1436$loggingdir = $loggingdir . $installer::globals::separator;
1437$installer::globals::exitlog = $loggingdir;
1438
1439# checking, whether this is an opensource product
1440
1441if (!($installer::globals::is_copy_only_project)) { installer::ziplist::set_manufacturer($allvariableshashref); }
1442
1443##############################################
1444# Checking version of makecab.exe
1445##############################################
1446
1447if ( $installer::globals::iswindowsbuild ) { installer::control::check_makecab_version(); }
1448
1449##########################################################
1450# Getting the include path from the settings in zip list
1451##########################################################
1452
1453my $includepathref = installer::ziplist::getinfofromziplist($allsettingsarrayref, "include");
1454if ( $$includepathref eq "" )
1455{
1456	installer::exiter::exit_program("ERROR: Definition for \"include\" not found in $installer::globals::ziplistname", "Main");
1457}
1458
1459my $includepatharrayref = installer::converter::convert_stringlist_into_array($includepathref, ",");
1460
1461installer::ziplist::replace_all_variables_in_pathes($includepatharrayref, $pathvariableshashref);
1462
1463installer::ziplist::replace_minor_in_pathes($includepatharrayref);
1464
1465installer::ziplist::replace_packagetype_in_pathes($includepatharrayref);
1466
1467installer::ziplist::resolve_relative_pathes($includepatharrayref);
1468
1469installer::ziplist::remove_ending_separator($includepatharrayref);
1470
1471##############################################
1472# Collecting all files from all include
1473# pathes in global hashes.
1474##############################################
1475
1476installer::worker::collect_all_files_from_includepathes($includepatharrayref);
1477
1478##############################################
1479# Analyzing languages in zip.lst if required
1480# Probably no longer used.
1481##############################################
1482
1483if ($installer::globals::languages_defined_in_productlist) { installer::languages::get_info_about_languages($allsettingsarrayref); }
1484
1485#####################################
1486# Windows requires the encoding list
1487#####################################
1488
1489if ( $installer::globals::iswindowsbuild ) { installer::control::read_encodinglist($includepatharrayref); }
1490
1491####################################################################
1492# MacOS dmg build requires special DS_Store file to arrange icons
1493####################################################################
1494if (($installer::globals::ismacdmgbuild) && ($installer::globals::product =~ /OpenOffice_Dev/)) { $installer::globals::devsnapshotbuild = 1; }
1495
1496if (($installer::globals::ismacdmgbuild) && ($installer::globals::product =~ /Apache_OpenOffice_Beta/)) { $installer::globals::betabuild = 1; }
1497
1498#####################################################################
1499# Including additional inc files for variable settings, if defined
1500#####################################################################
1501
1502if ( $allvariableshashref->{'ADD_INCLUDE_FILES'} ) { installer::worker::add_variables_from_inc_to_hashref($allvariableshashref, $includepatharrayref); }
1503
1504################################################
1505# Disable xpd installer, if SOLAR_JAVA not set
1506################################################
1507
1508installer::control::check_java_for_xpd($allvariableshashref);
1509
1510#####################################
1511# Analyzing the setup script
1512#####################################
1513
1514my $setupscriptref = GetSetupScriptLines($allsettingsarrayref, $allvariableshashref, $includepatharrayref);
1515
1516installer::logger::log_hashref($allvariableshashref);
1517
1518$installer::logger::Info->print( "... analyzing directories ... \n" );
1519
1520# Collect all directories in the script to get the destination dirs
1521
1522my $dirsinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Directory");
1523
1524if ( $installer::globals::languagepack ) { installer::scriptitems::use_langpack_hostname($dirsinproductarrayref); }
1525if ( $installer::globals::patch ) { installer::scriptitems::use_patch_hostname($dirsinproductarrayref); }
1526
1527if ( $allvariableshashref->{'SHIFT_BASIS_INTO_BRAND_LAYER'} ) { $dirsinproductarrayref = installer::scriptitems::shift_basis_directory_parents($dirsinproductarrayref); }
1528if ( $allvariableshashref->{'OFFICEDIRECTORYNAME'} ) { installer::scriptitems::set_officedirectory_name($dirsinproductarrayref, $allvariableshashref->{'OFFICEDIRECTORYNAME'}); }
1529
1530
1531installer::scriptitems::resolve_all_directory_names($dirsinproductarrayref);
1532
1533$installer::logger::Info->print( "... analyzing files ... \n" );
1534
1535my $filesinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "File");
1536
1537$filesinproductarrayref = installer::scriptitems::remove_delete_only_files_from_productlists($filesinproductarrayref);
1538
1539if (( ! $installer::globals::iswindowsbuild ) &&
1540	( ! $installer::globals::islinuxrpmbuild ) &&
1541	( ! $installer::globals::islinuxdebbuild ) &&
1542	( ! $installer::globals::issolarispkgbuild ) &&
1543	( $installer::globals::packageformat ne "installed" ) &&
1544	( $installer::globals::packageformat ne "dmg" ) &&
1545	( $installer::globals::packageformat ne "archive" ))
1546	{ installer::control::check_oxtfiles($filesinproductarrayref); }
1547
1548if ($installer::globals::product =~ /suite/i ) { $filesinproductarrayref = installer::scriptitems::remove_notinsuite_files_from_productlists($filesinproductarrayref); }
1549
1550if (! $installer::globals::languagepack)
1551{
1552	$filesinproductarrayref = installer::scriptitems::remove_Languagepacklibraries_from_Installset($filesinproductarrayref);
1553}
1554
1555if (! $installer::globals::patch)
1556{
1557	$filesinproductarrayref = installer::scriptitems::remove_patchonlyfiles_from_Installset($filesinproductarrayref);
1558}
1559
1560if (! $installer::globals::tab)
1561{
1562	$filesinproductarrayref = installer::scriptitems::remove_tabonlyfiles_from_Installset($filesinproductarrayref);
1563}
1564
1565if (( $installer::globals::packageformat ne "installed" ) && ( $installer::globals::packageformat ne "archive" ))
1566{
1567	$filesinproductarrayref = installer::scriptitems::remove_installedproductonlyfiles_from_Installset($filesinproductarrayref);
1568}
1569
1570$installer::logger::Info->print( "... analyzing scpactions ... \n" );
1571
1572my $scpactionsinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "ScpAction");
1573
1574if (( ! $allvariableshashref->{'XPDINSTALLER'} ) || ( ! $installer::globals::isxpdplatform ))
1575{
1576	$scpactionsinproductarrayref = installer::scriptitems::remove_Xpdonly_Items($scpactionsinproductarrayref);
1577}
1578
1579if ( $installer::globals::languagepack ) { installer::scriptitems::use_langpack_copy_scpaction($scpactionsinproductarrayref); }
1580if ( $installer::globals::patch ) { installer::scriptitems::use_patch_copy_scpaction($scpactionsinproductarrayref); }
1581if ($installer::globals::devsnapshotbuild) { installer::scriptitems::use_dev_copy_scpaction($scpactionsinproductarrayref); }
1582if ($installer::globals::betabuild) { installer::scriptitems::use_beta_copy_scpaction($scpactionsinproductarrayref); }
1583
1584if ($installer::globals::betabuild && $installer::globals::languagepack) { installer::scriptitems::use_langbeta_copy_scpaction($scpactionsinproductarrayref); }
1585
1586# $scpactionsinproductarrayref = installer::scriptitems::remove_scpactions_without_name($scpactionsinproductarrayref);
1587
1588installer::scriptitems::change_keys_of_scpactions($scpactionsinproductarrayref);
1589
1590$installer::logger::Info->print( "... analyzing shortcuts ... \n" );
1591
1592my $linksinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Shortcut");
1593
1594$installer::logger::Info->print( "... analyzing unix links ... \n" );
1595
1596my $unixlinksinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Unixlink");
1597
1598# $unixlinksinproductarrayref = installer::scriptitems::filter_layerlinks_from_unixlinks($unixlinksinproductarrayref);
1599
1600$installer::logger::Info->print( "... analyzing profile ... \n" );
1601
1602my $profilesinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Profile");
1603
1604$installer::logger::Info->print( "... analyzing profileitems ... \n" );
1605
1606my $profileitemsinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "ProfileItem");
1607
1608my $folderinproductarrayref;
1609my $folderitemsinproductarrayref;
1610my $registryitemsinproductarrayref;
1611my $windowscustomactionsarrayref;
1612
1613if ( $installer::globals::iswindowsbuild )	# Windows specific items: Folder, FolderItem, RegistryItem, WindowsCustomAction
1614{
1615	$installer::logger::Info->print( "... analyzing folders ... \n" );
1616
1617	$folderinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Folder");
1618
1619	$installer::logger::Info->print( "... analyzing folderitems ... \n" );
1620
1621	$folderitemsinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "FolderItem");
1622
1623	installer::setupscript::add_predefined_folder($folderitemsinproductarrayref, $folderinproductarrayref);
1624
1625	installer::setupscript::prepare_non_advertised_files($folderitemsinproductarrayref, $filesinproductarrayref);
1626
1627	$installer::logger::Info->print( "... analyzing registryitems ... \n" );
1628
1629	$registryitemsinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "RegistryItem");
1630
1631	$registryitemsinproductarrayref = installer::scriptitems::remove_uninstall_regitems_from_script($registryitemsinproductarrayref);
1632
1633	$installer::logger::Info->print( "... analyzing Windows custom actions ... \n" );
1634
1635	$windowscustomactionsarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "WindowsCustomAction");
1636}
1637
1638my $modulesinproductarrayref;
1639
1640if (!($installer::globals::is_copy_only_project))
1641{
1642	$installer::logger::Info->print( "... analyzing modules ... \n" );
1643
1644	$modulesinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Module");
1645
1646	if (( ! $allvariableshashref->{'XPDINSTALLER'} ) || ( ! $installer::globals::isxpdplatform ))
1647	{
1648		$modulesinproductarrayref = installer::scriptitems::remove_Xpdonly_Items($modulesinproductarrayref);
1649	}
1650
1651	installer::scriptitems::resolve_assigned_modules($modulesinproductarrayref);
1652
1653	$modulesinproductarrayref = installer::scriptitems::remove_template_modules($modulesinproductarrayref);
1654
1655	installer::scriptitems::set_children_flag($modulesinproductarrayref);
1656
1657	installer::scriptitems::collect_all_languagemodules($modulesinproductarrayref);
1658
1659	# Assigning the modules to the items
1660
1661	installer::scriptitems::assigning_modules_to_items($modulesinproductarrayref, $filesinproductarrayref, "Files");
1662
1663	installer::scriptitems::assigning_modules_to_items($modulesinproductarrayref, $unixlinksinproductarrayref, "Unixlinks");
1664
1665	installer::scriptitems::assigning_modules_to_items($modulesinproductarrayref, $dirsinproductarrayref, "Dirs");
1666}
1667
1668
1669# saving debug info, before staring part 1b
1670if ( $installer::globals::debug ) { installer::logger::savedebug($installer::globals::exitlog); }
1671
1672#################################################
1673# Part 1b: The language dependent part
1674# (still platform independent)
1675#################################################
1676
1677# Now starts the language dependent part, if more than one product is defined on the command line
1678# Example -l en-US,de#es,fr,it defines two multilingual products
1679
1680###############################################################################
1681# Beginning of language dependent part
1682# The for iterates over all products, separated by an # in the language list
1683###############################################################################
1684
1685
1686# Run the following code block exactly once.
1687# This strange version of a do{}while(false) loop exists only to allow (legacy) next statements.
1688for (;1;last)
1689{
1690	my $languagesarrayref = installer::languages::get_all_languages_for_one_product($installer::globals::languageproduct, $allvariableshashref);
1691
1692	$installer::globals::alllanguagesinproductarrayref = $languagesarrayref;
1693	my $languagestringref = installer::languages::get_language_string($languagesarrayref);
1694	$installer::logger::Info->print( "------------------------------------\n" );
1695	$installer::logger::Info->print( "... languages $$languagestringref ... \n" );
1696
1697	if ( $installer::globals::patch )
1698	{
1699		$installer::globals::addlicensefile = 0;	# no license files for patches
1700		$installer::globals::makedownload = 0;
1701		$installer::globals::makejds = 0;
1702	}
1703
1704	if ( $installer::globals::languagepack )
1705	{
1706		$installer::globals::addchildprojects = 0;
1707		$installer::globals::addsystemintegration = 0;
1708		$installer::globals::makejds = 0;
1709		$installer::globals::addlicensefile = 0;
1710
1711		if ( $allvariableshashref->{'OPENSOURCE'} ) { $installer::globals::makedownload = 1; }
1712		else { $installer::globals::makedownload = 0; }
1713	}
1714
1715    # Set up an MSI object for the source version.
1716    if ($installer::globals::is_release
1717        && $installer::globals::iswindowsbuild)
1718    {
1719        my $releases = installer::patch::ReleasesList::Instance()->{$installer::globals::source_version};
1720        if ( ! defined $releases)
1721        {
1722            $installer::logger::Info->printf(
1723                "there is no recorded information about previous version %s\n",
1724                $installer::globals::source_version);
1725            $installer::logger::Info->printf("    reverting to non-release build\n");
1726            $installer::globals::is_release = 0;
1727        }
1728        elsif ( ! defined $releases->{'msi'}->{installer::languages::get_normalized_language($$languagestringref)})
1729        {
1730            $installer::logger::Info->printf(
1731                "there is no recorded information about language '%s' in previous version %s\n",
1732                $$languagestringref,
1733                $installer::globals::source_version);
1734            $installer::logger::Info->printf("    reverting to non-release build\n");
1735            $installer::globals::is_release = 0;
1736        }
1737        else
1738        {
1739            $installer::logger::Info->printf("preparing MSI object for source version %s\n",
1740                $installer::globals::source_version);
1741            my $source_version_string = join(
1742                "",
1743                installer::patch::Version::StringToNumberArray($installer::globals::source_version));
1744            $installer::globals::source_msi = installer::patch::Msi->FindAndCreate(
1745                $installer::globals::source_version,
1746                0,
1747                $$languagestringref,
1748                $installer::globals::product);
1749        }
1750    }
1751
1752	############################################################
1753	# Beginning of language specific logging mechanism
1754	# Until now only global logging into default: logfile.txt
1755	############################################################
1756
1757	installer::logger::copy_globalinfo_into_logfile();
1758	$installer::globals::globalinfo_copied = 1;
1759
1760	my $logminor = "";
1761	if ( $installer::globals::updatepack ) { $logminor = $installer::globals::lastminor; }
1762	else { $logminor = $installer::globals::minor; }
1763
1764    my $loglanguagestring_orig = $$languagestringref;
1765	my $loglanguagestring = installer::languages::get_language_directory_name($$languagestringref);
1766
1767    # Setup the directory where the language dependent log file will be stored.
1768	$loggingdir = $loggingdir . $loglanguagestring . $installer::globals::separator;
1769	installer::systemactions::create_directory($loggingdir);
1770
1771    # Set language dependent logging.
1772    $installer::globals::logfilename = sprintf("log_%s%s_%s.log",
1773        $installer::globals::build,
1774        $logminor ne "" ? "_" . $logminor : "",
1775        $loglanguagestring);
1776    $installer::logger::Lang->set_filename($loggingdir . $installer::globals::logfilename);
1777    $installer::logger::Lang->copy_lines_from($installer::logger::Global);
1778    $installer::logger::Lang->set_filter(\&installer::control::filter_log_error);
1779    installer::control::prepare_error_processing();
1780    # All logging to the console is also forwarded to the language dependen log.
1781    $installer::logger::Lang->set_forward(undef);
1782    $installer::logger::Info->set_forward($installer::logger::Lang);
1783    # Scan all log lines for error messages.
1784    $installer::logger::Lang->add_timestamp("starting log for language ".$loglanguagestring);
1785
1786	if ($loglanguagestring ne $loglanguagestring_orig) {
1787	    (my $dir = $loggingdir) =~ s!/$!!;
1788	    open(my $F1, "> $dir.dir");
1789	    open(my $F2, "> " . $loggingdir . $installer::globals::logfilename . '.file');
1790	    my @s = map { "$_\n" } split('_', $loglanguagestring_orig);
1791	    print $F1 @s;
1792	    print $F2 @s;
1793	}
1794
1795	$installer::globals::exitlog = $loggingdir;
1796
1797	##############################################################
1798	# Determining the ship location, if this is an update pack
1799	##############################################################
1800
1801	if ( $installer::globals::updatepack ) { $shipinstalldir = installer::control::determine_ship_directory($languagestringref); }
1802
1803	##############################################
1804	# Setting global code variables for Windows
1805	##############################################
1806
1807	if (!($installer::globals::is_copy_only_project))
1808	{
1809		if (( $installer::globals::iswindowsbuild )
1810            && ( $installer::globals::packageformat ne "archive" )
1811            && ( $installer::globals::packageformat ne "installed" ))
1812		{
1813			installer::windows::msiglobal::set_global_code_variables(
1814                $languagesarrayref,
1815                $allvariableshashref);
1816		}
1817	}
1818
1819	################################################
1820	# Resolving include paths (language dependent)
1821	################################################
1822
1823	my $includepatharrayref_lang = installer::ziplist::replace_languages_in_pathes($includepatharrayref, $languagesarrayref);
1824
1825	if ( $installer::globals::refresh_includepathes ) { installer::worker::collect_all_files_from_includepathes($includepatharrayref_lang); }
1826
1827	installer::ziplist::list_all_files_from_include_path($includepatharrayref_lang);
1828
1829	##############################################
1830	# Analyzing spellchecker languages
1831	##############################################
1832
1833	if ( $allvariableshashref->{'SPELLCHECKERFILE'} ) { installer::worker::set_spellcheckerlanguages($languagesarrayref, $allvariableshashref); }
1834
1835	#####################################
1836	# Language dependent directory part
1837	#####################################
1838
1839	my $dirsinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($dirsinproductarrayref, $languagesarrayref);
1840
1841	# A new directory array is needed ($dirsinproductlanguageresolvedarrayref instead of $dirsinproductarrayref)
1842	# because $dirsinproductarrayref is needed in get_Destination_Directory_For_Item_From_Directorylist
1843
1844	installer::scriptitems::changing_name_of_language_dependent_keys($dirsinproductlanguageresolvedarrayref);
1845
1846	installer::scriptitems::checking_directories_with_corrupt_hostname($dirsinproductlanguageresolvedarrayref, $languagesarrayref);
1847
1848	installer::scriptitems::set_global_directory_hostnames($dirsinproductlanguageresolvedarrayref, $allvariableshashref);
1849
1850	#####################################
1851	# files part, language dependent
1852	#####################################
1853
1854	$installer::logger::Info->print( "... analyzing files ...\n" );
1855
1856	my $filesinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($filesinproductarrayref, $languagesarrayref);
1857
1858	if ( ! $installer::globals::set_office_start_language )
1859	{
1860		$filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_office_start_language_files($filesinproductlanguageresolvedarrayref);
1861	}
1862
1863	installer::scriptitems::changing_name_of_language_dependent_keys($filesinproductlanguageresolvedarrayref);
1864	if ( $installer::globals::iswin and $^O =~ /MSWin/i ) { installer::converter::convert_slash_to_backslash($filesinproductlanguageresolvedarrayref); }
1865
1866	$filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_non_existent_languages_in_productlists($filesinproductlanguageresolvedarrayref, $languagestringref, "Name", "file");
1867
1868	installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist($filesinproductlanguageresolvedarrayref, $includepatharrayref_lang, $dirsinproductlanguageresolvedarrayref, "Files");
1869
1870	$filesinproductlanguageresolvedarrayref = installer::scriptitems::add_bundled_extension_blobs( $filesinproductlanguageresolvedarrayref);
1871    ($filesinproductlanguageresolvedarrayref,$dirsinproductarrayref) = installer::scriptitems::add_bundled_prereg_extensions(
1872        $filesinproductlanguageresolvedarrayref, $dirsinproductarrayref);
1873
1874	installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist($filesinproductlanguageresolvedarrayref, $dirsinproductarrayref);
1875
1876	$filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_Files_Without_Sourcedirectory($filesinproductlanguageresolvedarrayref);
1877
1878	if ($installer::globals::languagepack)
1879	{
1880		$filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_Files_For_Languagepacks($filesinproductlanguageresolvedarrayref);
1881	}
1882
1883
1884	if ( ! $allvariableshashref->{'NO_README_IN_ROOTDIR'} )
1885	{
1886		$filesinproductlanguageresolvedarrayref = installer::scriptitems::add_License_Files_into_Installdir($filesinproductlanguageresolvedarrayref, $dirsinproductlanguageresolvedarrayref, $languagesarrayref);
1887	}
1888
1889	$filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_onlyasialanguage_files_from_productlists($filesinproductlanguageresolvedarrayref);
1890
1891	$filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_onlywesternlanguage_files_from_productlists($filesinproductlanguageresolvedarrayref);
1892
1893	installer::scriptitems::make_filename_language_specific($filesinproductlanguageresolvedarrayref);
1894
1895	######################################################################################
1896	# Unzipping files with flag ARCHIVE and putting all included files into the file list
1897	######################################################################################
1898
1899	$installer::logger::Info->print( "... analyzing files with flag ARCHIVE ...\n" );
1900
1901	my @additional_paths_from_zipfiles = ();
1902
1903	$filesinproductlanguageresolvedarrayref = installer::archivefiles::resolving_archive_flag($filesinproductlanguageresolvedarrayref, \@additional_paths_from_zipfiles, $languagestringref, $loggingdir);
1904
1905	# packed files sometimes contain a "$" in their name: HighlightText$1.class. For epm the "$" has to be quoted by "$$"
1906
1907	if (!( $installer::globals::iswindowsbuild || $installer::globals::simple ) )
1908	{
1909		installer::scriptitems::quoting_illegal_filenames($filesinproductlanguageresolvedarrayref);
1910	}
1911
1912	#####################################
1913	# Files with flag SUBST_FILENAME
1914	#####################################
1915
1916	$installer::logger::Info->print( "... analyzing files with flag SUBST_FILENAME ...\n" );
1917
1918	installer::substfilenamefiles::resolving_subst_filename_flag($filesinproductlanguageresolvedarrayref, $allvariableshashref, $languagestringref);
1919
1920	#####################################
1921	# Files with flag SCPZIP_REPLACE
1922	#####################################
1923
1924	$installer::logger::Info->print( "... analyzing files with flag SCPZIP_REPLACE ...\n" );
1925
1926	# Editing files with flag SCPZIP_REPLACE.
1927
1928	installer::scpzipfiles::resolving_scpzip_replace_flag($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
1929
1930	#####################################
1931	# Files with flag PATCH_SO_NAME
1932	#####################################
1933
1934	$installer::logger::Info->print( "... analyzing files with flag PATCH_SO_NAME ...\n" );
1935
1936	# Editing files with flag PATCH_SO_NAME.
1937
1938	installer::scppatchsoname::resolving_patchsoname_flag($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
1939
1940	#####################################
1941	# Files with flag HIDDEN
1942	#####################################
1943
1944	$installer::logger::Info->print( "... analyzing files with flag HIDDEN ...\n" );
1945
1946	installer::worker::resolving_hidden_flag($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
1947
1948	############################################
1949	# Collecting directories for epm list file
1950	############################################
1951
1952	$installer::logger::Info->print( "... analyzing all directories for this product ...\n" );
1953
1954	# There are two ways for a directory to be included into the epm directory list:
1955	# 1. Looking for all destination paths in the files array
1956	# 2. Looking for directories with CREATE flag in the directory array
1957	# Advantage: Many pathes are hidden in zip files, they are not defined in the setup script.
1958	# It will be possible, that in the setup script only those directoies have to be defined,
1959	# that have a CREATE flag. All other directories are created, if they contain at least one file.
1960
1961	my ($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_from_filesarray($filesinproductlanguageresolvedarrayref);
1962
1963	($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_with_create_flag_from_directoryarray($dirsinproductlanguageresolvedarrayref, $alldirectoryhash);
1964
1965	# installer::sorter::sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
1966	# if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3.log", $directoriesforepmarrayref); }
1967
1968	#########################################################
1969	# language dependent scpactions part
1970	#########################################################
1971
1972	my $scpactionsinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($scpactionsinproductarrayref, $languagesarrayref);
1973
1974	installer::scriptitems::changing_name_of_language_dependent_keys($scpactionsinproductlanguageresolvedarrayref);
1975
1976	installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist($scpactionsinproductlanguageresolvedarrayref, $includepatharrayref_lang, $dirsinproductlanguageresolvedarrayref, "ScpActions");
1977
1978	# Editing scpactions with flag SCPZIP_REPLACE and PATCH_SO_NAME.
1979
1980	installer::scpzipfiles::resolving_scpzip_replace_flag($scpactionsinproductlanguageresolvedarrayref, $allvariableshashref, "ScpAction", $languagestringref);
1981
1982	installer::scppatchsoname::resolving_patchsoname_flag($scpactionsinproductlanguageresolvedarrayref, $allvariableshashref, "ScpAction", $languagestringref);
1983
1984	#########################################################
1985	# language dependent links part
1986	#########################################################
1987
1988	$installer::logger::Info->print( "... analyzing links ...\n" );
1989
1990	my $linksinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($linksinproductarrayref, $languagesarrayref);
1991
1992	installer::scriptitems::changing_name_of_language_dependent_keys($linksinproductlanguageresolvedarrayref);
1993
1994	installer::scriptitems::get_destination_file_path_for_links($linksinproductlanguageresolvedarrayref, $filesinproductlanguageresolvedarrayref);
1995
1996	installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist($linksinproductlanguageresolvedarrayref, $dirsinproductarrayref);
1997
1998	# Now taking all links that have no FileID but a ShortcutID, linking to another link
1999
2000	installer::scriptitems::get_destination_link_path_for_links($linksinproductlanguageresolvedarrayref);
2001
2002	$linksinproductlanguageresolvedarrayref = installer::scriptitems::remove_workstation_only_items($linksinproductlanguageresolvedarrayref);
2003
2004	installer::scriptitems::resolve_links_with_flag_relative($linksinproductlanguageresolvedarrayref);
2005
2006	#########################################################
2007	# language dependent unix links part
2008	#########################################################
2009
2010	$installer::logger::Info->print( "... analyzing unix links ...\n" );
2011
2012	my $unixlinksinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($unixlinksinproductarrayref, $languagesarrayref);
2013
2014	installer::scriptitems::changing_name_of_language_dependent_keys($unixlinksinproductlanguageresolvedarrayref);
2015
2016	installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist($unixlinksinproductlanguageresolvedarrayref, $dirsinproductarrayref);
2017
2018	#########################################################
2019	# language dependent part for profiles and profileitems
2020	#########################################################
2021
2022	my $profilesinproductlanguageresolvedarrayref;
2023	my $profileitemsinproductlanguageresolvedarrayref;
2024
2025	if ((!($installer::globals::is_copy_only_project)) && (!($installer::globals::product =~ /ada/i )) && (!($installer::globals::languagepack)))
2026	{
2027		$installer::logger::Info->print( "... creating profiles ...\n" );
2028
2029		$profilesinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($profilesinproductarrayref, $languagesarrayref);
2030
2031		$profileitemsinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($profileitemsinproductarrayref, $languagesarrayref);
2032
2033		installer::scriptitems::changing_name_of_language_dependent_keys($profilesinproductlanguageresolvedarrayref);
2034
2035		installer::scriptitems::changing_name_of_language_dependent_keys($profileitemsinproductlanguageresolvedarrayref);
2036
2037		installer::scriptitems::replace_setup_variables($profileitemsinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
2038
2039		if ( $installer::globals::patch_user_dir )
2040		{
2041			installer::scriptitems::replace_userdir_variable(
2042                $profileitemsinproductlanguageresolvedarrayref,
2043                $allvariableshashref);
2044		}
2045
2046		installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist($profilesinproductlanguageresolvedarrayref, $dirsinproductarrayref);
2047
2048		# Now the Profiles can be created
2049
2050		installer::profiles::create_profiles($profilesinproductlanguageresolvedarrayref, $profileitemsinproductlanguageresolvedarrayref, $filesinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
2051	}
2052
2053	my $registryitemsinproductlanguageresolvedarrayref; # cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
2054	my $folderinproductlanguageresolvedarrayref;		# cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
2055	my $folderitemsinproductlanguageresolvedarrayref;	# cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
2056
2057	if ( $installer::globals::iswindowsbuild )	# Windows specific items: Folder, FolderItem, RegistryItem
2058	{
2059		#########################################################
2060		# language dependent part for folder
2061		#########################################################
2062
2063		$installer::logger::Info->print( "... analyzing folder ...\n" );
2064
2065		$folderinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($folderinproductarrayref, $languagesarrayref);
2066
2067		installer::scriptitems::changing_name_of_language_dependent_keys($folderinproductlanguageresolvedarrayref);
2068
2069		#########################################################
2070		# language dependent part for folderitems
2071		#########################################################
2072
2073		$installer::logger::Info->print( "... analyzing folderitems ...\n" );
2074
2075		$folderitemsinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($folderitemsinproductarrayref, $languagesarrayref);
2076
2077		installer::scriptitems::changing_name_of_language_dependent_keys($folderitemsinproductlanguageresolvedarrayref);
2078
2079		#########################################################
2080		# language dependent part for registryitems
2081		#########################################################
2082
2083		$installer::logger::Info->print( "... analyzing registryitems ...\n" );
2084
2085		$registryitemsinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($registryitemsinproductarrayref, $languagesarrayref);
2086
2087		installer::scriptitems::changing_name_of_language_dependent_keys($registryitemsinproductlanguageresolvedarrayref);
2088	}
2089
2090	#########################################################
2091	# language dependent part for modules
2092	#########################################################
2093
2094	my $modulesinproductlanguageresolvedarrayref;
2095
2096	if (!($installer::globals::is_copy_only_project))
2097	{
2098		$installer::logger::Info->print( "... analyzing modules ...\n" );
2099
2100		$modulesinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($modulesinproductarrayref, $languagesarrayref);
2101
2102		$modulesinproductlanguageresolvedarrayref = installer::scriptitems::remove_not_required_language_modules($modulesinproductlanguageresolvedarrayref, $languagesarrayref);
2103
2104		installer::scriptitems::changing_name_of_language_dependent_keys($modulesinproductlanguageresolvedarrayref);
2105
2106		# installer::scriptitems::collect_language_specific_names($modulesinproductlanguageresolvedarrayref);
2107		installer::scriptitems::select_required_language_strings($modulesinproductlanguageresolvedarrayref);	# using english strings
2108	}
2109
2110	# Copy-only projects can now start to copy all items File and ScpAction
2111	if ( $installer::globals::is_copy_only_project ) { installer::copyproject::copy_project($filesinproductlanguageresolvedarrayref, $scpactionsinproductlanguageresolvedarrayref, $loggingdir, $languagestringref, $shipinstalldir, $allsettingsarrayref); }
2112
2113	# Language pack projects can now start to select the required information
2114	if ( $installer::globals::languagepack )
2115	{
2116		$filesinproductlanguageresolvedarrayref = installer::languagepack::select_language_items($filesinproductlanguageresolvedarrayref, $languagesarrayref, "File");
2117		$scpactionsinproductlanguageresolvedarrayref = installer::languagepack::select_language_items($scpactionsinproductlanguageresolvedarrayref, $languagesarrayref, "ScpAction");
2118		$linksinproductlanguageresolvedarrayref = installer::languagepack::select_language_items($linksinproductlanguageresolvedarrayref, $languagesarrayref, "Shortcut");
2119		$unixlinksinproductlanguageresolvedarrayref = installer::languagepack::select_language_items($unixlinksinproductlanguageresolvedarrayref, $languagesarrayref, "Unixlink");
2120		@{$folderitemsinproductlanguageresolvedarrayref} = (); # no folderitems in languagepacks
2121
2122		# Collecting the directories again, to include only the language specific directories
2123		($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_from_filesarray($filesinproductlanguageresolvedarrayref);
2124		($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_with_create_flag_from_directoryarray($dirsinproductlanguageresolvedarrayref, $alldirectoryhash);
2125		installer::sorter::sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
2126
2127		if ( $installer::globals::iswindowsbuild )
2128		{
2129			$registryitemsinproductlanguageresolvedarrayref = installer::worker::select_langpack_items($registryitemsinproductlanguageresolvedarrayref, "RegistryItem");
2130		}
2131
2132	}
2133
2134	# Collecting all files without flag PATCH (for maintenance reasons)
2135	if ( $installer::globals::patch ) { installer::worker::collect_all_files_without_patch_flag($filesinproductlanguageresolvedarrayref); }
2136
2137	# Patch projects can now start to select the required information
2138	if (( $installer::globals::patch ) && (( $installer::globals::issolarispkgbuild ) || ( $installer::globals::iswindowsbuild )))
2139	{
2140		$filesinproductlanguageresolvedarrayref = installer::worker::select_patch_items($filesinproductlanguageresolvedarrayref, "File");
2141		$scpactionsinproductlanguageresolvedarrayref = installer::worker::select_patch_items($scpactionsinproductlanguageresolvedarrayref, "ScpAction");
2142		$linksinproductlanguageresolvedarrayref = installer::worker::select_patch_items($linksinproductlanguageresolvedarrayref, "Shortcut");
2143		$unixlinksinproductlanguageresolvedarrayref = installer::worker::select_patch_items($unixlinksinproductlanguageresolvedarrayref, "Unixlink");
2144		$folderitemsinproductlanguageresolvedarrayref = installer::worker::select_patch_items($folderitemsinproductlanguageresolvedarrayref, "FolderItem");
2145		# @{$folderitemsinproductlanguageresolvedarrayref} = (); # no folderitems in languagepacks
2146
2147		if ( $installer::globals::iswindowsbuild )
2148		{
2149			$registryitemsinproductlanguageresolvedarrayref = installer::worker::select_patch_items_without_name($registryitemsinproductlanguageresolvedarrayref, "RegistryItem");
2150
2151			installer::worker::prepare_windows_patchfiles($filesinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
2152
2153			# For Windows patches, the directories can now be collected again
2154			($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_from_filesarray($filesinproductlanguageresolvedarrayref);
2155
2156			installer::sorter::sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
2157		}
2158	}
2159
2160	#########################################################
2161	# Collecting all scp actions
2162	#########################################################
2163
2164	installer::worker::collect_scpactions($scpactionsinproductlanguageresolvedarrayref);
2165
2166	#########################################################
2167	# creating inf files for user system integration
2168	#########################################################
2169
2170	if (( $installer::globals::iswindowsbuild ) && ( ! $installer::globals::patch ))	# Windows specific items: Folder, FolderItem, RegistryItem
2171	{
2172		$installer::logger::Info->print( "... creating inf files ...\n" );
2173		installer::worker::create_inf_file(
2174            $filesinproductlanguageresolvedarrayref,
2175            $registryitemsinproductlanguageresolvedarrayref,
2176            $folderinproductlanguageresolvedarrayref,
2177            $folderitemsinproductlanguageresolvedarrayref,
2178            $modulesinproductlanguageresolvedarrayref,
2179            $languagesarrayref,
2180            $languagestringref,
2181            $allvariableshashref);
2182	}
2183
2184	###########################################
2185	# Using upx, to decrease file size
2186	# Currently only for Windows.
2187	###########################################
2188
2189	if ( $allvariableshashref->{'UPXPRODUCT'} )
2190	{
2191		installer::upx::upx_on_libraries($filesinproductlanguageresolvedarrayref, $languagestringref);
2192	}
2193
2194	###########################################################
2195	# Simple package projects can now start to create the
2196	# installation structure by creating Directories, Files
2197	# Links and ScpActions. This is the last platform
2198	# independent part.
2199	###########################################################
2200
2201	if ( $installer::globals::is_simple_packager_project )
2202	{
2203		installer::simplepackage::create_simple_package($filesinproductlanguageresolvedarrayref, $directoriesforepmarrayref, $scpactionsinproductlanguageresolvedarrayref, $linksinproductlanguageresolvedarrayref, $unixlinksinproductlanguageresolvedarrayref, $loggingdir, $languagestringref, $shipinstalldir, $allsettingsarrayref, $allvariableshashref, $includepatharrayref);
2204		next; # ! leaving the current loop, because no further packaging required.
2205	}
2206
2207	###########################################################
2208	# Analyzing the package structure
2209	###########################################################
2210
2211	$installer::logger::Info->print( "... analyzing package list ...\n" );
2212
2213	my $packages = installer::packagelist::collectpackages($modulesinproductlanguageresolvedarrayref, $languagesarrayref);
2214	installer::packagelist::check_packagelist($packages);
2215
2216	$packages = installer::packagelist::analyze_list($packages, $modulesinproductlanguageresolvedarrayref);
2217	installer::packagelist::remove_multiple_modules_packages($packages);
2218
2219	# printing packages content:
2220	installer::packagelist::log_packages_content($packages);
2221	installer::packagelist::create_module_destination_hash($packages, $allvariableshashref);
2222
2223	#################################################
2224	# Part 2: The platform dependent part
2225	#################################################
2226
2227	if ( $installer::globals::iswindowsbuild )
2228    {
2229        # Create .idt tables and a .msi file.
2230        MakeWindowsBuild(
2231            $allvariableshashref,
2232            $allsettingsarrayref,
2233            $current_install_number,
2234            $directoriesforepmarrayref,
2235            $filesinproductlanguageresolvedarrayref,
2236            $folderitemsinproductlanguageresolvedarrayref,
2237            $includepatharrayref,
2238            $includepatharrayref_lang,
2239            $installdir,
2240            $languagesarrayref,
2241            $languagestringref,
2242            $linksinproductlanguageresolvedarrayref,
2243            $loggingdir,
2244            $modulesinproductlanguageresolvedarrayref,
2245            $packages,
2246            $profileitemsinproductlanguageresolvedarrayref,
2247            $registryitemsinproductlanguageresolvedarrayref,
2248            $shipinstalldir,
2249            $windowscustomactionsarrayref,
2250            $folderinproductlanguageresolvedarrayref);
2251    }
2252    else
2253    {
2254        # Creating epm list file.
2255        MakeNonWindowsBuild(
2256            $allvariableshashref,
2257            $allsettingsarrayref,
2258            $current_install_number,
2259            $directoriesforepmarrayref,
2260            $filesinproductlanguageresolvedarrayref,
2261            $includepatharrayref,
2262            $languagesarrayref,
2263            $languagestringref,
2264            $linksinproductlanguageresolvedarrayref,
2265            $unixlinksinproductlanguageresolvedarrayref,
2266            $loggingdir,
2267            $modulesinproductarrayref,
2268            $packages,
2269            $shipinstalldir,
2270            $currentdir);
2271    }
2272
2273	# saving file_info file for later analysis
2274	my $speciallogfilename = "fileinfo_" . $installer::globals::product . "\.log";
2275	installer::files::save_array_of_hashes($loggingdir . $speciallogfilename, $filesinproductlanguageresolvedarrayref);
2276}
2277
2278# saving debug info at end
2279if ( $installer::globals::debug ) { installer::logger::savedebug($installer::globals::exitlog); }
2280
2281#######################################################
2282# Stopping time
2283#######################################################
2284
2285installer::logger::stoptime();
2286
2287####################################
2288# Main program end
2289####################################
2290