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