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