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