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