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