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