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