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