1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: make_installer.pl,v $
11 # This file is part of OpenOffice.org.
13 # OpenOffice.org is free software: you can redistribute it and/or modify
14 # it under the terms of the GNU Lesser General Public License version 3
15 # only, as published by the Free Software Foundation.
17 # OpenOffice.org is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU Lesser General Public License version 3 for more details
21 # (a copy is included in the LICENSE file that accompanied this code).
23 # You should have received a copy of the GNU Lesser General Public License
24 # version 3 along with OpenOffice.org. If not, see
25 # <http://www.openoffice.org/license.html>
26 # for a copy of the LGPLv3 License.
28 #*************************************************************************
34 use lib
("$ENV{SOLARENV}/bin/modules");
38 use installer
::archivefiles
;
39 use installer
::control
;
40 use installer
::converter
;
41 use installer
::copyproject
;
42 use installer
::download
;
43 use installer
::environment
;
44 use installer
::epmfile
;
45 use installer
::exiter
;
47 use installer
::followme
;
48 use installer
::globals
;
49 use installer
::javainstaller
;
50 use installer
::languagepack
;
51 use installer
::languages
;
52 use installer
::logger
;
54 use installer
::packagelist
;
55 use installer
::packagepool
;
56 use installer
::parameter
;
57 use installer
::pathanalyzer
;
58 use installer
::profiles
;
59 use installer
::regmerge
;
60 use installer
::scppatchsoname
;
61 use installer
::scpzipfiles
;
62 use installer
::scriptitems
;
63 use installer
::servicesfile
;
64 use installer
::setupscript
;
65 use installer
::simplepackage
;
66 use installer
::sorter
;
68 use installer
::substfilenamefiles
;
70 use installer
::systemactions
;
71 use installer
::windows
::assembly
;
72 use installer
::windows
::binary
;
73 use installer
::windows
::component
;
74 use installer
::windows
::createfolder
;
75 use installer
::windows
::directory
;
76 use installer
::windows
::feature
;
77 use installer
::windows
::featurecomponent
;
78 use installer
::windows
::file
;
79 use installer
::windows
::font
;
80 use installer
::windows
::icon
;
81 use installer
::windows
::idtglobal
;
82 use installer
::windows
::inifile
;
83 use installer
::windows
::java
;
84 use installer
::windows
::media
;
85 use installer
::windows
::mergemodule
;
86 use installer
::windows
::msiglobal
;
87 use installer
::windows
::msp
;
88 use installer
::windows
::patch
;
89 use installer
::windows
::property
;
90 use installer
::windows
::removefile
;
91 use installer
::windows
::registry
;
92 use installer
::windows
::selfreg
;
93 use installer
::windows
::shortcut
;
94 use installer
::windows
::strip
;
95 use installer
::windows
::update
;
96 use installer
::windows
::upgrade
;
97 use installer
::worker
;
98 use installer
::xpdinstaller
;
99 use installer
::ziplist
;
101 #################################################
103 #################################################
105 #################################################
106 # Part 1: The platform independent part
107 #################################################
109 #################################################
110 # Part 1a: The language independent part
111 #################################################
113 installer
::logger
::starttime
();
115 #########################################
116 # Checking the environment and setting
117 # most important variables
118 #########################################
120 installer
::logger
::print_message
( "... checking environment variables ...\n" );
121 my $environmentvariableshashref = installer
::control
::check_system_environment
();
123 installer
::environment
::set_global_environment_variables
($environmentvariableshashref);
125 #################################
126 # Check and output of parameter
127 #################################
129 installer
::parameter
::saveparameter
();
130 installer
::parameter
::getparameter
();
132 # debugging can start after function "getparameter"
133 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 1: The platform independent part\n"); }
134 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 1a: The language independent part\n"); }
136 installer
::parameter
::control_fundamental_parameter
();
137 installer
::parameter
::setglobalvariables
();
138 installer
::parameter
::control_required_parameter
();
140 if (!($installer::globals
::languages_defined_in_productlist
)) { installer
::languages
::analyze_languagelist
(); }
141 installer
::parameter
::outputparameter
();
143 installer
::control
::check_updatepack
();
145 $installer::globals
::build
= uc($installer::globals
::build
); # using "SRC680" instead of "src680"
147 ######################################
148 # Creating the log directory
149 ######################################
151 my $loggingdir = installer
::systemactions
::create_directories
("logging", "");
152 $loggingdir = $loggingdir . $installer::globals
::separator
;
153 $installer::globals
::exitlog
= $loggingdir;
156 my $currentdir = cwd
();
157 my $shipinstalldir = "";
158 my $current_install_number = "";
160 ######################################
161 # Checking the system requirements
162 ######################################
164 installer
::logger
::print_message
( "... checking required files ...\n" );
165 installer
::control
::check_system_path
();
167 my $pathvariableshashref = installer
::environment
::create_pathvariables
($environmentvariableshashref);
169 ###############################################
170 # Checking saved setting for Windows patches
171 ###############################################
173 if (( $installer::globals
::iswindowsbuild
) && ( $installer::globals
::prepare_winpatch
)) { installer
::windows
::msiglobal
::read_saved_mappings
(); }
175 ###################################################
176 # Analyzing the settings and variables in zip.lst
177 ###################################################
179 installer
::logger
::globallog
("zip list file: $installer::globals::ziplistname");
181 my $ziplistref = installer
::files
::read_file
($installer::globals
::ziplistname
);
183 installer
::logger
::print_message
( "... analyzing $installer::globals::ziplistname ... \n" );
185 my ($productblockref, $parent) = installer
::ziplist
::getproductblock
($ziplistref, $installer::globals
::product
, 1); # product block from zip.lst
186 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "productblock.log" ,$productblockref); }
188 my ($settingsblockref, undef) = installer
::ziplist
::getproductblock
($productblockref, "Settings", 0); # settings block from zip.lst
189 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "settingsblock1.log" ,$settingsblockref); }
191 $settingsblockref = installer
::ziplist
::analyze_settings_block
($settingsblockref); # select data from settings block in zip.lst
192 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "settingsblock2.log" ,$settingsblockref); }
194 my $allsettingsarrayref = installer
::ziplist
::get_settings_from_ziplist
($settingsblockref);
195 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allsettings1.log" ,$allsettingsarrayref); }
197 my $allvariablesarrayref = installer
::ziplist
::get_variables_from_ziplist
($settingsblockref);
198 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allvariables1.log" ,$allvariablesarrayref); }
200 my ($globalproductblockref, undef) = installer
::ziplist
::getproductblock
($ziplistref, $installer::globals
::globalblock
, 0); # global product block from zip.lst
201 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "globalproductblock.log" ,$globalproductblockref); }
203 while (defined $parent)
205 my $parentproductblockref;
206 ($parentproductblockref, $parent) = installer
::ziplist
::getproductblock
(
207 $ziplistref, $parent, 1);
208 my ($parentsettingsblockref, undef) = installer
::ziplist
::getproductblock
(
209 $parentproductblockref, "Settings", 0);
210 $parentsettingsblockref = installer
::ziplist
::analyze_settings_block
(
211 $parentsettingsblockref);
212 my $allparentsettingsarrayref =
213 installer
::ziplist
::get_settings_from_ziplist
($parentsettingsblockref);
214 my $allparentvariablesarrayref =
215 installer
::ziplist
::get_variables_from_ziplist
($parentsettingsblockref);
216 $allsettingsarrayref =
217 installer
::converter
::combine_arrays_from_references_first_win
(
218 $allsettingsarrayref, $allparentsettingsarrayref)
219 if $#{$allparentsettingsarrayref} > -1;
220 $allvariablesarrayref =
221 installer
::converter
::combine_arrays_from_references_first_win
(
222 $allvariablesarrayref, $allparentvariablesarrayref)
223 if $#{$allparentvariablesarrayref} > -1;
226 if ( $#{$globalproductblockref} > -1 )
228 my ($globalsettingsblockref, undef) = installer
::ziplist
::getproductblock
($globalproductblockref, "Settings", 0); # settings block from zip.lst
229 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "globalsettingsblock1.log" ,$globalsettingsblockref); }
231 $globalsettingsblockref = installer
::ziplist
::analyze_settings_block
($globalsettingsblockref); # select data from settings block in zip.lst
232 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "globalsettingsblock2.log" ,$globalsettingsblockref); }
234 my $allglobalsettingsarrayref = installer
::ziplist
::get_settings_from_ziplist
($globalsettingsblockref);
235 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allglobalsettings1.log" ,$allglobalsettingsarrayref); }
237 my $allglobalvariablesarrayref = installer
::ziplist
::get_variables_from_ziplist
($globalsettingsblockref);
238 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allglobalvariables1.log" ,$allglobalvariablesarrayref); }
240 if ( $#{$allglobalsettingsarrayref} > -1 ) { $allsettingsarrayref = installer::converter::combine_arrays_from_references_first_win($allsettingsarrayref, $allglobalsettingsarrayref); }
241 if ( $#{$allglobalvariablesarrayref} > -1 ) { $allvariablesarrayref = installer::converter::combine_arrays_from_references_first_win($allvariablesarrayref, $allglobalvariablesarrayref); }
244 $allsettingsarrayref = installer
::ziplist
::remove_multiples_from_ziplist
($allsettingsarrayref); # the settings from the zip.lst
245 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allsettings2.log" ,$allsettingsarrayref); }
247 $allvariablesarrayref = installer
::ziplist
::remove_multiples_from_ziplist
($allvariablesarrayref);
248 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allvariables2.log" ,$allvariablesarrayref); }
250 installer
::ziplist
::replace_variables_in_ziplist_variables
($allvariablesarrayref);
251 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allvariables2a.log" ,$allvariablesarrayref); }
253 my $allvariableshashref = installer
::converter
::convert_array_to_hash
($allvariablesarrayref); # the variables from the zip.lst
254 if ( $installer::globals
::globallogging
) { installer
::files
::save_hash
($loggingdir . "allvariables3.log", $allvariableshashref); }
256 installer
::ziplist
::set_default_productversion_if_required
($allvariableshashref);
257 if ( $installer::globals
::globallogging
) { installer
::files
::save_hash
($loggingdir . "allvariables3a.log", $allvariableshashref); }
259 installer
::ziplist
::add_variables_to_allvariableshashref
($allvariableshashref);
260 if ( $installer::globals
::globallogging
) { installer
::files
::save_hash
($loggingdir . "allvariables3b.log", $allvariableshashref); }
262 ########################################################
263 # Check if this is simple packaging mechanism
264 ########################################################
266 installer
::simplepackage
::check_simple_packager_project
($allvariableshashref);
268 ####################################################################
269 # setting global variables
270 ####################################################################
272 installer
::control
::set_addchildprojects
($allvariableshashref);
273 installer
::control
::set_addjavainstaller
($allvariableshashref);
274 installer
::control
::set_addsystemintegration
($allvariableshashref);
276 ########################################################
277 # Re-define logging dir, after all variables are set
278 ########################################################
280 my $oldloggingdir = $loggingdir;
281 installer
::systemactions
::remove_empty_directory
($oldloggingdir);
282 $loggingdir = installer
::systemactions
::create_directories
("logging", "");
283 $loggingdir = $loggingdir . $installer::globals
::separator
;
284 $installer::globals
::exitlog
= $loggingdir;
286 # checking, whether this is an opensource product
288 if (!($installer::globals
::is_copy_only_project
)) { installer
::ziplist
::set_manufacturer
($allvariableshashref); }
290 ##############################################
291 # Checking version of makecab.exe
292 ##############################################
294 if ( $installer::globals
::iswindowsbuild
) { installer
::control
::check_makecab_version
(); }
296 ##########################################################
297 # Getting the include path from the settings in zip list
298 ##########################################################
300 my $includepathref = installer
::ziplist
::getinfofromziplist
($allsettingsarrayref, "include");
301 if ( $$includepathref eq "" )
303 installer
::exiter
::exit_program
("ERROR: Definition for \"include\" not found in $installer::globals::ziplistname", "Main");
306 my $includepatharrayref = installer
::converter
::convert_stringlist_into_array
($includepathref, ",");
307 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray1.log" ,$includepatharrayref); }
309 installer
::ziplist
::replace_all_variables_in_pathes
($includepatharrayref, $pathvariableshashref);
310 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray2.log" ,$includepatharrayref); }
312 installer
::ziplist
::replace_minor_in_pathes
($includepatharrayref);
313 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray3.log" ,$includepatharrayref); }
315 installer
::ziplist
::replace_packagetype_in_pathes
($includepatharrayref);
316 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray3a.log" ,$includepatharrayref); }
318 installer
::ziplist
::resolve_relative_pathes
($includepatharrayref);
319 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray3b.log" ,$includepatharrayref); }
321 installer
::ziplist
::remove_ending_separator
($includepatharrayref);
322 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray3c.log" ,$includepatharrayref); }
324 ##############################################
325 # Collecting all files from all include
326 # pathes in global hashes.
327 ##############################################
329 installer
::worker
::collect_all_files_from_includepathes
($includepatharrayref);
331 ##############################################
332 # Analyzing languages in zip.lst if required
333 # Probably no longer used.
334 ##############################################
336 if ($installer::globals
::languages_defined_in_productlist
) { installer
::languages
::get_info_about_languages
($allsettingsarrayref); }
338 #####################################
339 # Windows requires the encoding list
340 #####################################
342 if ( $installer::globals
::iswindowsbuild
) { installer
::control
::read_encodinglist
($includepatharrayref); }
344 #####################################################################
345 # Including additional inc files for variable settings, if defined
346 #####################################################################
348 if ( $allvariableshashref->{'ADD_INCLUDE_FILES'} ) { installer
::worker
::add_variables_from_inc_to_hashref
($allvariableshashref, $includepatharrayref); }
350 ################################################
351 # Disable xpd installer, if SOLAR_JAVA not set
352 ################################################
354 installer
::control
::check_java_for_xpd
($allvariableshashref);
356 #####################################
357 # Analyzing the setup script
358 #####################################
360 if ($installer::globals
::setupscript_defined_in_productlist
) { installer
::setupscript
::set_setupscript_name
($allsettingsarrayref, $includepatharrayref); }
362 installer
::logger
::globallog
("setup script file: $installer::globals::setupscriptname");
364 installer
::logger
::print_message
( "... analyzing script: $installer::globals::setupscriptname ... \n" );
366 my $setupscriptref = installer
::files
::read_file
($installer::globals
::setupscriptname
); # Reading the setup script file
368 # Resolving variables defined in the zip list file into setup script
369 # All the variables are defined in $allvariablesarrayref
371 installer
::scpzipfiles
::replace_all_ziplistvariables_in_file
($setupscriptref, $allvariableshashref);
372 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscript1.log" ,$setupscriptref); }
374 # Resolving %variables defined in the installation object
376 my $allscriptvariablesref = installer
::setupscript
::get_all_scriptvariables_from_installation_object
($setupscriptref);
377 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscriptvariables1.log" ,$allscriptvariablesref); }
379 installer
::setupscript
::add_lowercase_productname_setupscriptvariable
($allscriptvariablesref);
380 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscriptvariables2.log" ,$allscriptvariablesref); }
382 installer
::setupscript
::resolve_lowercase_productname_setupscriptvariable
($allscriptvariablesref);
383 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscriptvariables3.log" ,$allscriptvariablesref); }
385 $setupscriptref = installer
::setupscript
::replace_all_setupscriptvariables_in_script
($setupscriptref, $allscriptvariablesref);
386 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscript2.log" ,$setupscriptref); }
388 # Adding all variables defined in the installation object into the hash of all variables.
389 # This is needed if variables are defined in the installation object, but not in the zip list file.
390 # If there is a definition in the zip list file and in the installation object, the installation object is more important
392 installer
::setupscript
::add_installationobject_to_variables
($allvariableshashref, $allscriptvariablesref);
393 if ( $installer::globals
::globallogging
) { installer
::files
::save_hash
($loggingdir . "allvariables4.log", $allvariableshashref); }
395 # Adding also all variables, that must be included into the $allvariableshashref.
396 installer
::setupscript
::add_forced_properties
($allvariableshashref);
397 if ( $installer::globals
::globallogging
) { installer
::files
::save_hash
($loggingdir . "allvariables5.log", $allvariableshashref); }
399 installer
::scpzipfiles
::replace_all_ziplistvariables_in_file
($setupscriptref, $allvariableshashref);
400 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscript3.log" ,$setupscriptref); }
402 installer
::logger
::log_hashref
($allvariableshashref);
404 installer
::logger
::print_message
( "... analyzing directories ... \n" );
406 # Collect all directories in the script to get the destination dirs
408 my $dirsinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Directory");
409 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories1.log", $dirsinproductarrayref); }
411 if ( $installer::globals
::languagepack
) { installer
::scriptitems
::use_langpack_hostname
($dirsinproductarrayref); }
412 if ( $installer::globals
::patch
) { installer
::scriptitems
::use_patch_hostname
($dirsinproductarrayref); }
413 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories1a.log", $dirsinproductarrayref); }
415 if ( $allvariableshashref->{'SHIFT_BASIS_INTO_BRAND_LAYER'} ) { $dirsinproductarrayref = installer
::scriptitems
::shift_basis_directory_parents
($dirsinproductarrayref); }
416 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories1b.log", $dirsinproductarrayref); }
417 if ( $allvariableshashref->{'OFFICEDIRECTORYNAME'} ) { installer
::scriptitems
::set_officedirectory_name
($dirsinproductarrayref, $allvariableshashref->{'OFFICEDIRECTORYNAME'}); }
418 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories1b.log", $dirsinproductarrayref); }
421 installer
::scriptitems
::resolve_all_directory_names
($dirsinproductarrayref);
422 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories2.log", $dirsinproductarrayref); }
424 installer
::logger
::print_message
( "... analyzing files ... \n" );
426 my $filesinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "File");
427 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles1.log", $filesinproductarrayref); }
429 $filesinproductarrayref = installer
::scriptitems
::remove_delete_only_files_from_productlists
($filesinproductarrayref);
430 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2.log", $filesinproductarrayref); }
432 if (( ! $installer::globals
::iswindowsbuild
) &&
433 ( ! $installer::globals
::islinuxrpmbuild
) &&
434 ( ! $installer::globals
::islinuxdebbuild
) &&
435 ( ! $installer::globals
::issolarispkgbuild
) &&
436 ( $installer::globals
::packageformat
ne "installed" ) &&
437 ( $installer::globals
::packageformat
ne "dmg" ) &&
438 ( $installer::globals
::packageformat
ne "archive" ))
439 { installer
::control
::check_oxtfiles
($filesinproductarrayref); }
441 if ($installer::globals
::product
=~ /suite/i ) { $filesinproductarrayref = installer
::scriptitems
::remove_notinsuite_files_from_productlists
($filesinproductarrayref); }
442 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2aa.log", $filesinproductarrayref); }
444 if (! $installer::globals
::languagepack
)
446 $filesinproductarrayref = installer
::scriptitems
::remove_Languagepacklibraries_from_Installset
($filesinproductarrayref);
447 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2b.log", $filesinproductarrayref); }
450 if (! $installer::globals
::patch
)
452 $filesinproductarrayref = installer
::scriptitems
::remove_patchonlyfiles_from_Installset
($filesinproductarrayref);
453 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2c.log", $filesinproductarrayref); }
456 if (! $installer::globals
::tab
)
458 $filesinproductarrayref = installer
::scriptitems
::remove_tabonlyfiles_from_Installset
($filesinproductarrayref);
459 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2c.log", $filesinproductarrayref); }
462 if (( $installer::globals
::packageformat
ne "installed" ) && ( $installer::globals
::packageformat
ne "archive" ))
464 $filesinproductarrayref = installer
::scriptitems
::remove_installedproductonlyfiles_from_Installset
($filesinproductarrayref);
465 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2cc.log", $filesinproductarrayref); }
468 installer
::logger
::print_message
( "... analyzing scpactions ... \n" );
470 my $scpactionsinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "ScpAction");
471 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions1.log", $scpactionsinproductarrayref); }
473 if (( ! $allvariableshashref->{'XPDINSTALLER'} ) || ( ! $installer::globals
::isxpdplatform
))
475 $scpactionsinproductarrayref = installer
::scriptitems
::remove_Xpdonly_Items
($scpactionsinproductarrayref);
476 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions1a.log", $scpactionsinproductarrayref); }
479 if ( $installer::globals
::languagepack
) { installer
::scriptitems
::use_langpack_copy_scpaction
($scpactionsinproductarrayref); }
480 if ( $installer::globals
::patch
) { installer
::scriptitems
::use_patch_copy_scpaction
($scpactionsinproductarrayref); }
481 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions1b.log", $scpactionsinproductarrayref); }
483 # $scpactionsinproductarrayref = installer::scriptitems::remove_scpactions_without_name($scpactionsinproductarrayref);
484 # if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions2.log", $scpactionsinproductarrayref); }
486 installer
::scriptitems
::change_keys_of_scpactions
($scpactionsinproductarrayref);
487 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions2.log", $scpactionsinproductarrayref); }
489 installer
::logger
::print_message
( "... analyzing shortcuts ... \n" );
491 my $linksinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Shortcut");
492 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks1.log", $linksinproductarrayref); }
494 installer
::logger
::print_message
( "... analyzing unix links ... \n" );
496 my $unixlinksinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Unixlink");
497 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks1.log", $unixlinksinproductarrayref); }
499 # $unixlinksinproductarrayref = installer::scriptitems::filter_layerlinks_from_unixlinks($unixlinksinproductarrayref);
500 # if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks1b.log", $unixlinksinproductarrayref); }
502 installer
::logger
::print_message
( "... analyzing profile ... \n" );
504 my $profilesinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Profile");
505 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profiles1.log", $profilesinproductarrayref); }
507 installer
::logger
::print_message
( "... analyzing profileitems ... \n" );
509 my $profileitemsinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "ProfileItem");
510 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profileitems1.log", $profileitemsinproductarrayref); }
512 my $folderinproductarrayref;
513 my $folderitemsinproductarrayref;
514 my $registryitemsinproductarrayref;
515 my $windowscustomactionsarrayref;
516 my $mergemodulesarrayref;
518 if ( $installer::globals
::iswindowsbuild
) # Windows specific items: Folder, FolderItem, RegistryItem, WindowsCustomAction
520 installer
::logger
::print_message
( "... analyzing folders ... \n" );
522 $folderinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Folder");
523 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folder1.log", $folderinproductarrayref); }
525 installer
::logger
::print_message
( "... analyzing folderitems ... \n" );
527 $folderitemsinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "FolderItem");
528 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folderitems1.log", $folderitemsinproductarrayref); }
530 installer
::setupscript
::add_predefined_folder
($folderitemsinproductarrayref, $folderinproductarrayref);
531 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folder1b.log", $folderinproductarrayref); }
533 installer
::setupscript
::prepare_non_advertised_files
($folderitemsinproductarrayref, $filesinproductarrayref);
534 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2d.log", $filesinproductarrayref); }
536 installer
::logger
::print_message
( "... analyzing registryitems ... \n" );
538 $registryitemsinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "RegistryItem");
539 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems1.log", $registryitemsinproductarrayref); }
541 $registryitemsinproductarrayref = installer
::scriptitems
::remove_uninstall_regitems_from_script
($registryitemsinproductarrayref);
542 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems1b.log", $registryitemsinproductarrayref); }
544 installer
::logger
::print_message
( "... analyzing Windows custom actions ... \n" );
546 $windowscustomactionsarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "WindowsCustomAction");
547 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "windowscustomactions1.log", $windowscustomactionsarrayref); }
549 installer
::logger
::print_message
( "... analyzing Windows merge modules ... \n" );
551 $mergemodulesarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "MergeModule");
552 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "mergemodules1.log", $mergemodulesarrayref); }
555 my $modulesinproductarrayref;
557 if (!($installer::globals
::is_copy_only_project
))
559 installer
::logger
::print_message
( "... analyzing modules ... \n" );
561 $modulesinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Module");
562 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules1.log", $modulesinproductarrayref); }
564 if (( ! $allvariableshashref->{'XPDINSTALLER'} ) || ( ! $installer::globals
::isxpdplatform
))
566 $modulesinproductarrayref = installer
::scriptitems
::remove_Xpdonly_Items
($modulesinproductarrayref);
567 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules1a.log", $modulesinproductarrayref); }
570 installer
::scriptitems
::resolve_assigned_modules
($modulesinproductarrayref);
571 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules1b.log", $modulesinproductarrayref); }
573 $modulesinproductarrayref = installer
::scriptitems
::remove_template_modules
($modulesinproductarrayref);
574 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules1c.log", $modulesinproductarrayref); }
576 installer
::scriptitems
::set_children_flag
($modulesinproductarrayref);
577 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules1d.log", $modulesinproductarrayref); }
579 installer
::scriptitems
::collect_all_languagemodules
($modulesinproductarrayref);
581 # Assigning the modules to the items
583 installer
::scriptitems
::assigning_modules_to_items
($modulesinproductarrayref, $filesinproductarrayref, "Files");
584 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles3.log", $filesinproductarrayref); }
586 installer
::scriptitems
::assigning_modules_to_items
($modulesinproductarrayref, $unixlinksinproductarrayref, "Unixlinks");
587 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks2.log", $unixlinksinproductarrayref); }
589 installer
::scriptitems
::assigning_modules_to_items
($modulesinproductarrayref, $dirsinproductarrayref, "Dirs");
590 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories2aa.log", $dirsinproductarrayref); }
593 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nEnd of part 1a: The language independent part\n"); }
595 # saving debug info, before staring part 1b
596 if ( $installer::globals
::debug
) { installer
::logger
::savedebug
($installer::globals
::exitlog
); }
598 #################################################
599 # Part 1b: The language dependent part
600 # (still platform independent)
601 #################################################
603 # Now starts the language dependent part, if more than one product is defined on the command line
604 # Example -l en-US,de#es,fr,it defines two multilingual products
606 ###############################################################################
607 # Beginning of language dependent part
608 # The for iterates over all products, separated by an # in the language list
609 ###############################################################################
611 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 1b: The language dependent part\n"); }
613 for ( my $n = 0; $n <= $#installer::globals
::languageproducts
; $n++ )
615 my $languagesarrayref = installer
::languages
::get_all_languages_for_one_product
($installer::globals
::languageproducts
[$n], $allvariableshashref);
616 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "languages.log" ,$languagesarrayref); }
618 $installer::globals
::alllanguagesinproductarrayref
= $languagesarrayref;
619 my $languagestringref = installer
::languages
::get_language_string
($languagesarrayref);
620 installer
::logger
::print_message
( "------------------------------------\n" );
621 installer
::logger
::print_message
( "... languages $$languagestringref ... \n" );
623 if ( $installer::globals
::patch
)
625 $installer::globals
::addlicensefile
= 0; # no license files for patches
626 $installer::globals
::makedownload
= 0;
627 $installer::globals
::makejds
= 0;
630 if ( $installer::globals
::languagepack
)
632 $installer::globals
::addchildprojects
= 0;
633 $installer::globals
::addsystemintegration
= 0;
634 $installer::globals
::makejds
= 0;
635 $installer::globals
::addlicensefile
= 0;
637 if ( $allvariableshashref->{'OPENSOURCE'} ) { $installer::globals
::makedownload
= 1; }
638 else { $installer::globals
::makedownload
= 0; }
641 ############################################################
642 # Beginning of language specific logging mechanism
643 # Until now only global logging into default: logfile.txt
644 ############################################################
646 @installer::globals
::logfileinfo
= (); # new logfile array and new logfile name
647 installer
::logger
::copy_globalinfo_into_logfile
();
648 $installer::globals
::globalinfo_copied
= 1;
651 my $avoidlanginlog = 0;
652 if ( $installer::globals
::updatepack
) { $logminor = $installer::globals
::lastminor
; }
653 else { $logminor = $installer::globals
::minor
; }
655 my $loglanguagestring = $$languagestringref;
656 my $loglanguagestring_orig = $loglanguagestring;
657 if (length($loglanguagestring) > $installer::globals
::max_lang_length
)
659 chomp(my $shorter = `echo $loglanguagestring | md5sum | sed -e "s/ .*//g"`);
660 $loglanguagestring = $shorter;
664 $installer::globals
::logfilename
= "log_" . $installer::globals
::build
;
665 if ( $logminor ne "" ) { $installer::globals
::logfilename
.= "_" . $logminor; }
666 if ( ! $avoidlanginlog ) { $installer::globals
::logfilename
.= "_" . $loglanguagestring; }
667 $installer::globals
::logfilename
.= ".log";
668 $loggingdir = $loggingdir . $loglanguagestring . $installer::globals
::separator
;
669 installer
::systemactions
::create_directory
($loggingdir);
671 if ($loglanguagestring ne $loglanguagestring_orig) {
672 (my $dir = $loggingdir) =~ s!/$!!;
673 open(my $F1, "> $dir.dir");
674 open(my $F2, "> " . $loggingdir . $installer::globals
::logfilename
. '.file');
675 my @s = map { "$_\n" } split('_', $loglanguagestring_orig);
680 $installer::globals
::exitlog
= $loggingdir;
682 ##############################################################
683 # Determining the ship location, if this is an update pack
684 ##############################################################
686 if ( $installer::globals
::updatepack
) { $shipinstalldir = installer
::control
::determine_ship_directory
($languagestringref); }
688 ###################################################################
689 # Reading an existing msi database, to prepare update and patch
690 ###################################################################
692 my $refdatabase = "";
693 my $uniquefilename = "";
694 my $revuniquefilename = "";
695 my $revshortfilename = "";
696 my $allupdatesequences = "";
697 my $allupdatecomponents = "";
698 my $allupdatefileorder = "";
699 my $allupdatecomponentorder = "";
700 my $shortdirname = "";
701 my $componentid = "";
702 my $componentidkeypath = "";
703 my $alloldproperties = "";
704 my $allupdatelastsequences = "";
705 my $allupdatediskids = "";
707 if ( $installer::globals
::iswindowsbuild
)
709 if ( $allvariableshashref->{'UPDATE_DATABASE'} )
711 installer
::logger
::print_message
( "... analyzing update database ...\n" );
712 $refdatabase = installer
::windows
::update
::readdatabase
($allvariableshashref, $languagestringref, $includepatharrayref);
714 if ( $installer::globals
::updatedatabase
)
716 ($uniquefilename, $revuniquefilename, $revshortfilename, $allupdatesequences, $allupdatecomponents, $allupdatefileorder, $allupdatecomponentorder, $shortdirname, $componentid, $componentidkeypath, $alloldproperties, $allupdatelastsequences, $allupdatediskids) = installer
::windows
::update
::create_database_hashes
($refdatabase);
717 if ( $mergemodulesarrayref > -1 ) { installer
::windows
::update
::readmergedatabase
($mergemodulesarrayref, $languagestringref, $includepatharrayref); }
722 ##############################################
723 # Setting global code variables for Windows
724 ##############################################
726 if (!($installer::globals
::is_copy_only_project
))
728 if ( $installer::globals
::iswindowsbuild
)
730 installer
::windows
::msiglobal
::set_global_code_variables
($languagesarrayref, $languagestringref, $allvariableshashref, $alloldproperties);
734 ################################################
735 # Resolving include paths (language dependent)
736 ################################################
738 $includepatharrayref_lang = installer
::ziplist
::replace_languages_in_pathes
($includepatharrayref, $languagesarrayref);
739 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray4.log" ,$includepatharrayref_lang); }
741 if ( $installer::globals
::refresh_includepathes
) { installer
::worker
::collect_all_files_from_includepathes
($includepatharrayref_lang); }
743 installer
::ziplist
::list_all_files_from_include_path
($includepatharrayref_lang);
745 ##############################################
746 # Analyzing spellchecker languages
747 ##############################################
749 if ( $allvariableshashref->{'SPELLCHECKERFILE'} ) { installer
::worker
::set_spellcheckerlanguages
($languagesarrayref, $allvariableshashref); }
751 #####################################
752 # Language dependent directory part
753 #####################################
755 my $dirsinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($dirsinproductarrayref, $languagesarrayref);
756 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories3.log", $dirsinproductlanguageresolvedarrayref); }
757 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories2a.log", $dirsinproductarrayref); }
759 # A new directory array is needed ($dirsinproductlanguageresolvedarrayref instead of $dirsinproductarrayref)
760 # because $dirsinproductarrayref is needed in get_Destination_Directory_For_Item_From_Directorylist
762 installer
::scriptitems
::changing_name_of_language_dependent_keys
($dirsinproductlanguageresolvedarrayref);
763 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories4.log", $dirsinproductlanguageresolvedarrayref); }
765 installer
::scriptitems
::checking_directories_with_corrupt_hostname
($dirsinproductlanguageresolvedarrayref, $languagesarrayref);
767 installer
::scriptitems
::set_global_directory_hostnames
($dirsinproductlanguageresolvedarrayref, $allvariableshashref);
769 #####################################
770 # files part, language dependent
771 #####################################
773 installer
::logger
::print_message
( "... analyzing files ...\n" );
775 my $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($filesinproductarrayref, $languagesarrayref);
776 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles4.log", $filesinproductlanguageresolvedarrayref); }
778 if ( ! $installer::globals
::set_office_start_language
)
780 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_office_start_language_files
($filesinproductlanguageresolvedarrayref);
781 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles4b.log", $filesinproductlanguageresolvedarrayref); }
784 installer
::scriptitems
::changing_name_of_language_dependent_keys
($filesinproductlanguageresolvedarrayref);
785 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles5.log", $filesinproductlanguageresolvedarrayref); }
787 if ( $installer::globals
::iswin
and $^O
=~ /MSWin/i ) { installer
::converter
::convert_slash_to_backslash
($filesinproductlanguageresolvedarrayref); }
788 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles6.log", $filesinproductlanguageresolvedarrayref); }
790 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_non_existent_languages_in_productlists
($filesinproductlanguageresolvedarrayref, $languagestringref, "Name", "file");
791 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles7.log", $filesinproductlanguageresolvedarrayref); }
793 installer
::scriptitems
::get_Destination_Directory_For_Item_From_Directorylist
($filesinproductlanguageresolvedarrayref, $dirsinproductarrayref);
794 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles8.log", $filesinproductlanguageresolvedarrayref); }
796 installer
::scriptitems
::get_Source_Directory_For_Files_From_Includepathlist
($filesinproductlanguageresolvedarrayref, $includepatharrayref_lang, $dirsinproductlanguageresolvedarrayref, "Files");
797 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles9.log", $filesinproductlanguageresolvedarrayref); }
799 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_Files_Without_Sourcedirectory
($filesinproductlanguageresolvedarrayref);
800 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10.log", $filesinproductlanguageresolvedarrayref); }
802 if ($installer::globals
::languagepack
)
804 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_Files_For_Languagepacks
($filesinproductlanguageresolvedarrayref);
805 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10c.log", $filesinproductlanguageresolvedarrayref); }
809 if ( ! $allvariableshashref->{'NO_README_IN_ROOTDIR'} )
811 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::add_License_Files_into_Installdir
($filesinproductlanguageresolvedarrayref, $dirsinproductlanguageresolvedarrayref, $languagesarrayref);
812 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10b.log", $filesinproductlanguageresolvedarrayref); }
815 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_onlyasialanguage_files_from_productlists
($filesinproductlanguageresolvedarrayref);
816 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10d.log", $filesinproductlanguageresolvedarrayref); }
818 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_onlywesternlanguage_files_from_productlists
($filesinproductlanguageresolvedarrayref);
819 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10e.log", $filesinproductlanguageresolvedarrayref); }
821 installer
::scriptitems
::make_filename_language_specific
($filesinproductlanguageresolvedarrayref);
822 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10f.log", $filesinproductlanguageresolvedarrayref); }
824 # print "... calculating checksums ...\n";
825 # my $checksumfile = installer::worker::make_checksum_file($filesinproductlanguageresolvedarrayref, $includepatharrayref);
826 # if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . $installer::globals::checksumfilename, $checksumfile); }
828 ######################################################################################
829 # Unzipping files with flag ARCHIVE and putting all included files into the file list
830 ######################################################################################
832 installer
::logger
::print_message
( "... analyzing files with flag ARCHIVE ...\n" );
834 my @additional_paths_from_zipfiles = ();
836 $filesinproductlanguageresolvedarrayref = installer
::archivefiles
::resolving_archive_flag
($filesinproductlanguageresolvedarrayref, \
@additional_paths_from_zipfiles, $languagestringref, $loggingdir);
837 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles11.log", $filesinproductlanguageresolvedarrayref); }
838 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "additional_paths.log" ,\
@additional_paths_from_zipfiles); }
840 # packed files sometimes contain a "$" in their name: HighlightText$1.class. For epm the "$" has to be quoted by "$$"
842 if (!( $installer::globals
::iswindowsbuild
|| $installer::globals
::simple
) )
844 installer
::scriptitems
::quoting_illegal_filenames
($filesinproductlanguageresolvedarrayref);
845 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles12.log", $filesinproductlanguageresolvedarrayref); }
848 #####################################
849 # Files with flag SUBST_FILENAME
850 #####################################
852 installer
::logger
::print_message
( "... analyzing files with flag SUBST_FILENAME ...\n" );
854 installer
::substfilenamefiles
::resolving_subst_filename_flag
($filesinproductlanguageresolvedarrayref, $allvariableshashref, $languagestringref);
855 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles12d.log", $filesinproductlanguageresolvedarrayref); }
857 #####################################
858 # Files with flag SCPZIP_REPLACE
859 #####################################
861 installer
::logger
::print_message
( "... analyzing files with flag SCPZIP_REPLACE ...\n" );
863 # Editing files with flag SCPZIP_REPLACE.
865 installer
::scpzipfiles
::resolving_scpzip_replace_flag
($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
866 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles13.log", $filesinproductlanguageresolvedarrayref); }
868 #####################################
869 # Files with flag PATCH_SO_NAME
870 #####################################
872 installer
::logger
::print_message
( "... analyzing files with flag PATCH_SO_NAME ...\n" );
874 # Editing files with flag PATCH_SO_NAME.
876 installer
::scppatchsoname
::resolving_patchsoname_flag
($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
877 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles13b.log", $filesinproductlanguageresolvedarrayref); }
879 #####################################
880 # Files with flag HIDDEN
881 #####################################
883 installer
::logger
::print_message
( "... analyzing files with flag HIDDEN ...\n" );
885 installer
::worker
::resolving_hidden_flag
($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
886 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles13c.log", $filesinproductlanguageresolvedarrayref); }
888 #####################################
889 # Creating services.rdb
890 #####################################
892 if ( $allvariableshashref->{'SERVICESPROJEKT'} )
894 if (! $installer::globals
::languagepack
)
896 # ATTENTION: For creating the services.rdb it is necessary to execute the native file
897 # "regcomp" or "regcomp.exe". Therefore this function can only be executed on the
898 # corresponding platform.
900 if ( $installer::globals
::servicesrdb_can_be_created
)
902 installer
::logger
::print_message
( "... creating preregistered services.rdb ...\n" );
904 installer
::servicesfile
::create_services_rdb
($allvariableshashref, $filesinproductlanguageresolvedarrayref, $includepatharrayref, $languagestringref);
905 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles14.log", $filesinproductlanguageresolvedarrayref); }
910 #####################################
912 #####################################
914 if (!($installer::globals
::is_copy_only_project
))
916 if (! $installer::globals
::languagepack
)
918 installer
::logger
::print_message
( "... merging files into registry database ...\n" );
920 installer
::regmerge
::merge_registration_files
($filesinproductlanguageresolvedarrayref, $includepatharrayref, $languagestringref, $allvariableshashref);
921 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles14b.log", $filesinproductlanguageresolvedarrayref); }
925 ############################################
926 # Collecting directories for epm list file
927 ############################################
929 installer
::logger
::print_message
( "... analyzing all directories for this product ...\n" );
931 # There are two ways for a directory to be included into the epm directory list:
932 # 1. Looking for all destination paths in the files array
933 # 2. Looking for directories with CREATE flag in the directory array
934 # Advantage: Many pathes are hidden in zip files, they are not defined in the setup script.
935 # It will be possible, that in the setup script only those directoies have to be defined,
936 # that have a CREATE flag. All other directories are created, if they contain at least one file.
938 my ($directoriesforepmarrayref, $alldirectoryhash) = installer
::scriptitems
::collect_directories_from_filesarray
($filesinproductlanguageresolvedarrayref);
939 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist1.log", $directoriesforepmarrayref); }
941 ($directoriesforepmarrayref, $alldirectoryhash) = installer
::scriptitems
::collect_directories_with_create_flag_from_directoryarray
($dirsinproductlanguageresolvedarrayref, $alldirectoryhash);
942 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist2.log", $directoriesforepmarrayref); }
944 # installer::sorter::sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
945 # if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3.log", $directoriesforepmarrayref); }
947 #########################################################
948 # language dependent scpactions part
949 #########################################################
951 my $scpactionsinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($scpactionsinproductarrayref, $languagesarrayref);
952 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions3.log", $scpactionsinproductlanguageresolvedarrayref); }
954 installer
::scriptitems
::changing_name_of_language_dependent_keys
($scpactionsinproductlanguageresolvedarrayref);
955 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions4.log", $scpactionsinproductlanguageresolvedarrayref); }
957 installer
::scriptitems
::get_Source_Directory_For_Files_From_Includepathlist
($scpactionsinproductlanguageresolvedarrayref, $includepatharrayref_lang, $dirsinproductlanguageresolvedarrayref, "ScpActions");
958 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions5.log", $scpactionsinproductlanguageresolvedarrayref); }
960 # Editing scpactions with flag SCPZIP_REPLACE and PATCH_SO_NAME.
962 installer
::scpzipfiles
::resolving_scpzip_replace_flag
($scpactionsinproductlanguageresolvedarrayref, $allvariableshashref, "ScpAction", $languagestringref);
963 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions6.log", $scpactionsinproductlanguageresolvedarrayref); }
965 installer
::scppatchsoname
::resolving_patchsoname_flag
($scpactionsinproductlanguageresolvedarrayref, $allvariableshashref, "ScpAction", $languagestringref);
966 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions6a.log", $scpactionsinproductlanguageresolvedarrayref); }
968 #########################################################
969 # language dependent links part
970 #########################################################
972 installer
::logger
::print_message
( "... analyzing links ...\n" );
974 my $linksinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($linksinproductarrayref, $languagesarrayref);
975 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks2.log", $linksinproductlanguageresolvedarrayref); }
977 installer
::scriptitems
::changing_name_of_language_dependent_keys
($linksinproductlanguageresolvedarrayref);
978 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks3.log", $linksinproductlanguageresolvedarrayref); }
980 installer
::scriptitems
::get_destination_file_path_for_links
($linksinproductlanguageresolvedarrayref, $filesinproductlanguageresolvedarrayref);
981 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks4.log", $linksinproductlanguageresolvedarrayref); }
983 installer
::scriptitems
::get_Destination_Directory_For_Item_From_Directorylist
($linksinproductlanguageresolvedarrayref, $dirsinproductarrayref);
984 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks5.log", $linksinproductlanguageresolvedarrayref); }
986 # Now taking all links that have no FileID but a ShortcutID, linking to another link
988 installer
::scriptitems
::get_destination_link_path_for_links
($linksinproductlanguageresolvedarrayref);
989 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks6.log", $linksinproductlanguageresolvedarrayref); }
991 $linksinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_workstation_only_items
($linksinproductlanguageresolvedarrayref);
992 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks7.log", $linksinproductlanguageresolvedarrayref); }
994 installer
::scriptitems
::resolve_links_with_flag_relative
($linksinproductlanguageresolvedarrayref);
995 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks8.log", $linksinproductlanguageresolvedarrayref); }
997 #########################################################
998 # language dependent unix links part
999 #########################################################
1001 installer
::logger
::print_message
( "... analyzing unix links ...\n" );
1003 my $unixlinksinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($unixlinksinproductarrayref, $languagesarrayref);
1004 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks3.log", $unixlinksinproductlanguageresolvedarrayref); }
1006 installer
::scriptitems
::changing_name_of_language_dependent_keys
($unixlinksinproductlanguageresolvedarrayref);
1007 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks4.log", $unixlinksinproductlanguageresolvedarrayref); }
1009 installer
::scriptitems
::get_Destination_Directory_For_Item_From_Directorylist
($unixlinksinproductlanguageresolvedarrayref, $dirsinproductarrayref);
1010 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks5.log", $unixlinksinproductlanguageresolvedarrayref); }
1012 #########################################################
1013 # language dependent part for profiles and profileitems
1014 #########################################################
1016 my $profilesinproductlanguageresolvedarrayref;
1017 my $profileitemsinproductlanguageresolvedarrayref;
1019 if ((!($installer::globals
::is_copy_only_project
)) && (!($installer::globals
::product
=~ /ada/i )) && (!($installer::globals
::languagepack
)))
1021 installer
::logger
::print_message
( "... creating profiles ...\n" );
1023 $profilesinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($profilesinproductarrayref, $languagesarrayref);
1024 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profiles2.log", $profilesinproductlanguageresolvedarrayref); }
1026 $profileitemsinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($profileitemsinproductarrayref, $languagesarrayref);
1027 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profileitems2.log", $profilesinproductlanguageresolvedarrayref); }
1029 installer
::scriptitems
::changing_name_of_language_dependent_keys
($profilesinproductlanguageresolvedarrayref);
1030 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profiles3.log", $profilesinproductlanguageresolvedarrayref); }
1032 installer
::scriptitems
::changing_name_of_language_dependent_keys
($profileitemsinproductlanguageresolvedarrayref);
1033 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profileitems3.log", $profileitemsinproductlanguageresolvedarrayref); }
1035 installer
::scriptitems
::replace_setup_variables
($profileitemsinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
1036 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profileitems4.log", $profileitemsinproductlanguageresolvedarrayref); }
1038 if ( $installer::globals
::patch_user_dir
)
1040 installer
::scriptitems
::replace_userdir_variable
($profileitemsinproductlanguageresolvedarrayref);
1041 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profileitems4a.log", $profileitemsinproductlanguageresolvedarrayref); }
1044 installer
::scriptitems
::get_Destination_Directory_For_Item_From_Directorylist
($profilesinproductlanguageresolvedarrayref, $dirsinproductarrayref);
1045 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profiles4.log", $profilesinproductlanguageresolvedarrayref); }
1047 # Now the Profiles can be created
1049 installer
::profiles
::create_profiles
($profilesinproductlanguageresolvedarrayref, $profileitemsinproductlanguageresolvedarrayref, $filesinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
1050 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles15.log", $filesinproductlanguageresolvedarrayref); }
1053 my $registryitemsinproductlanguageresolvedarrayref; # cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
1054 my $folderinproductlanguageresolvedarrayref; # cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
1055 my $folderitemsinproductlanguageresolvedarrayref; # cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
1057 if ( $installer::globals
::iswindowsbuild
) # Windows specific items: Folder, FolderItem, RegistryItem
1059 #########################################################
1060 # language dependent part for folder
1061 #########################################################
1063 installer
::logger
::print_message
( "... analyzing folder ...\n" );
1065 $folderinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($folderinproductarrayref, $languagesarrayref);
1066 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folder2.log", $folderinproductlanguageresolvedarrayref); }
1068 installer
::scriptitems
::changing_name_of_language_dependent_keys
($folderinproductlanguageresolvedarrayref);
1069 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folder3.log", $folderinproductlanguageresolvedarrayref); }
1071 #########################################################
1072 # language dependent part for folderitems
1073 #########################################################
1075 installer
::logger
::print_message
( "... analyzing folderitems ...\n" );
1077 $folderitemsinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($folderitemsinproductarrayref, $languagesarrayref);
1078 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folderitems2.log", $folderitemsinproductlanguageresolvedarrayref); }
1080 installer
::scriptitems
::changing_name_of_language_dependent_keys
($folderitemsinproductlanguageresolvedarrayref);
1081 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folderitems3.log", $folderitemsinproductlanguageresolvedarrayref); }
1083 #########################################################
1084 # language dependent part for registryitems
1085 #########################################################
1087 installer
::logger
::print_message
( "... analyzing registryitems ...\n" );
1089 $registryitemsinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($registryitemsinproductarrayref, $languagesarrayref);
1090 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems2.log", $registryitemsinproductlanguageresolvedarrayref); }
1092 installer
::scriptitems
::changing_name_of_language_dependent_keys
($registryitemsinproductlanguageresolvedarrayref);
1093 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems3.log", $registryitemsinproductlanguageresolvedarrayref); }
1096 #########################################################
1097 # language dependent part for modules
1098 #########################################################
1100 my $modulesinproductlanguageresolvedarrayref;
1102 if (!($installer::globals
::is_copy_only_project
))
1104 installer
::logger
::print_message
( "... analyzing modules ...\n" );
1106 $modulesinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($modulesinproductarrayref, $languagesarrayref);
1107 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes_modules
($loggingdir . "modules2.log", $modulesinproductlanguageresolvedarrayref); }
1109 $modulesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_not_required_language_modules
($modulesinproductlanguageresolvedarrayref, $languagesarrayref);
1110 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes_modules
($loggingdir . "modules2a.log", $modulesinproductlanguageresolvedarrayref); }
1112 if ( $installer::globals
::analyze_spellcheckerlanguage
)
1114 $modulesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_not_required_spellcheckerlanguage_modules
($modulesinproductlanguageresolvedarrayref);
1115 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes_modules
($loggingdir . "modules3.log", $modulesinproductlanguageresolvedarrayref); }
1117 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_not_required_spellcheckerlanguage_files
($filesinproductlanguageresolvedarrayref);
1118 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles15b.log", $filesinproductlanguageresolvedarrayref); }
1121 installer
::scriptitems
::changing_name_of_language_dependent_keys
($modulesinproductlanguageresolvedarrayref);
1122 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes_modules
($loggingdir . "modules3a.log", $modulesinproductlanguageresolvedarrayref); }
1124 # installer::scriptitems::collect_language_specific_names($modulesinproductlanguageresolvedarrayref);
1125 installer
::scriptitems
::select_required_language_strings
($modulesinproductlanguageresolvedarrayref); # using english strings
1129 # Copy-only projects can now start to copy all items File and ScpAction
1130 if ( $installer::globals
::is_copy_only_project
) { installer
::copyproject
::copy_project
($filesinproductlanguageresolvedarrayref, $scpactionsinproductlanguageresolvedarrayref, $loggingdir, $languagestringref, $shipinstalldir, $allsettingsarrayref); }
1132 # Language pack projects can now start to select the required information
1133 if ( $installer::globals
::languagepack
)
1135 $filesinproductlanguageresolvedarrayref = installer
::languagepack
::select_language_items
($filesinproductlanguageresolvedarrayref, $languagesarrayref, "File");
1136 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16b.log", $filesinproductlanguageresolvedarrayref); }
1137 $scpactionsinproductlanguageresolvedarrayref = installer
::languagepack
::select_language_items
($scpactionsinproductlanguageresolvedarrayref, $languagesarrayref, "ScpAction");
1138 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions6b.log", $scpactionsinproductlanguageresolvedarrayref); }
1139 $linksinproductlanguageresolvedarrayref = installer
::languagepack
::select_language_items
($linksinproductlanguageresolvedarrayref, $languagesarrayref, "Shortcut");
1140 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks8b.log", $linksinproductlanguageresolvedarrayref); }
1141 $unixlinksinproductlanguageresolvedarrayref = installer
::languagepack
::select_language_items
($unixlinksinproductlanguageresolvedarrayref, $languagesarrayref, "Unixlink");
1142 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks5.log", $unixlinksinproductlanguageresolvedarrayref); }
1143 @
{$folderitemsinproductlanguageresolvedarrayref} = (); # no folderitems in languagepacks
1145 # Collecting the directories again, to include only the language specific directories
1146 ($directoriesforepmarrayref, $alldirectoryhash) = installer
::scriptitems
::collect_directories_from_filesarray
($filesinproductlanguageresolvedarrayref);
1147 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist3alangpack.log", $directoriesforepmarrayref); }
1148 ($directoriesforepmarrayref, $alldirectoryhash) = installer
::scriptitems
::collect_directories_with_create_flag_from_directoryarray
($dirsinproductlanguageresolvedarrayref, $alldirectoryhash);
1149 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist3blangpack.log", $directoriesforepmarrayref); }
1150 installer
::sorter
::sorting_array_of_hashes
($directoriesforepmarrayref, "HostName");
1151 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist3clangpack.log", $directoriesforepmarrayref); }
1153 if ( $installer::globals
::iswindowsbuild
)
1155 $registryitemsinproductlanguageresolvedarrayref = installer
::worker
::select_langpack_items
($registryitemsinproductlanguageresolvedarrayref, "RegistryItem");
1156 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems3aa.log", $registryitemsinproductlanguageresolvedarrayref); }
1161 # Collecting all files without flag PATCH (for maintenance reasons)
1162 if ( $installer::globals
::patch
) { installer
::worker
::collect_all_files_without_patch_flag
($filesinproductlanguageresolvedarrayref); }
1164 # Patch projects can now start to select the required information
1165 if (( $installer::globals
::patch
) && (( $installer::globals
::issolarispkgbuild
) || ( $installer::globals
::iswindowsbuild
)))
1167 $filesinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items
($filesinproductlanguageresolvedarrayref, "File");
1168 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16patch.log", $filesinproductlanguageresolvedarrayref); }
1169 $scpactionsinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items
($scpactionsinproductlanguageresolvedarrayref, "ScpAction");
1170 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions6patch.log", $scpactionsinproductlanguageresolvedarrayref); }
1171 $linksinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items
($linksinproductlanguageresolvedarrayref, "Shortcut");
1172 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks8patch.log", $linksinproductlanguageresolvedarrayref); }
1173 $unixlinksinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items
($unixlinksinproductlanguageresolvedarrayref, "Unixlink");
1174 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks6patch.log", $unixlinksinproductlanguageresolvedarrayref); }
1175 $folderitemsinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items
($folderitemsinproductlanguageresolvedarrayref, "FolderItem");
1176 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfolderitems1patch.log", $folderitemsinproductlanguageresolvedarrayref); }
1177 # @{$folderitemsinproductlanguageresolvedarrayref} = (); # no folderitems in languagepacks
1179 if ( $installer::globals
::iswindowsbuild
)
1181 $registryitemsinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items_without_name
($registryitemsinproductlanguageresolvedarrayref, "RegistryItem");
1182 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems3a.log", $registryitemsinproductlanguageresolvedarrayref); }
1184 installer
::worker
::prepare_windows_patchfiles
($filesinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
1185 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16bpatch.log", $filesinproductlanguageresolvedarrayref); }
1187 # For Windows patches, the directories can now be collected again
1188 ($directoriesforepmarrayref, $alldirectoryhash) = installer
::scriptitems
::collect_directories_from_filesarray
($filesinproductlanguageresolvedarrayref);
1189 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist4_patch.log", $directoriesforepmarrayref); }
1191 installer
::sorter
::sorting_array_of_hashes
($directoriesforepmarrayref, "HostName");
1192 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist5_patch.log", $directoriesforepmarrayref); }
1196 #########################################################
1197 # Collecting all scp actions
1198 #########################################################
1200 installer
::worker
::collect_scpactions
($scpactionsinproductlanguageresolvedarrayref);
1202 #########################################################
1203 # creating inf files for user system integration
1204 #########################################################
1206 if (( $installer::globals
::iswindowsbuild
) && ( ! $installer::globals
::patch
)) # Windows specific items: Folder, FolderItem, RegistryItem
1208 installer
::logger
::print_message
( "... creating inf files ...\n" );
1209 installer
::worker
::create_inf_file
($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $folderinproductlanguageresolvedarrayref, $folderitemsinproductlanguageresolvedarrayref, $modulesinproductlanguageresolvedarrayref, $languagesarrayref, $languagestringref, $allvariableshashref);
1210 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16c.log", $filesinproductlanguageresolvedarrayref); }
1213 ###########################################
1214 # Using upx, to decrease file size
1215 # Currently only for Windows.
1216 ###########################################
1218 if ( $allvariableshashref->{'UPXPRODUCT'} )
1220 installer
::upx
::upx_on_libraries
($filesinproductlanguageresolvedarrayref, $languagestringref);
1221 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16d.log", $filesinproductlanguageresolvedarrayref); }
1224 ###########################################################
1225 # Simple package projects can now start to create the
1226 # installation structure by creating Directories, Files
1227 # Links and ScpActions. This is the last platform
1229 ###########################################################
1231 if ( $installer::globals
::is_simple_packager_project
)
1233 installer
::simplepackage
::create_simple_package
($filesinproductlanguageresolvedarrayref, $directoriesforepmarrayref, $scpactionsinproductlanguageresolvedarrayref, $linksinproductlanguageresolvedarrayref, $unixlinksinproductlanguageresolvedarrayref, $loggingdir, $languagestringref, $shipinstalldir, $allsettingsarrayref, $allvariableshashref, $includepatharrayref);
1234 next; # ! leaving the current loop, because no further packaging required.
1237 ###########################################################
1238 # Analyzing the package structure
1239 ###########################################################
1241 installer
::logger
::print_message
( "... analyzing package list ...\n" );
1243 my $packages = installer
::packagelist
::collectpackages
($modulesinproductlanguageresolvedarrayref, $languagesarrayref);
1244 installer
::packagelist
::check_packagelist
($packages);
1246 $packages = installer
::packagelist
::analyze_list
($packages, $modulesinproductlanguageresolvedarrayref);
1247 installer
::packagelist
::remove_multiple_modules_packages
($packages);
1249 # printing packages content:
1250 installer
::packagelist
::log_packages_content
($packages);
1251 installer
::packagelist
::create_module_destination_hash
($packages, $allvariableshashref);
1253 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nEnd of part 1b: The language dependent part\n"); }
1255 # saving debug info, before starting part 2
1256 if ( $installer::globals
::debug
) { installer
::logger
::savedebug
($installer::globals
::exitlog
); }
1258 #################################################
1259 # Part 2: The platform dependent part
1260 #################################################
1262 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 2: The platform dependent part\n"); }
1264 #################################################
1265 # Part 2a: All non-Windows platforms
1266 #################################################
1268 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 2a: All non-Windows platforms\n"); }
1270 #########################################################
1271 # ... creating epm list file ...
1272 # Only for non-Windows platforms
1273 #########################################################
1275 if (!( $installer::globals
::iswindowsbuild
))
1277 ####################################################
1278 # Writing log file before packages are packed
1279 ####################################################
1281 installer
::logger
::print_message
( "... creating log file " . $loggingdir . $installer::globals
::logfilename
. "\n" );
1282 installer
::files
::save_file
($loggingdir . $installer::globals
::logfilename
, \
@installer::globals
::logfileinfo
);
1284 ####################################################
1285 # Creating directories
1286 ####################################################
1288 $installdir = installer
::worker
::create_installation_directory
($shipinstalldir, $languagestringref, \
$current_install_number);
1290 my $listfiledir = installer
::systemactions
::create_directories
("listfile", $languagestringref);
1291 my $installlogdir = installer
::systemactions
::create_directory_next_to_directory
($installdir, "log");
1292 # installer::packagelist::add_defaultpathes_into_filescollector($filesinproductlanguageresolvedarrayref);
1293 # my $installchecksumdir = installer::systemactions::create_directory_next_to_directory($installdir, "checksum");
1295 ####################################################
1296 # Reading for Solaris all package descriptions
1297 # from file defined in property PACKAGEMAP
1298 ####################################################
1300 if ( $installer::globals
::issolarisbuild
) { installer
::epmfile
::read_packagemap
($allvariableshashref, $includepatharrayref, $languagesarrayref); }
1302 my $epmexecutable = "";
1305 # shuffle array to reduce parallel packaging process in pool
1306 installer
::worker
::shuffle_array
($packages);
1308 # iterating over all packages
1309 for ( my $k = 0; $k <= $#{$packages}; $k++ )
1311 my $onepackage = ${$packages}[$k];
1313 # checking, if this is a language pack or a project pack.
1314 # Creating language packs only, if $installer::globals::languagepack is set. Parameter: -languagepack
1316 if ( $installer::globals
::languagepack
) { installer
::languagepack
::replace_languagestring_variable
($onepackage, $languagestringref); }
1318 my $onepackagename = $onepackage->{'module'}; # name of the top module (required)
1320 my $shellscriptsfilename = "";
1321 if ( $onepackage->{'script'} ) { $shellscriptsfilename = $onepackage->{'script'}; }
1322 # no scripts for Solaris patches!
1323 if (( $installer::globals
::patch
) && ( $installer::globals
::issolarispkgbuild
)) { $shellscriptsfilename = ""; }
1325 ###########################
1327 ###########################
1329 my $packagename = "";
1331 if ( $installer::globals
::issolarisbuild
) # only for Solaris
1333 if ( $onepackage->{'solarispackagename'} ) { $packagename = $onepackage->{'solarispackagename'}; }
1337 if ( $onepackage->{'packagename'} ) { $packagename = $onepackage->{'packagename'}; }
1340 if (!($packagename eq ""))
1342 installer
::packagelist
::resolve_packagevariables
(\
$packagename, $allvariableshashref, 0);
1346 my $linkpackage = 0;
1347 $installer::globals
::add_required_package
= "";
1348 $installer::globals
::linuxlinkrpmprocess
= 0;
1350 if ( $installer::globals
::makelinuxlinkrpm
)
1352 my $oldpackagename = $packagename;
1353 $installer::globals
::add_required_package
= $oldpackagename; # the link rpm requires the non-linked version
1354 if ( $installer::globals
::languagepack
) { $packagename = $packagename . "_u"; }
1355 else { $packagename = $packagename . "u"; }
1356 my $savestring = $oldpackagename . "\t" . $packagename;
1357 push(@installer::globals
::linkrpms
, $savestring);
1358 $linkaddon = "_links";
1359 $installer::globals
::linuxlinkrpmprocess
= 1;
1363 ####################################################
1364 # Header for this package into log file
1365 ####################################################
1367 installer
::logger
::include_header_into_logfile
("Creating package: $packagename ($k)");
1369 ####################################################
1370 # Pool check: If package is created at the moment
1371 # try it again later.
1372 ####################################################
1374 if (( $installer::globals
::patch
) || ( $installer::globals
::languagepack
) || ( $installer::globals
::packageformat
eq "native" ) || ( $installer::globals
::packageformat
eq "osx" )) { $allvariableshashref->{'POOLPRODUCT'} = 0; }
1376 if ( $allvariableshashref->{'POOLPRODUCT'} )
1378 if ( ! $installer::globals
::sessionidset
) { installer
::packagepool
::set_sessionid
(); }
1379 if ( ! $installer::globals
::poolpathset
) { installer
::packagepool
::set_pool_path
(); }
1380 if (( ! $installer::globals
::getuidpathset
) && ( $installer::globals
::issolarisbuild
)) { installer
::worker
::set_getuid_path
($includepatharrayref); }
1382 my $package_is_creatable = installer
::packagepool
::check_package_availability
($packagename);
1384 if (( ! $package_is_creatable ) && ( ! exists($installer::globals
::poolshiftedpackages
{$packagename}) ))
1386 splice(@
{$packages}, $k, 1); # removing package ...
1387 push(@
{$packages}, $onepackage); # ... and adding it to the end
1388 $installer::globals
::poolshiftedpackages
{$packagename} = 1; # only shifting each package once
1389 $k--; # decreasing the counter
1390 my $localinfoline = "Pool: Package \"$packagename\" cannot be created at the moment. Trying again later (1).\n";
1391 installer
::logger
::print_message
($localinfoline);
1392 push( @installer::globals
::logfileinfo
, $localinfoline);
1393 next; # repeating this iteration with new package
1397 ###########################################
1398 # Root path, can be defined as parameter
1399 ###########################################
1401 my $packagerootpath = "";
1403 if ($installer::globals
::rootpath
eq "")
1405 $packagerootpath = $onepackage->{'destpath'};
1406 installer
::packagelist
::resolve_packagevariables
(\
$packagerootpath, $allvariableshashref, 1);
1407 if ( $^O
=~ /darwin/i ) { $packagerootpath =~ s/\/opt\//\/Applications\
//; }
1411 $packagerootpath = $installer::globals
::rootpath
;
1414 #############################################
1415 # copying the collectors for each package
1416 #############################################
1418 my $filesinpackage = installer
::converter
::copy_collector
($filesinproductlanguageresolvedarrayref);
1419 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files1_" . $packagename . ".log", $filesinpackage); }
1420 my $linksinpackage = installer
::converter
::copy_collector
($linksinproductlanguageresolvedarrayref);
1421 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "links1_" . $packagename . ".log", $linksinpackage); }
1422 my $unixlinksinpackage = installer
::converter
::copy_collector
($unixlinksinproductlanguageresolvedarrayref);
1423 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks1_" . $packagename . ".log", $unixlinksinpackage); }
1424 my $dirsinpackage = installer
::converter
::copy_collector
($directoriesforepmarrayref);
1425 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "dirs1_" . $packagename . ".log", $dirsinpackage); }
1427 ###########################################
1428 # setting the root path for the packages
1429 ###########################################
1431 installer
::scriptitems
::add_rootpath_to_directories
($dirsinpackage, $packagerootpath);
1432 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "dirs2_" . $packagename . ".log", $dirsinpackage); }
1433 installer
::scriptitems
::add_rootpath_to_files
($filesinpackage, $packagerootpath);
1434 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files2_" . $packagename . ".log", $filesinpackage); }
1435 installer
::scriptitems
::add_rootpath_to_links
($linksinpackage, $packagerootpath);
1436 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "links2_" . $packagename . ".log", $linksinpackage); }
1437 installer
::scriptitems
::add_rootpath_to_files
($unixlinksinpackage, $packagerootpath);
1438 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks2_" . $packagename . ".log", $unixlinksinpackage); }
1440 #################################
1441 # collecting items for package
1442 #################################
1444 $filesinpackage = installer
::packagelist
::find_files_for_package
($filesinpackage, $onepackage);
1445 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files3_" . $packagename . ".log", $filesinpackage); }
1446 $unixlinksinpackage = installer
::packagelist
::find_files_for_package
($unixlinksinpackage, $onepackage);
1447 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks3_" . $packagename . ".log", $unixlinksinpackage); }
1448 $linksinpackage = installer
::packagelist
::find_links_for_package
($linksinpackage, $filesinpackage);
1449 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "links3_" . $packagename . ".log", $linksinpackage); }
1450 $dirsinpackage = installer
::packagelist
::find_dirs_for_package
($dirsinpackage, $onepackage);
1451 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "dirs3_" . $packagename . ".log", $dirsinpackage); }
1453 ###############################################
1454 # nothing to do, if $filesinpackage is empty
1455 ###############################################
1457 if ( ! ( $#{$filesinpackage} > -1 ))
1459 push(@installer::globals
::emptypackages
, $packagename);
1460 $infoline = "\n\nNo file in package: $packagename \-\> Skipping\n\n";
1461 push(@installer::globals
::logfileinfo
, $infoline);
1462 next; # next package, end of loop !
1465 #################################################################
1466 # nothing to do for Linux patches, if no file has flag PATCH
1467 #################################################################
1469 # Linux Patch: The complete RPM has to be built, if one file in the RPM has the flag PATCH (also for DEBs)
1470 if (( $installer::globals
::patch
) && (( $installer::globals
::islinuxrpmbuild
) || ( $installer::globals
::islinuxdebbuild
)))
1472 my $patchfiles = installer
::worker
::collect_all_items_with_special_flag
($filesinpackage ,"PATCH");
1473 if ( ! ( $#{$patchfiles} > -1 ))
1475 $infoline = "\n\nLinux Patch: No patch file in package: $packagename \-\> Skipping\n\n";
1476 push(@installer::globals
::logfileinfo
, $infoline);
1481 ###########################################
1482 # Stripping libraries
1483 ###########################################
1485 # Building for non Windows platforms in cws requires, that all files are stripped before packaging:
1486 # 1. copy all files that need to be stripped locally
1487 # 2. strip all these files
1489 if ( $installer::globals
::strip
)
1491 installer
::strip
::strip_libraries
($filesinpackage, $languagestringref);
1492 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . $packagename ."_files.log", $filesinpackage); }
1495 ###############################################################
1496 # Searching for files in $filesinpackage with flag LINUXLINK
1497 ###############################################################
1499 if (( $installer::globals
::islinuxbuild
) && ( ! $installer::globals
::simple
)) # for rpms and debian packages
1501 # special handling for all RPMs in $installer::globals::linuxlinkrpms
1503 # if (( $installer::globals::linuxlinkrpms =~ /\b$onepackagename\b/ ) || ( $installer::globals::languagepack ))
1504 if ( $installer::globals
::linuxlinkrpms
=~ /\b$onepackagename\b/ )
1508 if (( $installer::globals
::makelinuxlinkrpm
) && ( ! $run ))
1510 $filesinpackage = \
@installer::globals
::linuxpatchfiles
;
1511 $linksinpackage = \
@installer::globals
::linuxlinks
;
1512 $installer::globals
::makelinuxlinkrpm
= 0;
1513 if ( $installer::globals
::patch
) { $installer::globals
::call_epm
= 1; } # enabling packing again
1516 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files3b_" . $packagename . ".log", $filesinpackage); }
1517 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "links3b_" . $packagename . ".log", $linksinpackage); }
1518 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "dirs3b_" . $packagename . ".log", $dirsinpackage); }
1521 if (( ! $installer::globals
::makelinuxlinkrpm
) && ( ! $run ))
1523 $filesinpackage = installer
::worker
::prepare_linuxlinkfiles
($filesinpackage);
1524 $linksinpackage = installer
::worker
::prepare_forced_linuxlinkfiles
($linksinpackage);
1525 $installer::globals
::makelinuxlinkrpm
= 1;
1526 if ( $allvariableshashref->{'OPENSOURCE'} ) { $installer::globals
::add_required_package
= $packagename . "u"; }
1527 if ( $installer::globals
::patch
) { $installer::globals
::call_epm
= 0; } # no packing of core module in patch
1528 $shellscriptsfilename = ""; # shell scripts only need to be included into the link rpm
1531 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files3a_" . $packagename . ".log", $filesinpackage); }
1532 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "links3a_" . $packagename . ".log", $linksinpackage); }
1533 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "dirs3a_" . $packagename . ".log", $dirsinpackage); }
1538 ###########################################
1539 # Simple installation mechanism
1540 ###########################################
1542 if ( $installer::globals
::simple
) { installer
::worker
::install_simple
($onepackagename, $$languagestringref, $dirsinpackage, $filesinpackage, $linksinpackage, $unixlinksinpackage); }
1544 ###########################################
1545 # Checking epm state
1546 ###########################################
1548 if (( $installer::globals
::call_epm
) && ( ! $found_epm ))
1550 $epmexecutable = installer
::epmfile
::find_epm_on_system
($includepatharrayref);
1551 installer
::epmfile
::set_patch_state
($epmexecutable); # setting $installer::globals::is_special_epm
1552 $found_epm = 1; # searching only once
1555 ###########################################
1556 # Creating epm list file
1557 ###########################################
1559 if ( ! $installer::globals
::simple
)
1561 # epm list file format:
1562 # type mode owner group destination source options
1563 # Example for a file: f 755 root sys /usr/bin/foo foo
1564 # Example for a directory: d 755 root sys /var/spool/foo -
1565 # Example for a link: l 000 root sys /usr/bin/linkname filename
1566 # The source field specifies the file to link to
1568 my $epmfilename = "epm_" . $onepackagename . $linkaddon . ".lst";
1570 installer
::logger
::print_message
( "... creating epm list file $epmfilename ... \n" );
1572 my $completeepmfilename = $listfiledir . $installer::globals
::separator
. $epmfilename;
1576 my $epmheaderref = installer
::epmfile
::create_epm_header
($allvariableshashref, $filesinproductlanguageresolvedarrayref, $languagesarrayref, $onepackage);
1577 installer
::epmfile
::adding_header_to_epm_file
(\
@epmfile, $epmheaderref);
1579 if (( $installer::globals
::patch
) && ( $installer::globals
::issolarispkgbuild
))
1581 $filesinpackage = installer
::worker
::analyze_patch_files
($filesinpackage);
1582 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files4_" . $packagename . ".log", $filesinpackage); }
1584 if ( ! ( $#{$filesinpackage} > -1 ))
1586 push(@installer::globals
::emptypackages
, $packagename);
1587 $infoline = "\nNo file in package: $packagename \-\> Skipping\n";
1588 push(@installer::globals
::logfileinfo
, $infoline);
1589 next; # next package, end of loop !
1593 # adding directories, files and links into epm file
1595 installer
::epmfile
::put_directories_into_epmfile
($dirsinpackage, \
@epmfile, $allvariableshashref, $packagerootpath);
1596 installer
::epmfile
::put_files_into_epmfile
($filesinpackage, \
@epmfile );
1597 installer
::epmfile
::put_links_into_epmfile
($linksinpackage, \
@epmfile );
1598 installer
::epmfile
::put_unixlinks_into_epmfile
($unixlinksinpackage, \
@epmfile );
1600 if ((!( $shellscriptsfilename eq "" )) && (!($installer::globals
::iswindowsbuild
))) { installer
::epmfile
::adding_shellscripts_to_epm_file
(\
@epmfile, $shellscriptsfilename, $packagerootpath, $allvariableshashref, $filesinpackage); }
1602 installer
::files
::save_file
($completeepmfilename ,\
@epmfile);
1604 # ... splitting the rootpath into a relocatable part and a static part, if possible
1606 my $staticpath = "";
1607 my $relocatablepath = "";
1608 # relocatable path can be defined in package list
1609 if ( $onepackage->{'relocatablepath'} ) { $relocatablepath = $onepackage->{'relocatablepath'}; }
1610 # setting fix part and variable part of destination path
1611 installer
::epmfile
::analyze_rootpath
($packagerootpath, \
$staticpath, \
$relocatablepath, $allvariableshashref);
1613 # ... replacing the variable PRODUCTDIRECTORYNAME in the shellscriptfile by $staticpath
1615 installer
::epmfile
::resolve_path_in_epm_list_before_packaging
(\
@epmfile, $completeepmfilename, "PRODUCTDIRECTORYNAME", $staticpath);
1616 installer
::epmfile
::resolve_path_in_epm_list_before_packaging
(\
@epmfile, $completeepmfilename, "SOLSUREPACKAGEPREFIX", $allvariableshashref->{'SOLSUREPACKAGEPREFIX'});
1617 installer
::epmfile
::resolve_path_in_epm_list_before_packaging
(\
@epmfile, $completeepmfilename, "UREPACKAGEPREFIX", $allvariableshashref->{'UREPACKAGEPREFIX'});
1618 # installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "BASISDIRECTORYVERSION", $allvariableshashref->{'OOOBASEVERSION'});
1619 installer
::files
::save_file
($completeepmfilename ,\
@epmfile);
1621 #######################################################
1622 # Now the complete content of the package is known,
1623 # including variables and shell scripts.
1624 # Create the package or using the package pool?
1625 #######################################################
1627 my $use_package_from_pool = 0;
1628 if ( $allvariableshashref->{'POOLPRODUCT'} ) { $use_package_from_pool = installer
::packagepool
::package_is_up_to_date
($allvariableshashref, $onepackage, $packagename, \
@epmfile, $filesinpackage, $installdir, $installer::globals
::epmoutpath
, $languagestringref); }
1630 if ( $use_package_from_pool == 3 ) # repeat this package later
1632 my $package_is_creatable = installer
::packagepool
::check_package_availability
($packagename);
1634 if (( ! $package_is_creatable ) && ( ! exists($installer::globals
::poolshiftedpackages
{$packagename}) ))
1636 splice(@
{$packages}, $k, 1); # removing package ...
1637 push(@
{$packages}, $onepackage); # ... and adding it to the end
1638 $installer::globals
::poolshiftedpackages
{$packagename} = 1; # only shifting each package once
1639 $k--; # decreasing the counter
1640 my $localinfoline = "\nPool: Package \"$packagename\" cannot be created at the moment. Trying again later (2).\n";
1641 installer
::logger
::print_message
($localinfoline);
1642 push( @installer::globals
::logfileinfo
, $localinfoline);
1643 next; # repeating this iteration with new package
1647 if ( $use_package_from_pool == 4 ) # There was a problem with pooling. Repeat this package immediately.
1649 $k--; # decreasing the counter
1650 my $localinfoline = "\nPool: Package \"$packagename\" had pooling problems. Repeating packaging immediately (3).\n";
1651 installer
::logger
::print_message
($localinfoline);
1652 push( @installer::globals
::logfileinfo
, $localinfoline);
1653 next; # repeating this iteration
1656 if ( $use_package_from_pool == 0 )
1658 # changing into the "install" directory to create installation sets
1660 $currentdir = cwd
(); # $currentdir is global in this file
1662 chdir($installdir); # changing into install directory ($installdir is global in this file)
1664 ###########################################
1666 ###########################################
1668 # With a patched epm, it is now possible to set the relocatable directory, change
1669 # the directory in which the packages are created, setting "requires" and "provides"
1670 # (Linux) or creating the "depend" file (Solaris) and finally to begin
1671 # the packaging process with standard tooling and standard parameter
1672 # Linux: Adding into the spec file: Prefix: /opt
1673 # Solaris: Adding into the pkginfo file: BASEDIR=/opt
1674 # Attention: Changing of the path can influence the shell scripts
1676 if (( $installer::globals
::is_special_epm
) && ( ($installer::globals
::islinuxrpmbuild
) || ($installer::globals
::issolarispkgbuild
) )) # special handling only for Linux RPMs and Solaris Packages
1678 if ( $installer::globals
::call_epm
) # only do something, if epm is really executed
1680 # ... now epm can be started, to create the installation sets
1682 installer
::logger
::print_message
( "... starting patched epm ... \n" );
1684 installer
::epmfile
::call_epm
($epmexecutable, $completeepmfilename, $packagename, $includepatharrayref);
1686 my $newepmdir = installer
::epmfile
::prepare_packages
($loggingdir, $packagename, $staticpath, $relocatablepath, $onepackage, $allvariableshashref, $filesinpackage, $languagestringref); # adding the line for Prefix / Basedir, include rpmdir
1688 installer
::epmfile
::create_packages_without_epm
($newepmdir, $packagename, $includepatharrayref, $allvariableshashref, $languagestringref); # start to package
1690 # finally removing all temporary files
1692 installer
::epmfile
::remove_temporary_epm_files
($newepmdir, $loggingdir, $packagename);
1695 # Install: pkgadd -a myAdminfile -d ./SUNWso8m34.pkg
1696 # Install: rpm -i --prefix=/opt/special --nodeps so8m35.rpm
1698 installer
::epmfile
::create_new_directory_structure
($newepmdir);
1699 $installer::globals
::postprocess_specialepm
= 1;
1701 # solaris patch not needed anymore
1702 # if (( $installer::globals::patch ) && ( $installer::globals::issolarisx86build )) { installer::worker::fix2_solaris_x86_patch($packagename, $installer::globals::epmoutpath); }
1705 else # this is the standard epm (not relocatable) or ( nonlinux and nonsolaris )
1707 installer
::epmfile
::resolve_path_in_epm_list_before_packaging
(\
@epmfile, $completeepmfilename, "\$\$PRODUCTINSTALLLOCATION", $relocatablepath);
1708 installer
::files
::save_file
($completeepmfilename ,\
@epmfile); # Warning for pool, content of epm file is changed.
1710 if ( $installer::globals
::call_epm
)
1712 # ... now epm can be started, to create the installation sets
1714 installer
::logger
::print_message
( "... starting unpatched epm ... \n" );
1716 if ( $installer::globals
::call_epm
) { installer
::epmfile
::call_epm
($epmexecutable, $completeepmfilename, $packagename, $includepatharrayref); }
1718 if (($installer::globals
::islinuxrpmbuild
) || ($installer::globals
::issolarispkgbuild
) || ($installer::globals
::debian
))
1720 $installer::globals
::postprocess_standardepm
= 1;
1725 if ( $allvariableshashref->{'POOLPRODUCT'} ) { installer
::packagepool
::put_content_into_pool
($packagename, $installdir, $installer::globals
::epmoutpath
, $filesinpackage, \
@epmfile); }
1727 chdir($currentdir); # changing back into start directory
1729 } # end of "if ( ! $use_package_from_pool )
1731 } # end of "if ( ! $installer::globals::simple )
1733 ###########################################
1734 # xpd installation mechanism
1735 ###########################################
1737 # Creating the xpd file for the package. This has to happen always, not determined by $use_package_from_pool
1739 if ( $installer::globals
::isxpdplatform
)
1741 if (( ! $installer::globals
::languagepack
) && ( ! $installer::globals
::patch
))
1743 if (( $allvariableshashref->{'XPDINSTALLER'} ) && ( $installer::globals
::call_epm
!= 0 ))
1745 installer
::xpdinstaller
::create_xpd_file
($onepackage, $packages, $languagestringref, $allvariableshashref, $modulesinproductarrayref, $installdir, $installer::globals
::epmoutpath
, $linkpackage, \
%installer::globals
::xpdpackageinfo
);
1746 $installer::globals
::xpd_files_prepared
= 1;
1747 %installer::globals
::xpdpackageinfo
= ();
1752 if ( $installer::globals
::makelinuxlinkrpm
) { $k--; } # decreasing the counter to create the link rpm!
1754 } # end of "for ( my $k = 0; $k <= $#{$packages}; $k++ )"
1756 installer
::packagepool
::log_pool_statistics
();
1758 ##############################################################
1759 # Post epm functionality, after the last package is packed
1760 ##############################################################
1762 if ( $installer::globals
::postprocess_specialepm
)
1764 installer
::logger
::include_header_into_logfile
("Post EPM processes (Patched EPM):");
1768 # Copying the cde, kde and gnome packages into the installation set
1769 if ( $installer::globals
::addsystemintegration
) { installer
::epmfile
::put_systemintegration_into_installset
($installer::globals
::epmoutpath
, $includepatharrayref, $allvariableshashref, $modulesinproductarrayref); }
1771 # Adding license and readme into installation set
1772 # if ($installer::globals::addlicensefile) { installer::epmfile::put_installsetfiles_into_installset($installer::globals::epmoutpath); }
1773 if ($installer::globals
::addlicensefile
) { installer
::worker
::put_scpactions_into_installset
("."); }
1775 # Adding child projects to installation dynamically
1776 if ($installer::globals
::addchildprojects
) { installer
::epmfile
::put_childprojects_into_installset
($installer::globals
::epmoutpath
, $allvariableshashref, $modulesinproductarrayref, $includepatharrayref); }
1778 # Adding license file into setup
1779 if ( $allvariableshashref->{'PUT_LICENSE_INTO_SETUP'} ) { installer
::worker
::put_license_into_setup
(".", $includepatharrayref); }
1781 # Creating installation set for Unix language packs, that are not part of multi lingual installation sets
1782 if ( ( $installer::globals
::languagepack
) && ( ! $installer::globals
::debian
) && ( ! $installer::globals
::makedownload
) ) { installer
::languagepack
::build_installer_for_languagepack
($installer::globals
::epmoutpath
, $allvariableshashref, $includepatharrayref, $languagesarrayref, $languagestringref); }
1784 # Finalizing patch installation sets
1785 if (( $installer::globals
::patch
) && ( $installer::globals
::issolarispkgbuild
)) { installer
::epmfile
::finalize_patch
($installer::globals
::epmoutpath
, $allvariableshashref); }
1786 if (( $installer::globals
::patch
) && ( $installer::globals
::islinuxrpmbuild
)) { installer
::epmfile
::finalize_linux_patch
($installer::globals
::epmoutpath
, $allvariableshashref, $includepatharrayref); }
1788 # Copying the xpd installer into the installation set
1789 if (( $allvariableshashref->{'XPDINSTALLER'} ) && ( $installer::globals
::isxpdplatform
) && ( $installer::globals
::xpd_files_prepared
))
1791 installer
::xpdinstaller
::create_xpd_installer
($installdir, $allvariableshashref, $languagestringref);
1792 $installer::globals
::addjavainstaller
= 0; # only one java installer possible
1795 # Copying the java installer into the installation set
1796 chdir($currentdir); # changing back into start directory
1797 if ( $installer::globals
::addjavainstaller
) { installer
::javainstaller
::create_java_installer
($installdir, $installer::globals
::epmoutpath
, $languagestringref, $languagesarrayref, $allvariableshashref, $includepatharrayref, $modulesinproductarrayref); }
1800 if ( $installer::globals
::postprocess_standardepm
)
1802 installer
::logger
::include_header_into_logfile
("Post EPM processes (Standard EPM):");
1806 # determine the destination directory
1807 my $newepmdir = installer
::epmfile
::determine_installdir_ooo
();
1809 # Copying the cde, kde and gnome packages into the installation set
1810 if ( $installer::globals
::addsystemintegration
) { installer
::epmfile
::put_systemintegration_into_installset
($newepmdir, $includepatharrayref, $allvariableshashref, $modulesinproductarrayref); }
1812 # Adding license and readme into installation set
1813 # if ($installer::globals::addlicensefile) { installer::epmfile::put_installsetfiles_into_installset($newepmdir); }
1814 if ($installer::globals
::addlicensefile
) { installer
::worker
::put_scpactions_into_installset
("."); }
1816 # Adding license file into setup
1817 if ( $allvariableshashref->{'PUT_LICENSE_INTO_SETUP'} ) { installer
::worker
::put_license_into_setup
(".", $includepatharrayref); }
1819 # Creating installation set for Unix language packs, that are not part of multi lingual installation sets
1820 if ( ( $installer::globals
::languagepack
) && ( ! $installer::globals
::debian
) && ( ! $installer::globals
::makedownload
) ) { installer
::languagepack
::build_installer_for_languagepack
($newepmdir, $allvariableshashref, $includepatharrayref, $languagesarrayref, $languagestringref); }
1822 chdir($currentdir); # changing back into start directory
1825 if (( $installer::globals
::issolarispkgbuild
) && ( $allvariableshashref->{'COLLECT_PKGMAP'} )) { installer
::worker
::collectpackagemaps
($installdir, $languagestringref, $allvariableshashref); }
1827 #######################################################
1828 # Analyzing the log file
1829 #######################################################
1832 my $finalinstalldir = "";
1834 installer
::worker
::clean_output_tree
(); # removing directories created in the output tree
1835 ($is_success, $finalinstalldir) = installer
::worker
::analyze_and_save_logfile
($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
1836 my $downloadname = installer
::ziplist
::getinfofromziplist
($allsettingsarrayref, "downloadname");
1837 if ( $is_success ) { installer
::followme
::save_followme_info
($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref, $current_install_number, $loggingdir, $installlogdir); }
1839 #######################################################
1840 # Creating download installation set
1841 #######################################################
1843 if ( $installer::globals
::makedownload
)
1845 my $create_download = 0;
1846 if ( $$downloadname ne "" ) { $create_download = 1; }
1847 if (( $is_success ) && ( $create_download ) && ( $ENV{'ENABLE_DOWNLOADSETS'} ))
1849 my $downloaddir = installer
::download
::create_download_sets
($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref);
1850 installer
::worker
::analyze_and_save_logfile
($loggingdir, $downloaddir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
1854 #######################################################
1855 # Creating jds installation set
1856 #######################################################
1858 if ( $installer::globals
::makejds
)
1862 if ( $allvariableshashref->{'JDSBUILD'} ) { $create_jds = 1; }
1863 if (! $installer::globals
::issolarispkgbuild
) { $create_jds = 0; }
1865 if (( $is_success ) && ( $create_jds ))
1867 if ( ! $installer::globals
::jds_language_controlled
)
1869 my $correct_language = installer
::worker
::check_jds_language
($allvariableshashref, $languagestringref);
1870 $installer::globals
::correct_jds_language
= $correct_language;
1871 $installer::globals
::jds_language_controlled
= 1;
1874 if ( $installer::globals
::correct_jds_language
)
1876 my $jdsdir = installer
::worker
::create_jds_sets
($finalinstalldir, $allvariableshashref, $languagestringref, $languagesarrayref, $includepatharrayref);
1877 installer
::worker
::clean_jds_temp_dirs
();
1878 installer
::worker
::analyze_and_save_logfile
($loggingdir, $jdsdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
1883 } # end of "if (!( $installer::globals::iswindowsbuild ))"
1885 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nEnd of part 2a: All non-Windows platforms\n"); }
1887 #################################################
1888 # Part 2b: The Windows platform
1889 #################################################
1891 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 2b: The Windows platform\n"); }
1893 #####################################################################
1894 # ... creating idt files ...
1895 # Only for Windows builds ($installer::globals::compiler is wntmsci)
1896 #####################################################################
1898 if ( $installer::globals
::iswindowsbuild
)
1900 ###########################################
1901 # Stripping libraries
1902 ###########################################
1904 # Building for gcc build in cws requires, that all files are stripped before packaging:
1905 # 1. copy all files that need to be stripped locally
1906 # 2. strip all these files
1908 if ( $installer::globals
::compiler
=~ /wntgcci/ )
1910 installer
::windows
::strip
::strip_binaries
($filesinproductlanguageresolvedarrayref, $languagestringref);
1911 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16e.log", $filesinproductlanguageresolvedarrayref); }
1914 $installdir = installer
::worker
::create_installation_directory
($shipinstalldir, $languagestringref, \
$current_install_number);
1916 my $idtdirbase = installer
::systemactions
::create_directories
("idt_files", $languagestringref);
1917 $installer::globals
::infodirectory
= installer
::systemactions
::create_directories
("info_files", $languagestringref);
1918 my $installlogdir = installer
::systemactions
::create_directory_next_to_directory
($installdir, "log");
1919 # my $installchecksumdir = installer::systemactions::create_directory_next_to_directory($installdir, "checksum");
1921 #################################################################################
1922 # Preparing cabinet files from package definitions
1923 #################################################################################
1925 # installer::packagelist::prepare_cabinet_files($packages, $allvariableshashref, $$languagestringref);
1926 installer
::packagelist
::prepare_cabinet_files
($packages, $allvariableshashref);
1927 # printing packages content:
1928 installer
::packagelist
::log_cabinet_assignments
();
1930 #################################################################################
1931 # Begin of functions that are used for the creation of idt files (Windows only)
1932 #################################################################################
1934 installer
::logger
::print_message
( "... creating idt files ...\n" );
1936 installer
::logger
::include_header_into_logfile
("Creating idt files:");
1938 my $newidtdir = $idtdirbase . $installer::globals
::separator
. "00"; # new files into language independent directory "00"
1939 installer
::systemactions
::create_directory
($newidtdir);
1941 my @allfilecomponents = ();
1942 my @allregistrycomponents = ();
1944 # Collecting all files with flag "BINARYTABLE"
1945 my $binarytablefiles = installer
::worker
::collect_all_items_with_special_flag
($filesinproductlanguageresolvedarrayref ,"BINARYTABLE");
1947 # Removing all files with flag "BINARYTABLE_ONLY"
1948 @installer::globals
::binarytableonlyfiles
= ();
1949 $filesinproductlanguageresolvedarrayref = installer
::worker
::remove_all_items_with_special_flag
($filesinproductlanguageresolvedarrayref ,"BINARYTABLE_ONLY");
1950 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles17.log", $filesinproductlanguageresolvedarrayref); }
1952 # Collecting all profileitems with flag "INIFILETABLE" for table "IniFile"
1953 my $inifiletableentries = installer
::worker
::collect_all_items_with_special_flag
($profileitemsinproductlanguageresolvedarrayref ,"INIFILETABLE");
1955 # Creating the important dynamic idt files
1956 installer
::windows
::msiglobal
::set_msiproductversion
($allvariableshashref);
1957 installer
::windows
::msiglobal
::put_msiproductversion_into_bootstrapfile
($filesinproductlanguageresolvedarrayref);
1959 # Add cabinet assignments to files
1960 installer
::windows
::file
::assign_cab_to_files
($filesinproductlanguageresolvedarrayref);
1961 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles17a.log", $filesinproductlanguageresolvedarrayref); }
1962 installer
::windows
::file
::assign_sequencenumbers_to_files
($filesinproductlanguageresolvedarrayref);
1963 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles17b.log", $filesinproductlanguageresolvedarrayref); }
1965 # Collection all available directory trees
1966 installer
::windows
::directory
::collectdirectorytrees
($directoriesforepmarrayref);
1968 $filesinproductlanguageresolvedarrayref = installer
::windows
::file
::create_files_table
($filesinproductlanguageresolvedarrayref, \
@allfilecomponents, $newidtdir, $allvariableshashref, $uniquefilename, $allupdatesequences, $allupdatecomponents, $allupdatefileorder);
1969 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles17c.log", $filesinproductlanguageresolvedarrayref); }
1970 if ( $installer::globals
::updatedatabase
) { installer
::windows
::file
::check_file_sequences
($allupdatefileorder, $allupdatecomponentorder); }
1972 installer
::windows
::directory
::create_directory_table
($directoriesforepmarrayref, $newidtdir, $allvariableshashref, $shortdirname);
1973 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles18.log", $filesinproductlanguageresolvedarrayref); }
1974 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforidt1.log", $directoriesforepmarrayref); }
1976 # Attention: The table "Registry.idt" contains language specific strings -> parameter: $languagesarrayref !
1977 installer
::windows
::registry
::create_registry_table
($registryitemsinproductlanguageresolvedarrayref, \
@allregistrycomponents, $newidtdir, $languagesarrayref, $allvariableshashref);
1978 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems4.log", $registryitemsinproductlanguageresolvedarrayref); }
1980 installer
::windows
::component
::create_component_table
($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $directoriesforepmarrayref, \
@allfilecomponents, \
@allregistrycomponents, $newidtdir, $componentid, $componentidkeypath);
1981 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles19.log", $filesinproductlanguageresolvedarrayref); }
1982 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems5.log", $registryitemsinproductlanguageresolvedarrayref); }
1984 # Attention: The table "Feature.idt" contains language specific strings -> parameter: $languagesarrayref !
1985 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules4.log", $modulesinproductlanguageresolvedarrayref); }
1986 installer
::windows
::feature
::add_uniquekey
($modulesinproductlanguageresolvedarrayref);
1987 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules4a.log", $modulesinproductlanguageresolvedarrayref); }
1988 $modulesinproductlanguageresolvedarrayref = installer
::windows
::feature
::sort_feature
($modulesinproductlanguageresolvedarrayref);
1989 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules4b.log", $modulesinproductlanguageresolvedarrayref); }
1990 installer
::windows
::feature
::create_feature_table
($modulesinproductlanguageresolvedarrayref, $newidtdir, $languagesarrayref, $allvariableshashref);
1992 installer
::windows
::featurecomponent
::create_featurecomponent_table
($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $newidtdir);
1994 installer
::windows
::media
::create_media_table
($filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref, $allupdatelastsequences, $allupdatediskids);
1995 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles20.log", $filesinproductlanguageresolvedarrayref); }
1997 installer
::windows
::font
::create_font_table
($filesinproductlanguageresolvedarrayref, $newidtdir);
1999 # Attention: The table "Shortcut.idt" contains language specific strings -> parameter: $languagesarrayref !
2000 # Attention: Shortcuts (Folderitems) have icon files, that have to be copied into the Icon directory (last parameter)
2001 my @iconfilecollector = ();
2003 installer
::windows
::shortcut
::create_shortcut_table
($filesinproductlanguageresolvedarrayref, $linksinproductlanguageresolvedarrayref, $folderinproductlanguageresolvedarrayref, $folderitemsinproductlanguageresolvedarrayref, $directoriesforepmarrayref, $newidtdir, $languagesarrayref, $includepatharrayref, \
@iconfilecollector);
2004 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folderitems4.log", $folderitemsinproductlanguageresolvedarrayref); }
2006 installer
::windows
::inifile
::create_inifile_table
($inifiletableentries, $filesinproductlanguageresolvedarrayref, $newidtdir);
2008 installer
::windows
::icon
::create_icon_table
(\
@iconfilecollector, $newidtdir); # creating the icon table with all iconfiles used as shortcuts (FolderItems)
2010 installer
::windows
::createfolder
::create_createfolder_table
($directoriesforepmarrayref, $filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref);
2012 installer
::windows
::upgrade
::create_upgrade_table
($newidtdir, $allvariableshashref);
2014 if ( ! $installer::globals
::languagepack
) # the following tables not for language packs
2016 installer
::windows
::removefile
::create_removefile_table
($folderitemsinproductlanguageresolvedarrayref, $newidtdir);
2018 installer
::windows
::selfreg
::create_selfreg_table
($filesinproductlanguageresolvedarrayref, $newidtdir);
2020 # Adding Assemblies into the tables MsiAssembly and MsiAssemblyName dynamically
2021 installer
::windows
::assembly
::create_msiassembly_table
($filesinproductlanguageresolvedarrayref, $newidtdir);
2022 installer
::windows
::assembly
::create_msiassemblyname_table
($filesinproductlanguageresolvedarrayref, $newidtdir);
2023 installer
::windows
::assembly
::add_assembly_condition_into_component_table
($filesinproductlanguageresolvedarrayref, $newidtdir);
2027 push(@installer::globals
::logfileinfo
, $infoline);
2029 # Localizing the language dependent idt files
2030 # For every language there will be a localized msi database
2031 # For multilingual installation sets, the differences of this
2032 # databases have to be stored in transforms.
2034 for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ )
2036 my $onelanguage = ${$languagesarrayref}[$m];
2039 if ( installer
::existence
::exists_in_array
($onelanguage, \
@installer::globals
::bidilanguages
) ) { $is_bidi = 1; }
2041 my $languageidtdir = $idtdirbase . $installer::globals
::separator
. $onelanguage;
2042 if ( -d
$languageidtdir ) { installer
::systemactions
::remove_complete_directory
($languageidtdir, 1); }
2043 installer
::systemactions
::create_directory
($languageidtdir);
2045 # Copy the template idt files and the new created idt files into this language directory
2047 installer
::logger
::print_message
( "... copying idt files ...\n" );
2049 installer
::logger
::include_header_into_logfile
("Copying idt files to $languageidtdir:");
2051 installer
::windows
::idtglobal
::prepare_language_idt_directory
($languageidtdir, $newidtdir, $onelanguage, $filesinproductlanguageresolvedarrayref, \
@iconfilecollector, $binarytablefiles, $allvariableshashref);
2053 if ( ! $installer::globals
::languagepack
)
2055 # For multilingual installation sets, the dialog for the language selection can now be prepared, with
2056 # a checkbox for each available language. This has to happen before the following translation.
2057 # The new controls have to be added into the Control.idt
2059 my $controlidttablename = $languageidtdir . $installer::globals
::separator
. "Control.idt";
2060 my $controlidttable = installer
::files
::read_file
($controlidttablename);
2061 installer
::windows
::idtglobal
::add_language_checkboxes_to_database
($controlidttable, $languagesarrayref);
2062 installer
::files
::save_file
($controlidttablename, $controlidttable);
2063 $infoline = "Added checkboxes for language selection dialog into table $controlidttablename\n";
2064 push(@installer::globals
::logfileinfo
, $infoline);
2067 # Now all files are copied into a language specific directory
2068 # The template idt files can be translated
2070 installer
::logger
::print_message
( "... localizing idt files (language: $onelanguage) ...\n" );
2072 installer
::logger
::include_header_into_logfile
("Localizing idt files (Language: $onelanguage):");
2074 my @translationfiles = (); # all idt files, that need a translation
2075 push(@translationfiles, "ActionTe.idt");
2076 push(@translationfiles, "Control.idt");
2077 push(@translationfiles, "CustomAc.idt");
2078 push(@translationfiles, "Error.idt");
2079 push(@translationfiles, "LaunchCo.idt");
2080 push(@translationfiles, "RadioBut.idt");
2081 push(@translationfiles, "Property.idt");
2082 push(@translationfiles, "UIText.idt");
2087 foreach $oneidtfilename (@translationfiles)
2089 my $languagefilename = installer
::windows
::idtglobal
::get_languagefilename
($oneidtfilename, $installer::globals
::idtlanguagepath
);
2090 my $languagefile = installer
::files
::read_file
($languagefilename);
2092 $oneidtfilename = $languageidtdir . $installer::globals
::separator
. $oneidtfilename;
2093 $oneidtfile = installer
::files
::read_file
($oneidtfilename);
2095 # Now the substitution can start
2096 installer
::windows
::idtglobal
::translate_idtfile
($oneidtfile, $languagefile, $onelanguage);
2098 installer
::files
::save_file
($oneidtfilename, $oneidtfile);
2100 $infoline = "Translated idt file: $oneidtfilename into language $onelanguage\n";
2101 push(@installer::globals
::logfileinfo
, $infoline);
2102 $infoline = "Used languagefile: $languagefilename\n";
2103 push(@installer::globals
::logfileinfo
, $infoline);
2106 # setting the encoding in every table (replacing WINDOWSENCODINGTEMPLATE)
2108 installer
::windows
::idtglobal
::setencoding
($languageidtdir, $onelanguage);
2110 # setting bidi attributes, if required
2112 if ( $is_bidi ) { installer
::windows
::idtglobal
::setbidiattributes
($languageidtdir, $onelanguage); }
2114 # setting the encoding in every table (replacing WINDOWSENCODINGTEMPLATE)
2115 installer
::windows
::idtglobal
::set_multilanguageonly_condition
($languageidtdir);
2117 # include the license text into the table Control.idt
2119 # my $licensefilesource = installer::windows::idtglobal::get_licensefilesource($onelanguage, $filesinproductlanguageresolvedarrayref);
2120 my $licensefilesource = installer
::windows
::idtglobal
::get_rtflicensefilesource
($onelanguage, $includepatharrayref_lang);
2121 my $licensefile = installer
::files
::read_file
($licensefilesource);
2122 installer
::scpzipfiles
::replace_all_ziplistvariables_in_rtffile
($licensefile, $allvariablesarrayref, $onelanguage, $loggingdir);
2123 my $controltablename = $languageidtdir . $installer::globals
::separator
. "Control.idt";
2124 my $controltable = installer
::files
::read_file
($controltablename);
2125 installer
::windows
::idtglobal
::add_licensefile_to_database
($licensefile, $controltable);
2126 installer
::files
::save_file
($controltablename, $controltable);
2128 $infoline = "Added licensefile $licensefilesource into database $controltablename\n";
2129 push(@installer::globals
::logfileinfo
, $infoline);
2131 # include office directory in CustomAction table
2133 installer
::windows
::idtglobal
::add_officedir_to_database
($languageidtdir, $allvariableshashref);
2135 # include a component into environment table if required
2137 installer
::windows
::component
::set_component_in_environment_table
($languageidtdir, $filesinproductlanguageresolvedarrayref);
2139 # include the ProductCode and the UpgradeCode from codes-file into the Property.idt
2141 installer
::windows
::property
::set_codes_in_property_table
($languageidtdir);
2143 # the language specific properties can now be set in the Property.idt
2145 installer
::windows
::property
::update_property_table
($languageidtdir, $onelanguage, $allvariableshashref, $languagestringref);
2147 # replacing variables in RegLocat.idt
2149 installer
::windows
::msiglobal
::update_reglocat_table
($languageidtdir, $allvariableshashref);
2151 # replacing variables in RemoveRe.idt (RemoveRegistry.idt)
2153 installer
::windows
::msiglobal
::update_removere_table
($languageidtdir);
2155 # adding language specific properties for multilingual installation sets
2157 installer
::windows
::property
::set_languages_in_property_table
($languageidtdir, $languagesarrayref);
2159 # adding settings into CheckBox.idt
2160 installer
::windows
::property
::update_checkbox_table
($languageidtdir, $allvariableshashref);
2162 # adding the files from the binary directory into the binary table
2163 installer
::windows
::binary
::update_binary_table
($languageidtdir, $filesinproductlanguageresolvedarrayref, $binarytablefiles);
2165 # setting patch codes to detect installed products
2167 if (( $installer::globals
::patch
) || ( $installer::globals
::languagepack
) || ( $allvariableshashref->{'PDFCONVERTER'} )) { installer
::windows
::patch
::update_patch_tables
($languageidtdir, $allvariableshashref); }
2169 # Adding Windows Installer CustomActions
2171 installer
::windows
::idtglobal
::addcustomactions
($languageidtdir, $windowscustomactionsarrayref, $filesinproductlanguageresolvedarrayref);
2173 # Adding child projects if specified
2175 if ($installer::globals
::addchildprojects
)
2177 # Adding child projects to installation dynamically (also in feature table)
2178 installer
::windows
::idtglobal
::add_childprojects
($languageidtdir, $filesinproductlanguageresolvedarrayref, $allvariableshashref);
2179 # setting Java variables for Java products
2180 if ( $allvariableshashref->{'JAVAPRODUCT'} ) { installer
::windows
::java
::update_java_tables
($languageidtdir, $allvariableshashref); }
2183 # Then the language specific msi database can be created
2185 if ( $installer::globals
::iswin
) # only possible on a Windows platform
2187 my $msidatabasename = installer
::windows
::msiglobal
::get_msidatabasename
($allvariableshashref, $onelanguage);
2188 my $msifilename = $languageidtdir . $installer::globals
::separator
. $msidatabasename;
2190 installer
::logger
::print_message
( "... creating msi database (language $onelanguage) ... \n" );
2192 installer
::windows
::msiglobal
::set_uuid_into_component_table
($languageidtdir, $allvariableshashref); # setting new GUID for the components using the tool uuidgen.exe
2193 installer
::windows
::msiglobal
::create_msi_database
($languageidtdir ,$msifilename);
2195 # validating the database # ToDo
2197 my $languagefile = installer
::files
::read_file
($installer::globals
::idtlanguagepath
. $installer::globals
::separator
. "SIS.mlf");
2198 # my $languagefile = installer::files::read_file($installer::globals::idtlanguagepath . $installer::globals::separator . "SIS.ulf");
2200 installer
::windows
::msiglobal
::write_summary_into_msi_database
($msifilename, $onelanguage, $languagefile, $allvariableshashref);
2202 # if there are Merge Modules, they have to be integrated now
2203 $filesinproductlanguageresolvedarrayref = installer
::windows
::mergemodule
::merge_mergemodules_into_msi_database
($mergemodulesarrayref, $filesinproductlanguageresolvedarrayref, $msifilename, $languagestringref, $onelanguage, $languagefile, $allvariableshashref, $includepatharrayref, $allupdatesequences, $allupdatelastsequences, $allupdatediskids);
2204 if (( $installer::globals
::globallogging
) && ($installer::globals
::globalloggingform21
)) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles21_" . $onelanguage . ".log", $filesinproductlanguageresolvedarrayref); }
2205 $installer::globals
::globalloggingform21
= 0;
2206 if ( $installer::globals
::use_packages_for_cabs
) { installer
::windows
::media
::create_media_table
($filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref, $allupdatelastsequences, $allupdatediskids); }
2208 # copy msi database into installation directory
2210 my $msidestfilename = $installdir . $installer::globals
::separator
. $msidatabasename;
2211 installer
::systemactions
::copy_one_file
($msifilename, $msidestfilename);
2215 # Creating transforms, if the installation set has more than one language
2216 # renaming the msi database and generating the setup.ini file
2218 my $defaultlanguage = installer
::languages
::get_default_language
($languagesarrayref);
2220 if ( $installer::globals
::iswin
) # only possible on a Windows platform
2222 if ( $#{$languagesarrayref} > 0 )
2224 installer
::windows
::msiglobal
::create_transforms
($languagesarrayref, $defaultlanguage, $installdir, $allvariableshashref);
2227 installer
::windows
::msiglobal
::rename_msi_database_in_installset
($defaultlanguage, $installdir, $allvariableshashref);
2229 if ( $allvariableshashref->{'ADDLANGUAGEINDATABASENAME'} ) { installer
::windows
::msiglobal
::add_language_to_msi_database
($defaultlanguage, $installdir, $allvariableshashref); }
2231 installer
::logger
::print_message
( "... generating setup.ini ...\n" );
2233 if ( ! $allvariableshashref->{'NOLOADERREQUIRED'} ) { installer
::windows
::msiglobal
::create_setup_ini
($languagesarrayref, $defaultlanguage, $installdir, $allvariableshashref); }
2236 # Analyzing the ScpActions and copying the files into the installation set
2237 # At least the loader.exe
2239 installer
::logger
::print_message
( "... copying files into installation set ...\n" );
2241 # installer::windows::msiglobal::copy_scpactions_into_installset($defaultlanguage, $installdir, $scpactionsinproductlanguageresolvedarrayref);
2242 installer
::worker
::put_scpactions_into_installset
($installdir);
2244 # ... copying the setup.exe
2246 installer
::windows
::msiglobal
::copy_windows_installer_files_into_installset
($installdir, $includepatharrayref, $allvariableshashref);
2248 # ... copying MergeModules into installation set
2250 if ( ! $installer::globals
::fix_number_of_cab_files
) { installer
::windows
::msiglobal
::copy_merge_modules_into_installset
($installdir); }
2252 # ... copying the child projects
2254 if ($installer::globals
::addchildprojects
)
2256 installer
::windows
::msiglobal
::copy_child_projects_into_installset
($installdir, $allvariableshashref);
2259 installer
::logger
::print_message
( "... creating ddf files ...\n" );
2261 # Creating all needed ddf files and generating a list
2262 # for the package process containing all system calls
2264 my $ddfdir = installer
::systemactions
::create_directories
("ddf", $languagestringref);
2266 $installer::globals
::packjobref
= installer
::windows
::msiglobal
::generate_cab_file_list
($filesinproductlanguageresolvedarrayref, $installdir, $ddfdir, $allvariableshashref);
2268 # Update and patch reasons the pack order needs to be saved
2269 installer
::windows
::msiglobal
::save_packorder
();
2272 push(@installer::globals
::logfileinfo
, $infoline);
2274 ####################################
2276 # before cab files are packed
2277 ####################################
2279 installer
::logger
::print_message
( "... creating log file $installer::globals::logfilename \n" );
2281 installer
::files
::save_file
($loggingdir . $installer::globals
::logfilename
, \
@installer::globals
::logfileinfo
);
2283 #######################################################
2284 # Finally really create the installation packages,
2285 # Only for Windows and only on a windows platform.
2286 #######################################################
2288 if ( $installer::globals
::iswin
) # only possible on a Windows platform
2290 installer
::logger
::print_message
( "... packaging installation set ... \n" );
2291 installer
::windows
::msiglobal
::execute_packaging
($installer::globals
::packjobref
, $loggingdir, $allvariableshashref);
2292 if ( $installer::globals
::include_cab_in_msi
) { installer
::windows
::msiglobal
::include_cabs_into_msi
($installdir); }
2294 ####################################
2296 # after cab files are packed
2297 ####################################
2299 installer
::logger
::print_message
( "\n... creating log file $installer::globals::logfilename \n" );
2300 installer
::files
::save_file
($loggingdir . $installer::globals
::logfilename
, \
@installer::globals
::logfileinfo
);
2303 #######################################################
2304 # Analyzing the log file
2305 #######################################################
2308 my $finalinstalldir = "";
2309 installer
::worker
::clean_output_tree
(); # removing directories created in the output tree
2310 ($is_success, $finalinstalldir) = installer
::worker
::analyze_and_save_logfile
($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
2312 #######################################################
2313 # Creating Windows msp patches
2314 #######################################################
2316 if (( $is_success ) && ( $installer::globals
::updatedatabase
) && ( $allvariableshashref->{'CREATE_MSP_INSTALLSET'} ))
2319 # Temp path for administrative installations: $installer::globals::temppath
2320 # Path of new installation set: $finalinstalldir
2321 # Path of old installation set: $installer::globals::updatedatabasepath
2322 my $mspdir = installer
::windows
::msp
::create_msp_patch
($finalinstalldir, $includepatharrayref, $allvariableshashref, $languagestringref, $languagesarrayref, $filesinproductlanguageresolvedarrayref);
2323 ($is_success, $finalinstalldir) = installer
::worker
::analyze_and_save_logfile
($loggingdir, $mspdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
2324 installer
::worker
::clean_output_tree
(); # removing directories created in the output tree
2327 #######################################################
2328 # Creating download installation set
2329 #######################################################
2331 my $create_download = 0;
2332 my $downloadname = installer
::ziplist
::getinfofromziplist
($allsettingsarrayref, "downloadname");
2333 if ( $installer::globals
::languagepack
) { $downloadname = installer
::ziplist
::getinfofromziplist
($allsettingsarrayref, "langpackdownloadname"); }
2334 if ( $installer::globals
::patch
) { $downloadname = installer
::ziplist
::getinfofromziplist
($allsettingsarrayref, "patchdownloadname"); }
2336 if ( $is_success ) { installer
::followme
::save_followme_info
($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref, $current_install_number, $loggingdir, $installlogdir); }
2338 if ( $$downloadname ne "" ) { $create_download = 1; }
2339 if (( $is_success ) && ( $create_download ) && ( $ENV{'ENABLE_DOWNLOADSETS'} ))
2341 my $downloaddir = installer
::download
::create_download_sets
($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref);
2342 installer
::worker
::analyze_and_save_logfile
($loggingdir, $downloaddir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
2345 } # end of "if ( $installer::globals::iswindowsbuild )"
2347 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nEnd of part 2b: The Windows platform\n"); }
2349 # saving file_info file for later analysis
2350 my $speciallogfilename = "fileinfo_" . $installer::globals
::product
. "\.log";
2351 installer
::files
::save_array_of_hashes
($loggingdir . $speciallogfilename, $filesinproductlanguageresolvedarrayref);
2353 } # end of iteration for one language group
2355 # saving debug info at end
2356 if ( $installer::globals
::debug
) { installer
::logger
::savedebug
($installer::globals
::exitlog
); }
2358 #######################################################
2360 #######################################################
2362 installer
::logger
::stoptime
();
2364 ####################################
2366 ####################################