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