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 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
36 use lib
("$ENV{SOLARENV}/bin/modules");
40 use installer
::archivefiles
;
41 use installer
::control
;
42 use installer
::converter
;
43 use installer
::copyproject
;
44 use installer
::download
;
45 use installer
::environment
;
46 use installer
::epmfile
;
47 use installer
::exiter
;
49 use installer
::followme
;
50 use installer
::globals
;
51 use installer
::javainstaller
;
52 use installer
::languagepack
;
53 use installer
::languages
;
54 use installer
::logger
;
56 use installer
::packagelist
;
57 use installer
::parameter
;
58 use installer
::pathanalyzer
;
59 use installer
::profiles
;
60 use installer
::regmerge
;
61 use installer
::scppatchsoname
;
62 use installer
::scpzipfiles
;
63 use installer
::scriptitems
;
64 use installer
::servicesfile
;
65 use installer
::setupscript
;
66 use installer
::simplepackage
;
67 use installer
::sorter
;
69 use installer
::substfilenamefiles
;
71 use installer
::systemactions
;
72 use installer
::windows
::assembly
;
73 use installer
::windows
::binary
;
74 use installer
::windows
::component
;
75 use installer
::windows
::createfolder
;
76 use installer
::windows
::directory
;
77 use installer
::windows
::feature
;
78 use installer
::windows
::featurecomponent
;
79 use installer
::windows
::file
;
80 use installer
::windows
::font
;
81 use installer
::windows
::icon
;
82 use installer
::windows
::idtglobal
;
83 use installer
::windows
::inifile
;
84 use installer
::windows
::java
;
85 use installer
::windows
::media
;
86 use installer
::windows
::mergemodule
;
87 use installer
::windows
::msiglobal
;
88 use installer
::windows
::msp
;
89 use installer
::windows
::patch
;
90 use installer
::windows
::property
;
91 use installer
::windows
::removefile
;
92 use installer
::windows
::registry
;
93 use installer
::windows
::selfreg
;
94 use installer
::windows
::shortcut
;
95 use installer
::windows
::strip
;
96 use installer
::windows
::update
;
97 use installer
::windows
::upgrade
;
98 use installer
::worker
;
99 use installer
::xpdinstaller
;
100 use installer
::ziplist
;
102 #################################################
104 #################################################
106 #################################################
107 # Part 1: The platform independent part
108 #################################################
110 #################################################
111 # Part 1a: The language independent part
112 #################################################
114 installer
::logger
::starttime
();
116 #########################################
117 # Checking the environment and setting
118 # most important variables
119 #########################################
121 installer
::logger
::print_message
( "... checking environment variables ...\n" );
122 my $environmentvariableshashref = installer
::control
::check_system_environment
();
124 installer
::environment
::set_global_environment_variables
($environmentvariableshashref);
126 #################################
127 # Check and output of parameter
128 #################################
130 installer
::parameter
::saveparameter
();
131 installer
::parameter
::getparameter
();
133 # debugging can start after function "getparameter"
134 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 1: The platform independent part\n"); }
135 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 1a: The language independent part\n"); }
137 installer
::parameter
::control_fundamental_parameter
();
138 installer
::parameter
::setglobalvariables
();
139 installer
::parameter
::control_required_parameter
();
141 if (!($installer::globals
::languages_defined_in_productlist
)) { installer
::languages
::analyze_languagelist
(); }
142 installer
::parameter
::outputparameter
();
144 installer
::control
::check_updatepack
();
146 $installer::globals
::build
= uc($installer::globals
::build
); # using "SRC680" instead of "src680"
148 ######################################
149 # Creating the log directory
150 ######################################
152 my $loggingdir = installer
::systemactions
::create_directories
("logging", "");
153 $loggingdir = $loggingdir . $installer::globals
::separator
;
154 $installer::globals
::exitlog
= $loggingdir;
158 my $shipinstalldir = "";
159 my $current_install_number = "";
161 ######################################
162 # Checking the system requirements
163 ######################################
165 installer
::logger
::print_message
( "... checking required files ...\n" );
166 installer
::control
::check_system_path
();
168 my $pathvariableshashref = installer
::environment
::create_pathvariables
($environmentvariableshashref);
170 ###############################################
171 # Checking saved setting for Windows patches
172 ###############################################
174 if (( $installer::globals
::iswindowsbuild
) && ( $installer::globals
::prepare_winpatch
)) { installer
::windows
::msiglobal
::read_saved_mappings
(); }
176 ###################################################
177 # Analyzing the settings and variables in zip.lst
178 ###################################################
180 installer
::logger
::globallog
("zip list file: $installer::globals::ziplistname");
182 my $ziplistref = installer
::files
::read_file
($installer::globals
::ziplistname
);
184 installer
::logger
::print_message
( "... analyzing $installer::globals::ziplistname ... \n" );
186 my ($productblockref, $parent) = installer
::ziplist
::getproductblock
($ziplistref, $installer::globals
::product
, 1); # product block from zip.lst
187 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "productblock.log" ,$productblockref); }
189 my ($settingsblockref, undef) = installer
::ziplist
::getproductblock
($productblockref, "Settings", 0); # settings block from zip.lst
190 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "settingsblock1.log" ,$settingsblockref); }
192 $settingsblockref = installer
::ziplist
::analyze_settings_block
($settingsblockref); # select data from settings block in zip.lst
193 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "settingsblock2.log" ,$settingsblockref); }
195 my $allsettingsarrayref = installer
::ziplist
::get_settings_from_ziplist
($settingsblockref);
196 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allsettings1.log" ,$allsettingsarrayref); }
198 my $allvariablesarrayref = installer
::ziplist
::get_variables_from_ziplist
($settingsblockref);
199 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allvariables1.log" ,$allvariablesarrayref); }
201 my ($globalproductblockref, undef) = installer
::ziplist
::getproductblock
($ziplistref, $installer::globals
::globalblock
, 0); # global product block from zip.lst
202 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "globalproductblock.log" ,$globalproductblockref); }
204 while (defined $parent)
206 my $parentproductblockref;
207 ($parentproductblockref, $parent) = installer
::ziplist
::getproductblock
(
208 $ziplistref, $parent, 1);
209 my ($parentsettingsblockref, undef) = installer
::ziplist
::getproductblock
(
210 $parentproductblockref, "Settings", 0);
211 $parentsettingsblockref = installer
::ziplist
::analyze_settings_block
(
212 $parentsettingsblockref);
213 my $allparentsettingsarrayref =
214 installer
::ziplist
::get_settings_from_ziplist
($parentsettingsblockref);
215 my $allparentvariablesarrayref =
216 installer
::ziplist
::get_variables_from_ziplist
($parentsettingsblockref);
217 $allsettingsarrayref =
218 installer
::converter
::combine_arrays_from_references_first_win
(
219 $allsettingsarrayref, $allparentsettingsarrayref)
220 if $#{$allparentsettingsarrayref} > -1;
221 $allvariablesarrayref =
222 installer
::converter
::combine_arrays_from_references_first_win
(
223 $allvariablesarrayref, $allparentvariablesarrayref)
224 if $#{$allparentvariablesarrayref} > -1;
227 if ( $#{$globalproductblockref} > -1 )
229 my ($globalsettingsblockref, undef) = installer
::ziplist
::getproductblock
($globalproductblockref, "Settings", 0); # settings block from zip.lst
230 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "globalsettingsblock1.log" ,$globalsettingsblockref); }
232 $globalsettingsblockref = installer
::ziplist
::analyze_settings_block
($globalsettingsblockref); # select data from settings block in zip.lst
233 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "globalsettingsblock2.log" ,$globalsettingsblockref); }
235 my $allglobalsettingsarrayref = installer
::ziplist
::get_settings_from_ziplist
($globalsettingsblockref);
236 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allglobalsettings1.log" ,$allglobalsettingsarrayref); }
238 my $allglobalvariablesarrayref = installer
::ziplist
::get_variables_from_ziplist
($globalsettingsblockref);
239 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allglobalvariables1.log" ,$allglobalvariablesarrayref); }
241 if ( $#{$allglobalsettingsarrayref} > -1 ) { $allsettingsarrayref = installer::converter::combine_arrays_from_references_first_win($allsettingsarrayref, $allglobalsettingsarrayref); }
242 if ( $#{$allglobalvariablesarrayref} > -1 ) { $allvariablesarrayref = installer::converter::combine_arrays_from_references_first_win($allvariablesarrayref, $allglobalvariablesarrayref); }
245 $allsettingsarrayref = installer
::ziplist
::remove_multiples_from_ziplist
($allsettingsarrayref); # the settings from the zip.lst
246 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allsettings2.log" ,$allsettingsarrayref); }
248 $allvariablesarrayref = installer
::ziplist
::remove_multiples_from_ziplist
($allvariablesarrayref);
249 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allvariables2.log" ,$allvariablesarrayref); }
251 installer
::ziplist
::replace_variables_in_ziplist_variables
($allvariablesarrayref);
252 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allvariables2a.log" ,$allvariablesarrayref); }
254 my $allvariableshashref = installer
::converter
::convert_array_to_hash
($allvariablesarrayref); # the variables from the zip.lst
255 if ( $installer::globals
::globallogging
) { installer
::files
::save_hash
($loggingdir . "allvariables3.log", $allvariableshashref); }
257 installer
::ziplist
::set_default_productversion_if_required
($allvariableshashref);
258 if ( $installer::globals
::globallogging
) { installer
::files
::save_hash
($loggingdir . "allvariables3a.log", $allvariableshashref); }
260 installer
::ziplist
::add_variables_to_allvariableshashref
($allvariableshashref);
261 if ( $installer::globals
::globallogging
) { installer
::files
::save_hash
($loggingdir . "allvariables3b.log", $allvariableshashref); }
263 ########################################################
264 # Check if this is simple packaging mechanism
265 ########################################################
267 installer
::simplepackage
::check_simple_packager_project
($allvariableshashref);
269 ####################################################################
270 # setting global variables
271 ####################################################################
273 installer
::control
::set_addchildprojects
($allvariableshashref);
274 installer
::control
::set_addjavainstaller
($allvariableshashref);
275 installer
::control
::set_addsystemintegration
($allvariableshashref);
277 ########################################################
278 # Re-define logging dir, after all variables are set
279 ########################################################
281 my $oldloggingdir = $loggingdir;
282 installer
::systemactions
::remove_empty_directory
($oldloggingdir);
283 $loggingdir = installer
::systemactions
::create_directories
("logging", "");
284 $loggingdir = $loggingdir . $installer::globals
::separator
;
285 $installer::globals
::exitlog
= $loggingdir;
287 # checking, whether this is an opensource product
289 if (!($installer::globals
::is_copy_only_project
)) { installer
::ziplist
::set_manufacturer
($allvariableshashref); }
291 ##############################################
292 # Checking version of makecab.exe
293 ##############################################
295 if ( $installer::globals
::iswindowsbuild
) { installer
::control
::check_makecab_version
(); }
297 ##########################################################
298 # Getting the include path from the settings in zip list
299 ##########################################################
301 my $includepathref = installer
::ziplist
::getinfofromziplist
($allsettingsarrayref, "include");
302 if ( $$includepathref eq "" )
304 installer
::exiter
::exit_program
("ERROR: Definition for \"include\" not found in $installer::globals::ziplistname", "Main");
307 my $includepatharrayref = installer
::converter
::convert_stringlist_into_array
($includepathref, ",");
308 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray1.log" ,$includepatharrayref); }
310 installer
::ziplist
::replace_all_variables_in_pathes
($includepatharrayref, $pathvariableshashref);
311 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray2.log" ,$includepatharrayref); }
313 installer
::ziplist
::replace_minor_in_pathes
($includepatharrayref);
314 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray3.log" ,$includepatharrayref); }
316 installer
::ziplist
::replace_packagetype_in_pathes
($includepatharrayref);
317 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray3a.log" ,$includepatharrayref); }
319 installer
::ziplist
::resolve_relative_pathes
($includepatharrayref);
320 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray3b.log" ,$includepatharrayref); }
322 installer
::ziplist
::remove_ending_separator
($includepatharrayref);
323 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray3c.log" ,$includepatharrayref); }
325 ##############################################
326 # Collecting all files from all include
327 # pathes in global hashes.
328 ##############################################
330 installer
::worker
::collect_all_files_from_includepathes
($includepatharrayref);
332 ##############################################
333 # Analyzing languages in zip.lst if required
334 # Probably no longer used.
335 ##############################################
337 if ($installer::globals
::languages_defined_in_productlist
) { installer
::languages
::get_info_about_languages
($allsettingsarrayref); }
339 #####################################
340 # Windows requires the encoding list
341 #####################################
343 if ( $installer::globals
::iswindowsbuild
) { installer
::control
::read_encodinglist
($includepatharrayref); }
345 #####################################################################
346 # Including additional inc files for variable settings, if defined
347 #####################################################################
349 if ( $allvariableshashref->{'ADD_INCLUDE_FILES'} ) { installer
::worker
::add_variables_from_inc_to_hashref
($allvariableshashref, $includepatharrayref); }
351 ################################################
352 # Disable xpd installer, if SOLAR_JAVA not set
353 ################################################
355 installer
::control
::check_java_for_xpd
($allvariableshashref);
357 #####################################
358 # Analyzing the setup script
359 #####################################
361 if ($installer::globals
::setupscript_defined_in_productlist
) { installer
::setupscript
::set_setupscript_name
($allsettingsarrayref, $includepatharrayref); }
363 installer
::logger
::globallog
("setup script file: $installer::globals::setupscriptname");
365 installer
::logger
::print_message
( "... analyzing script: $installer::globals::setupscriptname ... \n" );
367 my $setupscriptref = installer
::files
::read_file
($installer::globals
::setupscriptname
); # Reading the setup script file
369 # Resolving variables defined in the zip list file into setup script
370 # All the variables are defined in $allvariablesarrayref
372 installer
::scpzipfiles
::replace_all_ziplistvariables_in_file
($setupscriptref, $allvariableshashref);
373 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscript1.log" ,$setupscriptref); }
375 # Resolving %variables defined in the installation object
377 my $allscriptvariablesref = installer
::setupscript
::get_all_scriptvariables_from_installation_object
($setupscriptref);
378 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscriptvariables1.log" ,$allscriptvariablesref); }
380 installer
::setupscript
::add_lowercase_productname_setupscriptvariable
($allscriptvariablesref);
381 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscriptvariables2.log" ,$allscriptvariablesref); }
383 installer
::setupscript
::resolve_lowercase_productname_setupscriptvariable
($allscriptvariablesref);
384 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscriptvariables3.log" ,$allscriptvariablesref); }
386 $setupscriptref = installer
::setupscript
::replace_all_setupscriptvariables_in_script
($setupscriptref, $allscriptvariablesref);
387 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscript2.log" ,$setupscriptref); }
389 # Adding all variables defined in the installation object into the hash of all variables.
390 # This is needed if variables are defined in the installation object, but not in the zip list file.
391 # If there is a definition in the zip list file and in the installation object, the installation object is more important
393 installer
::setupscript
::add_installationobject_to_variables
($allvariableshashref, $allscriptvariablesref);
394 if ( $installer::globals
::globallogging
) { installer
::files
::save_hash
($loggingdir . "allvariables4.log", $allvariableshashref); }
396 # Adding also all variables, that must be included into the $allvariableshashref.
397 installer
::setupscript
::add_forced_properties
($allvariableshashref);
398 if ( $installer::globals
::globallogging
) { installer
::files
::save_hash
($loggingdir . "allvariables5.log", $allvariableshashref); }
400 installer
::scpzipfiles
::replace_all_ziplistvariables_in_file
($setupscriptref, $allvariableshashref);
401 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "setupscript3.log" ,$setupscriptref); }
403 installer
::logger
::log_hashref
($allvariableshashref);
405 installer
::logger
::print_message
( "... analyzing directories ... \n" );
407 # Collect all directories in the script to get the destination dirs
409 my $dirsinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Directory");
410 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories1.log", $dirsinproductarrayref); }
412 if ( $allvariableshashref->{'SHIFT_BASIS_INTO_BRAND_LAYER'} ) { $dirsinproductarrayref = installer
::scriptitems
::shift_basis_directory_parents
($dirsinproductarrayref); }
413 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories1a.log", $dirsinproductarrayref); }
415 installer
::scriptitems
::resolve_all_directory_names
($dirsinproductarrayref);
416 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories2.log", $dirsinproductarrayref); }
418 installer
::logger
::print_message
( "... analyzing files ... \n" );
420 my $filesinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "File");
421 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles1.log", $filesinproductarrayref); }
423 $filesinproductarrayref = installer
::scriptitems
::remove_delete_only_files_from_productlists
($filesinproductarrayref);
424 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2.log", $filesinproductarrayref); }
426 if (( ! $installer::globals
::iswindowsbuild
) &&
427 ( ! $installer::globals
::islinuxrpmbuild
) &&
428 ( ! $installer::globals
::islinuxdebbuild
) &&
429 ( ! $installer::globals
::issolarispkgbuild
) &&
430 ( $installer::globals
::packageformat
ne "installed" ) &&
431 ( $installer::globals
::packageformat
ne "dmg" ) &&
432 ( $installer::globals
::packageformat
ne "archive" ))
433 { installer
::control
::check_oxtfiles
($filesinproductarrayref); }
435 if ($installer::globals
::product
=~ /suite/i ) { $filesinproductarrayref = installer
::scriptitems
::remove_notinsuite_files_from_productlists
($filesinproductarrayref); }
436 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2aa.log", $filesinproductarrayref); }
438 if (! $installer::globals
::languagepack
)
440 $filesinproductarrayref = installer
::scriptitems
::remove_Languagepacklibraries_from_Installset
($filesinproductarrayref);
441 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2b.log", $filesinproductarrayref); }
444 if (! $installer::globals
::patch
)
446 $filesinproductarrayref = installer
::scriptitems
::remove_patchonlyfiles_from_Installset
($filesinproductarrayref);
447 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2c.log", $filesinproductarrayref); }
450 if (! $installer::globals
::tab
)
452 $filesinproductarrayref = installer
::scriptitems
::remove_tabonlyfiles_from_Installset
($filesinproductarrayref);
453 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2c.log", $filesinproductarrayref); }
456 if (( $installer::globals
::packageformat
ne "installed" ) && ( $installer::globals
::packageformat
ne "archive" ))
458 $filesinproductarrayref = installer
::scriptitems
::remove_installedproductonlyfiles_from_Installset
($filesinproductarrayref);
459 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2cc.log", $filesinproductarrayref); }
462 installer
::logger
::print_message
( "... analyzing scpactions ... \n" );
464 my $scpactionsinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "ScpAction");
465 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions1.log", $scpactionsinproductarrayref); }
467 if (( ! $allvariableshashref->{'XPDINSTALLER'} ) || ( ! $installer::globals
::isxpdplatform
))
469 $scpactionsinproductarrayref = installer
::scriptitems
::remove_Xpdonly_Items
($scpactionsinproductarrayref);
470 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions1a.log", $scpactionsinproductarrayref); }
473 # $scpactionsinproductarrayref = installer::scriptitems::remove_scpactions_without_name($scpactionsinproductarrayref);
474 # if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions2.log", $scpactionsinproductarrayref); }
476 installer
::scriptitems
::change_keys_of_scpactions
($scpactionsinproductarrayref);
477 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions2.log", $scpactionsinproductarrayref); }
479 installer
::logger
::print_message
( "... analyzing shortcuts ... \n" );
481 my $linksinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Shortcut");
482 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks1.log", $linksinproductarrayref); }
484 installer
::logger
::print_message
( "... analyzing unix links ... \n" );
486 my $unixlinksinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Unixlink");
487 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks1.log", $unixlinksinproductarrayref); }
489 # $unixlinksinproductarrayref = installer::scriptitems::filter_layerlinks_from_unixlinks($unixlinksinproductarrayref);
490 # if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks1b.log", $unixlinksinproductarrayref); }
492 installer
::logger
::print_message
( "... analyzing profile ... \n" );
494 my $profilesinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Profile");
495 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profiles1.log", $profilesinproductarrayref); }
497 installer
::logger
::print_message
( "... analyzing profileitems ... \n" );
499 my $profileitemsinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "ProfileItem");
500 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profileitems1.log", $profileitemsinproductarrayref); }
502 my $folderinproductarrayref;
503 my $folderitemsinproductarrayref;
504 my $registryitemsinproductarrayref;
505 my $windowscustomactionsarrayref;
506 my $mergemodulesarrayref;
508 if ( $installer::globals
::iswindowsbuild
) # Windows specific items: Folder, FolderItem, RegistryItem, WindowsCustomAction
510 installer
::logger
::print_message
( "... analyzing folders ... \n" );
512 $folderinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Folder");
513 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folder1.log", $folderinproductarrayref); }
515 installer
::logger
::print_message
( "... analyzing folderitems ... \n" );
517 $folderitemsinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "FolderItem");
518 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folderitems1.log", $folderitemsinproductarrayref); }
520 installer
::setupscript
::add_predefined_folder
($folderitemsinproductarrayref, $folderinproductarrayref);
521 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folder1b.log", $folderinproductarrayref); }
523 installer
::setupscript
::prepare_non_advertised_files
($folderitemsinproductarrayref, $filesinproductarrayref);
524 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles2d.log", $filesinproductarrayref); }
526 installer
::logger
::print_message
( "... analyzing registryitems ... \n" );
528 $registryitemsinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "RegistryItem");
529 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems1.log", $registryitemsinproductarrayref); }
531 $registryitemsinproductarrayref = installer
::scriptitems
::remove_uninstall_regitems_from_script
($registryitemsinproductarrayref);
532 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems1b.log", $registryitemsinproductarrayref); }
534 installer
::logger
::print_message
( "... analyzing Windows custom actions ... \n" );
536 $windowscustomactionsarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "WindowsCustomAction");
537 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "windowscustomactions1.log", $windowscustomactionsarrayref); }
539 installer
::logger
::print_message
( "... analyzing Windows merge modules ... \n" );
541 $mergemodulesarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "MergeModule");
542 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "mergemodules1.log", $mergemodulesarrayref); }
545 my $modulesinproductarrayref;
547 if (!($installer::globals
::is_copy_only_project
))
549 installer
::logger
::print_message
( "... analyzing modules ... \n" );
551 $modulesinproductarrayref = installer
::setupscript
::get_all_items_from_script
($setupscriptref, "Module");
552 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules1.log", $modulesinproductarrayref); }
554 if (( ! $allvariableshashref->{'XPDINSTALLER'} ) || ( ! $installer::globals
::isxpdplatform
))
556 $modulesinproductarrayref = installer
::scriptitems
::remove_Xpdonly_Items
($modulesinproductarrayref);
557 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules1a.log", $modulesinproductarrayref); }
560 installer
::scriptitems
::resolve_assigned_modules
($modulesinproductarrayref);
561 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules1b.log", $modulesinproductarrayref); }
563 $modulesinproductarrayref = installer
::scriptitems
::remove_template_modules
($modulesinproductarrayref);
564 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules1c.log", $modulesinproductarrayref); }
566 installer
::scriptitems
::set_children_flag
($modulesinproductarrayref);
567 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules1d.log", $modulesinproductarrayref); }
569 installer
::scriptitems
::collect_all_languagemodules
($modulesinproductarrayref);
571 # Assigning the modules to the items
573 installer
::scriptitems
::assigning_modules_to_items
($modulesinproductarrayref, $filesinproductarrayref, "Files");
574 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles3.log", $filesinproductarrayref); }
576 installer
::scriptitems
::assigning_modules_to_items
($modulesinproductarrayref, $unixlinksinproductarrayref, "Unixlinks");
577 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks2.log", $unixlinksinproductarrayref); }
579 installer
::scriptitems
::assigning_modules_to_items
($modulesinproductarrayref, $dirsinproductarrayref, "Dirs");
580 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories2aa.log", $dirsinproductarrayref); }
583 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nEnd of part 1a: The language independent part\n"); }
585 # saving debug info, before staring part 1b
586 if ( $installer::globals
::debug
) { installer
::logger
::savedebug
($installer::globals
::exitlog
); }
588 #################################################
589 # Part 1b: The language dependent part
590 # (still platform independent)
591 #################################################
593 # Now starts the language dependent part, if more than one product is defined on the command line
594 # Example -l en-US,de#es,fr,it defines two multilingual products
596 ###############################################################################
597 # Beginning of language dependent part
598 # The for iterates over all products, separated by an # in the language list
599 ###############################################################################
601 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 1b: The language dependent part\n"); }
603 for ( my $n = 0; $n <= $#installer::globals
::languageproducts
; $n++ )
605 my $languagesarrayref = installer
::languages
::get_all_languages_for_one_product
($installer::globals
::languageproducts
[$n], $allvariableshashref);
606 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "languages.log" ,$languagesarrayref); }
608 $installer::globals
::alllanguagesinproductarrayref
= $languagesarrayref;
609 my $languagestringref = installer
::languages
::get_language_string
($languagesarrayref);
610 installer
::logger
::print_message
( "------------------------------------\n" );
611 installer
::logger
::print_message
( "... languages $$languagestringref ... \n" );
613 if ( $installer::globals
::patch
)
615 $installer::globals
::addlicensefile
= 0; # no license files for patches
616 $installer::globals
::makedownload
= 0;
617 $installer::globals
::makejds
= 0;
620 if ( $installer::globals
::languagepack
)
622 $installer::globals
::addchildprojects
= 0;
623 $installer::globals
::addsystemintegration
= 0;
624 $installer::globals
::makejds
= 0;
625 $installer::globals
::addlicensefile
= 0;
627 if ( $allvariableshashref->{'OPENSOURCE'} ) { $installer::globals
::makedownload
= 1; }
628 else { $installer::globals
::makedownload
= 0; }
631 ############################################################
632 # Beginning of language specific logging mechanism
633 # Until now only global logging into default: logfile.txt
634 ############################################################
636 @installer::globals
::logfileinfo
= (); # new logfile array and new logfile name
637 installer
::logger
::copy_globalinfo_into_logfile
();
638 $installer::globals
::globalinfo_copied
= 1;
641 my $avoidlanginlog = 0;
642 if ( $installer::globals
::updatepack
) { $logminor = $installer::globals
::lastminor
; }
643 else { $logminor = $installer::globals
::minor
; }
645 my $loglanguagestring = $$languagestringref;
646 my $loglanguagestring_orig = $loglanguagestring;
647 if (length($loglanguagestring) > $installer::globals
::max_lang_length
)
649 chomp(my $shorter = `echo $loglanguagestring | md5sum | sed -e "s/ .*//g"`);
650 $loglanguagestring = $shorter;
654 $installer::globals
::logfilename
= "log_" . $installer::globals
::build
;
655 if ( $logminor ne "" ) { $installer::globals
::logfilename
.= "_" . $logminor; }
656 if ( ! $avoidlanginlog ) { $installer::globals
::logfilename
.= "_" . $loglanguagestring; }
657 $installer::globals
::logfilename
.= ".log";
658 $loggingdir = $loggingdir . $loglanguagestring . $installer::globals
::separator
;
659 installer
::systemactions
::create_directory
($loggingdir);
661 if ($loglanguagestring ne $loglanguagestring_orig) {
662 (my $dir = $loggingdir) =~ s!/$!!;
663 open(my $F1, "> $dir.dir");
664 open(my $F2, "> " . $loggingdir . $installer::globals
::logfilename
. '.file');
665 my @s = map { "$_\n" } split('_', $loglanguagestring_orig);
670 $installer::globals
::exitlog
= $loggingdir;
672 ##############################################################
673 # Determining the ship location, if this is an update pack
674 ##############################################################
676 if ( $installer::globals
::updatepack
) { $shipinstalldir = installer
::control
::determine_ship_directory
($languagestringref); }
678 ###################################################################
679 # Reading an existing msi database, to prepare update and patch
680 ###################################################################
682 my $refdatabase = "";
683 my $uniquefilename = "";
684 my $revuniquefilename = "";
685 my $revshortfilename = "";
686 my $allupdatesequences = "";
687 my $allupdatecomponents = "";
688 my $allupdatefileorder = "";
689 my $allupdatecomponentorder = "";
690 my $shortdirname = "";
691 my $componentid = "";
692 my $componentidkeypath = "";
693 my $alloldproperties = "";
694 my $allupdatelastsequences = "";
695 my $allupdatediskids = "";
697 if ( $installer::globals
::iswindowsbuild
)
699 if ( $allvariableshashref->{'UPDATE_DATABASE'} )
701 installer
::logger
::print_message
( "... analyzing update database ...\n" );
702 $refdatabase = installer
::windows
::update
::readdatabase
($allvariableshashref, $languagestringref, $includepatharrayref);
704 if ( $installer::globals
::updatedatabase
)
706 ($uniquefilename, $revuniquefilename, $revshortfilename, $allupdatesequences, $allupdatecomponents, $allupdatefileorder, $allupdatecomponentorder, $shortdirname, $componentid, $componentidkeypath, $alloldproperties, $allupdatelastsequences, $allupdatediskids) = installer
::windows
::update
::create_database_hashes
($refdatabase);
707 if ( $mergemodulesarrayref > -1 ) { installer
::windows
::update
::readmergedatabase
($mergemodulesarrayref, $languagestringref, $includepatharrayref); }
712 ##############################################
713 # Setting global code variables for Windows
714 ##############################################
716 if (!($installer::globals
::is_copy_only_project
))
718 if ( $installer::globals
::iswindowsbuild
)
720 installer
::windows
::msiglobal
::set_global_code_variables
($languagesarrayref, $languagestringref, $allvariableshashref, $alloldproperties);
724 ################################################
725 # Resolving include paths (language dependent)
726 ################################################
728 $includepatharrayref_lang = installer
::ziplist
::replace_languages_in_pathes
($includepatharrayref, $languagesarrayref);
729 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "allpatharray4.log" ,$includepatharrayref_lang); }
731 if ( $installer::globals
::refresh_includepathes
) { installer
::worker
::collect_all_files_from_includepathes
($includepatharrayref_lang); }
733 installer
::ziplist
::list_all_files_from_include_path
($includepatharrayref_lang);
735 ##############################################
736 # Analyzing spellchecker languages
737 ##############################################
739 if ( $allvariableshashref->{'SPELLCHECKERFILE'} ) { installer
::worker
::set_spellcheckerlanguages
($languagesarrayref, $allvariableshashref); }
741 #####################################
742 # Language dependent directory part
743 #####################################
745 my $dirsinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($dirsinproductarrayref, $languagesarrayref);
746 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories3.log", $dirsinproductlanguageresolvedarrayref); }
747 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories2a.log", $dirsinproductarrayref); }
749 # A new directory array is needed ($dirsinproductlanguageresolvedarrayref instead of $dirsinproductarrayref)
750 # because $dirsinproductarrayref is needed in get_Destination_Directory_For_Item_From_Directorylist
752 installer
::scriptitems
::changing_name_of_language_dependent_keys
($dirsinproductlanguageresolvedarrayref);
753 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productdirectories4.log", $dirsinproductlanguageresolvedarrayref); }
755 installer
::scriptitems
::checking_directories_with_corrupt_hostname
($dirsinproductlanguageresolvedarrayref, $languagesarrayref);
757 installer
::scriptitems
::set_global_directory_hostnames
($dirsinproductlanguageresolvedarrayref, $allvariableshashref);
759 #####################################
760 # files part, language dependent
761 #####################################
763 installer
::logger
::print_message
( "... analyzing files ...\n" );
765 my $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($filesinproductarrayref, $languagesarrayref);
766 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles4.log", $filesinproductlanguageresolvedarrayref); }
768 if ( ! $installer::globals
::set_office_start_language
)
770 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_office_start_language_files
($filesinproductlanguageresolvedarrayref);
771 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles4b.log", $filesinproductlanguageresolvedarrayref); }
774 installer
::scriptitems
::changing_name_of_language_dependent_keys
($filesinproductlanguageresolvedarrayref);
775 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles5.log", $filesinproductlanguageresolvedarrayref); }
777 if ( $installer::globals
::iswin
and $^O
=~ /MSWin/i ) { installer
::converter
::convert_slash_to_backslash
($filesinproductlanguageresolvedarrayref); }
778 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles6.log", $filesinproductlanguageresolvedarrayref); }
780 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_non_existent_languages_in_productlists
($filesinproductlanguageresolvedarrayref, $languagestringref, "Name", "file");
781 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles7.log", $filesinproductlanguageresolvedarrayref); }
783 installer
::scriptitems
::get_Destination_Directory_For_Item_From_Directorylist
($filesinproductlanguageresolvedarrayref, $dirsinproductarrayref);
784 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles8.log", $filesinproductlanguageresolvedarrayref); }
786 installer
::scriptitems
::get_Source_Directory_For_Files_From_Includepathlist
($filesinproductlanguageresolvedarrayref, $includepatharrayref_lang, $dirsinproductlanguageresolvedarrayref, "Files");
787 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles9.log", $filesinproductlanguageresolvedarrayref); }
789 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_Files_Without_Sourcedirectory
($filesinproductlanguageresolvedarrayref);
790 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10.log", $filesinproductlanguageresolvedarrayref); }
792 if ($installer::globals
::languagepack
)
794 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_Files_For_Languagepacks
($filesinproductlanguageresolvedarrayref);
795 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10c.log", $filesinproductlanguageresolvedarrayref); }
799 if ( ! $allvariableshashref->{'NO_README_IN_ROOTDIR'} )
801 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::add_License_Files_into_Installdir
($filesinproductlanguageresolvedarrayref, $dirsinproductlanguageresolvedarrayref, $languagesarrayref);
802 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10b.log", $filesinproductlanguageresolvedarrayref); }
805 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_onlyasialanguage_files_from_productlists
($filesinproductlanguageresolvedarrayref);
806 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10d.log", $filesinproductlanguageresolvedarrayref); }
808 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_onlywesternlanguage_files_from_productlists
($filesinproductlanguageresolvedarrayref);
809 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10e.log", $filesinproductlanguageresolvedarrayref); }
811 installer
::scriptitems
::make_filename_language_specific
($filesinproductlanguageresolvedarrayref);
812 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles10f.log", $filesinproductlanguageresolvedarrayref); }
814 # print "... calculating checksums ...\n";
815 # my $checksumfile = installer::worker::make_checksum_file($filesinproductlanguageresolvedarrayref, $includepatharrayref);
816 # if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . $installer::globals::checksumfilename, $checksumfile); }
818 ######################################################################################
819 # Unzipping files with flag ARCHIVE and putting all included files into the file list
820 ######################################################################################
822 installer
::logger
::print_message
( "... analyzing files with flag ARCHIVE ...\n" );
824 my @additional_paths_from_zipfiles = ();
826 $filesinproductlanguageresolvedarrayref = installer
::archivefiles
::resolving_archive_flag
($filesinproductlanguageresolvedarrayref, \
@additional_paths_from_zipfiles, $languagestringref, $loggingdir);
827 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles11.log", $filesinproductlanguageresolvedarrayref); }
828 if ( $installer::globals
::globallogging
) { installer
::files
::save_file
($loggingdir . "additional_paths.log" ,\
@additional_paths_from_zipfiles); }
830 # packed files sometimes contain a "$" in their name: HighlightText$1.class. For epm the "$" has to be quoted by "$$"
832 if (!( $installer::globals
::iswindowsbuild
|| $installer::globals
::simple
) )
834 installer
::scriptitems
::quoting_illegal_filenames
($filesinproductlanguageresolvedarrayref);
835 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles12.log", $filesinproductlanguageresolvedarrayref); }
838 #####################################
839 # Files with flag SUBST_FILENAME
840 #####################################
842 installer
::logger
::print_message
( "... analyzing files with flag SUBST_FILENAME ...\n" );
844 installer
::substfilenamefiles
::resolving_subst_filename_flag
($filesinproductlanguageresolvedarrayref, $allvariableshashref, $languagestringref);
845 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles12d.log", $filesinproductlanguageresolvedarrayref); }
847 #####################################
848 # Files with flag SCPZIP_REPLACE
849 #####################################
851 installer
::logger
::print_message
( "... analyzing files with flag SCPZIP_REPLACE ...\n" );
853 # Editing files with flag SCPZIP_REPLACE.
855 installer
::scpzipfiles
::resolving_scpzip_replace_flag
($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
856 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles13.log", $filesinproductlanguageresolvedarrayref); }
858 #####################################
859 # Files with flag PATCH_SO_NAME
860 #####################################
862 installer
::logger
::print_message
( "... analyzing files with flag PATCH_SO_NAME ...\n" );
864 # Editing files with flag PATCH_SO_NAME.
866 installer
::scppatchsoname
::resolving_patchsoname_flag
($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
867 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles13b.log", $filesinproductlanguageresolvedarrayref); }
869 #####################################
870 # Files with flag HIDDEN
871 #####################################
873 installer
::logger
::print_message
( "... analyzing files with flag HIDDEN ...\n" );
875 installer
::worker
::resolving_hidden_flag
($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
876 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles13c.log", $filesinproductlanguageresolvedarrayref); }
878 #####################################
879 # Creating services.rdb
880 #####################################
882 if ( $allvariableshashref->{'SERVICESPROJEKT'} )
884 if (! $installer::globals
::languagepack
)
886 # ATTENTION: For creating the services.rdb it is necessary to execute the native file
887 # "regcomp" or "regcomp.exe". Therefore this function can only be executed on the
888 # corresponding platform.
890 if ( $installer::globals
::servicesrdb_can_be_created
)
892 installer
::logger
::print_message
( "... creating preregistered services.rdb ...\n" );
894 installer
::servicesfile
::create_services_rdb
($allvariableshashref, $filesinproductlanguageresolvedarrayref, $includepatharrayref, $languagestringref);
895 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles14.log", $filesinproductlanguageresolvedarrayref); }
900 #####################################
902 #####################################
904 if (!($installer::globals
::is_copy_only_project
))
906 if (! $installer::globals
::languagepack
)
908 installer
::logger
::print_message
( "... merging files into registry database ...\n" );
910 installer
::regmerge
::merge_registration_files
($filesinproductlanguageresolvedarrayref, $includepatharrayref, $languagestringref, $allvariableshashref);
911 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles14b.log", $filesinproductlanguageresolvedarrayref); }
915 ############################################
916 # Collecting directories for epm list file
917 ############################################
919 installer
::logger
::print_message
( "... analyzing all directories for this product ...\n" );
921 # There are two ways for a directory to be included into the epm directory list:
922 # 1. Looking for all destination paths in the files array
923 # 2. Looking for directories with CREATE flag in the directory array
924 # Advantage: Many pathes are hidden in zip files, they are not defined in the setup script.
925 # It will be possible, that in the setup script only those directoies have to be defined,
926 # that have a CREATE flag. All other directories are created, if they contain at least one file.
928 my ($directoriesforepmarrayref, $alldirectoryhash) = installer
::scriptitems
::collect_directories_from_filesarray
($filesinproductlanguageresolvedarrayref);
929 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist1.log", $directoriesforepmarrayref); }
931 ($directoriesforepmarrayref, $alldirectoryhash) = installer
::scriptitems
::collect_directories_with_create_flag_from_directoryarray
($dirsinproductlanguageresolvedarrayref, $alldirectoryhash);
932 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist2.log", $directoriesforepmarrayref); }
934 # installer::sorter::sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
935 # if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3.log", $directoriesforepmarrayref); }
937 #########################################################
938 # language dependent scpactions part
939 #########################################################
941 my $scpactionsinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($scpactionsinproductarrayref, $languagesarrayref);
942 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions3.log", $scpactionsinproductlanguageresolvedarrayref); }
944 installer
::scriptitems
::changing_name_of_language_dependent_keys
($scpactionsinproductlanguageresolvedarrayref);
945 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions4.log", $scpactionsinproductlanguageresolvedarrayref); }
947 installer
::scriptitems
::get_Source_Directory_For_Files_From_Includepathlist
($scpactionsinproductlanguageresolvedarrayref, $includepatharrayref_lang, $dirsinproductlanguageresolvedarrayref, "ScpActions");
948 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions5.log", $scpactionsinproductlanguageresolvedarrayref); }
950 # Editing scpactions with flag SCPZIP_REPLACE.
952 installer
::scpzipfiles
::resolving_scpzip_replace_flag
($scpactionsinproductlanguageresolvedarrayref, $allvariableshashref, "ScpAction", $languagestringref);
953 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions6.log", $scpactionsinproductlanguageresolvedarrayref); }
955 #########################################################
956 # language dependent links part
957 #########################################################
959 installer
::logger
::print_message
( "... analyzing links ...\n" );
961 my $linksinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($linksinproductarrayref, $languagesarrayref);
962 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks2.log", $linksinproductlanguageresolvedarrayref); }
964 installer
::scriptitems
::changing_name_of_language_dependent_keys
($linksinproductlanguageresolvedarrayref);
965 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks3.log", $linksinproductlanguageresolvedarrayref); }
967 installer
::scriptitems
::get_destination_file_path_for_links
($linksinproductlanguageresolvedarrayref, $filesinproductlanguageresolvedarrayref);
968 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks4.log", $linksinproductlanguageresolvedarrayref); }
970 installer
::scriptitems
::get_Destination_Directory_For_Item_From_Directorylist
($linksinproductlanguageresolvedarrayref, $dirsinproductarrayref);
971 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks5.log", $linksinproductlanguageresolvedarrayref); }
973 # Now taking all links that have no FileID but a ShortcutID, linking to another link
975 installer
::scriptitems
::get_destination_link_path_for_links
($linksinproductlanguageresolvedarrayref);
976 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks6.log", $linksinproductlanguageresolvedarrayref); }
978 $linksinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_workstation_only_items
($linksinproductlanguageresolvedarrayref);
979 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks7.log", $linksinproductlanguageresolvedarrayref); }
981 installer
::scriptitems
::resolve_links_with_flag_relative
($linksinproductlanguageresolvedarrayref);
982 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks8.log", $linksinproductlanguageresolvedarrayref); }
984 #########################################################
985 # language dependent unix links part
986 #########################################################
988 installer
::logger
::print_message
( "... analyzing unix links ...\n" );
990 my $unixlinksinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($unixlinksinproductarrayref, $languagesarrayref);
991 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks3.log", $unixlinksinproductlanguageresolvedarrayref); }
993 installer
::scriptitems
::changing_name_of_language_dependent_keys
($unixlinksinproductlanguageresolvedarrayref);
994 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks4.log", $unixlinksinproductlanguageresolvedarrayref); }
996 installer
::scriptitems
::get_Destination_Directory_For_Item_From_Directorylist
($unixlinksinproductlanguageresolvedarrayref, $dirsinproductarrayref);
997 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks5.log", $unixlinksinproductlanguageresolvedarrayref); }
999 #########################################################
1000 # language dependent part for profiles and profileitems
1001 #########################################################
1003 my $profilesinproductlanguageresolvedarrayref;
1004 my $profileitemsinproductlanguageresolvedarrayref;
1006 if ((!($installer::globals
::is_copy_only_project
)) && (!($installer::globals
::product
=~ /ada/i )))
1008 installer
::logger
::print_message
( "... creating profiles ...\n" );
1010 $profilesinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($profilesinproductarrayref, $languagesarrayref);
1011 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profiles2.log", $profilesinproductlanguageresolvedarrayref); }
1013 $profileitemsinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($profileitemsinproductarrayref, $languagesarrayref);
1014 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profileitems2.log", $profilesinproductlanguageresolvedarrayref); }
1016 installer
::scriptitems
::changing_name_of_language_dependent_keys
($profilesinproductlanguageresolvedarrayref);
1017 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profiles3.log", $profilesinproductlanguageresolvedarrayref); }
1019 installer
::scriptitems
::changing_name_of_language_dependent_keys
($profileitemsinproductlanguageresolvedarrayref);
1020 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profileitems3.log", $profileitemsinproductlanguageresolvedarrayref); }
1022 installer
::scriptitems
::replace_setup_variables
($profileitemsinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
1023 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profileitems4.log", $profileitemsinproductlanguageresolvedarrayref); }
1025 if ( $installer::globals
::patch_user_dir
)
1027 installer
::scriptitems
::replace_userdir_variable
($profileitemsinproductlanguageresolvedarrayref);
1028 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profileitems4a.log", $profileitemsinproductlanguageresolvedarrayref); }
1031 installer
::scriptitems
::get_Destination_Directory_For_Item_From_Directorylist
($profilesinproductlanguageresolvedarrayref, $dirsinproductarrayref);
1032 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "profiles4.log", $profilesinproductlanguageresolvedarrayref); }
1034 # Now the Profiles can be created
1036 installer
::profiles
::create_profiles
($profilesinproductlanguageresolvedarrayref, $profileitemsinproductlanguageresolvedarrayref, $filesinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
1037 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles15.log", $filesinproductlanguageresolvedarrayref); }
1040 my $registryitemsinproductlanguageresolvedarrayref; # cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
1041 my $folderinproductlanguageresolvedarrayref; # cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
1042 my $folderitemsinproductlanguageresolvedarrayref; # cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
1044 if ( $installer::globals
::iswindowsbuild
) # Windows specific items: Folder, FolderItem, RegistryItem
1046 #########################################################
1047 # language dependent part for folder
1048 #########################################################
1050 installer
::logger
::print_message
( "... analyzing folder ...\n" );
1052 $folderinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($folderinproductarrayref, $languagesarrayref);
1053 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folder2.log", $folderinproductlanguageresolvedarrayref); }
1055 installer
::scriptitems
::changing_name_of_language_dependent_keys
($folderinproductlanguageresolvedarrayref);
1056 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folder3.log", $folderinproductlanguageresolvedarrayref); }
1058 #########################################################
1059 # language dependent part for folderitems
1060 #########################################################
1062 installer
::logger
::print_message
( "... analyzing folderitems ...\n" );
1064 $folderitemsinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($folderitemsinproductarrayref, $languagesarrayref);
1065 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folderitems2.log", $folderitemsinproductlanguageresolvedarrayref); }
1067 installer
::scriptitems
::changing_name_of_language_dependent_keys
($folderitemsinproductlanguageresolvedarrayref);
1068 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folderitems3.log", $folderitemsinproductlanguageresolvedarrayref); }
1070 #########################################################
1071 # language dependent part for registryitems
1072 #########################################################
1074 installer
::logger
::print_message
( "... analyzing registryitems ...\n" );
1076 $registryitemsinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($registryitemsinproductarrayref, $languagesarrayref);
1077 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems2.log", $registryitemsinproductlanguageresolvedarrayref); }
1079 installer
::scriptitems
::changing_name_of_language_dependent_keys
($registryitemsinproductlanguageresolvedarrayref);
1080 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems3.log", $registryitemsinproductlanguageresolvedarrayref); }
1083 #########################################################
1084 # language dependent part for modules
1085 #########################################################
1087 my $modulesinproductlanguageresolvedarrayref;
1089 if (!($installer::globals
::is_copy_only_project
))
1091 installer
::logger
::print_message
( "... analyzing modules ...\n" );
1093 $modulesinproductlanguageresolvedarrayref = installer
::scriptitems
::resolving_all_languages_in_productlists
($modulesinproductarrayref, $languagesarrayref);
1094 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes_modules
($loggingdir . "modules2.log", $modulesinproductlanguageresolvedarrayref); }
1096 $modulesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_not_required_language_modules
($modulesinproductlanguageresolvedarrayref, $languagesarrayref);
1097 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes_modules
($loggingdir . "modules2a.log", $modulesinproductlanguageresolvedarrayref); }
1099 if ( $installer::globals
::analyze_spellcheckerlanguage
)
1101 $modulesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_not_required_spellcheckerlanguage_modules
($modulesinproductlanguageresolvedarrayref);
1102 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes_modules
($loggingdir . "modules3.log", $modulesinproductlanguageresolvedarrayref); }
1104 $filesinproductlanguageresolvedarrayref = installer
::scriptitems
::remove_not_required_spellcheckerlanguage_files
($filesinproductlanguageresolvedarrayref);
1105 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles15b.log", $filesinproductlanguageresolvedarrayref); }
1108 installer
::scriptitems
::changing_name_of_language_dependent_keys
($modulesinproductlanguageresolvedarrayref);
1109 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes_modules
($loggingdir . "modules3a.log", $modulesinproductlanguageresolvedarrayref); }
1111 # installer::scriptitems::collect_language_specific_names($modulesinproductlanguageresolvedarrayref);
1112 installer
::scriptitems
::select_required_language_strings
($modulesinproductlanguageresolvedarrayref); # using english strings
1116 # Copy-only projects can now start to copy all items File and ScpAction
1117 if ( $installer::globals
::is_copy_only_project
) { installer
::copyproject
::copy_project
($filesinproductlanguageresolvedarrayref, $scpactionsinproductlanguageresolvedarrayref, $loggingdir, $languagestringref, $shipinstalldir, $allsettingsarrayref); }
1119 # Language pack projects can now start to select the required information
1120 if ( $installer::globals
::languagepack
)
1122 $filesinproductlanguageresolvedarrayref = installer
::languagepack
::select_language_items
($filesinproductlanguageresolvedarrayref, $languagesarrayref, "File");
1123 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16b.log", $filesinproductlanguageresolvedarrayref); }
1124 $scpactionsinproductlanguageresolvedarrayref = installer
::languagepack
::select_language_items
($scpactionsinproductlanguageresolvedarrayref, $languagesarrayref, "ScpAction");
1125 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions6b.log", $scpactionsinproductlanguageresolvedarrayref); }
1126 $linksinproductlanguageresolvedarrayref = installer
::languagepack
::select_language_items
($linksinproductlanguageresolvedarrayref, $languagesarrayref, "Shortcut");
1127 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks8b.log", $linksinproductlanguageresolvedarrayref); }
1128 $unixlinksinproductlanguageresolvedarrayref = installer
::languagepack
::select_language_items
($unixlinksinproductlanguageresolvedarrayref, $languagesarrayref, "Unixlink");
1129 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks5.log", $unixlinksinproductlanguageresolvedarrayref); }
1130 @
{$folderitemsinproductlanguageresolvedarrayref} = (); # no folderitems in languagepacks
1132 # Collecting the directories again, to include only the language specific directories
1133 ($directoriesforepmarrayref, $alldirectoryhash) = installer
::scriptitems
::collect_directories_from_filesarray
($filesinproductlanguageresolvedarrayref);
1134 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist3alangpack.log", $directoriesforepmarrayref); }
1135 ($directoriesforepmarrayref, $alldirectoryhash) = installer
::scriptitems
::collect_directories_with_create_flag_from_directoryarray
($dirsinproductlanguageresolvedarrayref, $alldirectoryhash);
1136 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist3blangpack.log", $directoriesforepmarrayref); }
1137 installer
::sorter
::sorting_array_of_hashes
($directoriesforepmarrayref, "HostName");
1138 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist3clangpack.log", $directoriesforepmarrayref); }
1140 if ( $installer::globals
::iswindowsbuild
)
1142 $registryitemsinproductlanguageresolvedarrayref = installer
::worker
::select_langpack_items
($registryitemsinproductlanguageresolvedarrayref, "RegistryItem");
1143 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems3aa.log", $registryitemsinproductlanguageresolvedarrayref); }
1148 # Collecting all files without flag PATCH (for maintenance reasons)
1149 if ( $installer::globals
::patch
) { installer
::worker
::collect_all_files_without_patch_flag
($filesinproductlanguageresolvedarrayref); }
1151 # Patch projects can now start to select the required information
1152 if (( $installer::globals
::patch
) && (( $installer::globals
::issolarispkgbuild
) || ( $installer::globals
::iswindowsbuild
)))
1154 $filesinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items
($filesinproductlanguageresolvedarrayref, "File");
1155 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16patch.log", $filesinproductlanguageresolvedarrayref); }
1156 $scpactionsinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items
($scpactionsinproductlanguageresolvedarrayref, "ScpAction");
1157 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productscpactions6patch.log", $scpactionsinproductlanguageresolvedarrayref); }
1158 $linksinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items
($linksinproductlanguageresolvedarrayref, "Shortcut");
1159 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productlinks8patch.log", $linksinproductlanguageresolvedarrayref); }
1160 $unixlinksinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items
($unixlinksinproductlanguageresolvedarrayref, "Unixlink");
1161 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks6patch.log", $unixlinksinproductlanguageresolvedarrayref); }
1162 $folderitemsinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items
($folderitemsinproductlanguageresolvedarrayref, "FolderItem");
1163 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfolderitems1patch.log", $folderitemsinproductlanguageresolvedarrayref); }
1164 # @{$folderitemsinproductlanguageresolvedarrayref} = (); # no folderitems in languagepacks
1166 if ( $installer::globals
::iswindowsbuild
)
1168 $registryitemsinproductlanguageresolvedarrayref = installer
::worker
::select_patch_items_without_name
($registryitemsinproductlanguageresolvedarrayref, "RegistryItem");
1169 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems3a.log", $registryitemsinproductlanguageresolvedarrayref); }
1171 installer
::worker
::prepare_windows_patchfiles
($filesinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
1172 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16bpatch.log", $filesinproductlanguageresolvedarrayref); }
1174 # For Windows patches, the directories can now be collected again
1175 ($directoriesforepmarrayref, $alldirectoryhash) = installer
::scriptitems
::collect_directories_from_filesarray
($filesinproductlanguageresolvedarrayref);
1176 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist4_patch.log", $directoriesforepmarrayref); }
1178 installer
::sorter
::sorting_array_of_hashes
($directoriesforepmarrayref, "HostName");
1179 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforepmlist5_patch.log", $directoriesforepmarrayref); }
1183 #########################################################
1184 # Collecting all scp actions
1185 #########################################################
1187 installer
::worker
::collect_scpactions
($scpactionsinproductlanguageresolvedarrayref);
1189 #########################################################
1190 # creating inf files for user system integration
1191 #########################################################
1193 if (( $installer::globals
::iswindowsbuild
) && ( ! $installer::globals
::patch
)) # Windows specific items: Folder, FolderItem, RegistryItem
1195 installer
::logger
::print_message
( "... creating inf files ...\n" );
1196 installer
::worker
::create_inf_file
($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $folderinproductlanguageresolvedarrayref, $folderitemsinproductlanguageresolvedarrayref, $modulesinproductlanguageresolvedarrayref, $languagesarrayref, $languagestringref, $allvariableshashref);
1197 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16c.log", $filesinproductlanguageresolvedarrayref); }
1200 ###########################################
1201 # Using upx, to decrease file size
1202 # Currently only for Windows.
1203 ###########################################
1205 if ( $allvariableshashref->{'UPXPRODUCT'} )
1207 installer
::upx
::upx_on_libraries
($filesinproductlanguageresolvedarrayref, $languagestringref);
1208 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16d.log", $filesinproductlanguageresolvedarrayref); }
1211 ###########################################################
1212 # Simple package projects can now start to create the
1213 # installation structure by creating Directories, Files
1214 # Links and ScpActions. This is the last platform
1216 ###########################################################
1218 if ( $installer::globals
::is_simple_packager_project
)
1220 installer
::simplepackage
::create_simple_package
($filesinproductlanguageresolvedarrayref, $directoriesforepmarrayref, $scpactionsinproductlanguageresolvedarrayref, $linksinproductlanguageresolvedarrayref, $unixlinksinproductlanguageresolvedarrayref, $loggingdir, $languagestringref, $shipinstalldir, $allsettingsarrayref, $allvariableshashref, $includepatharrayref);
1221 next; # ! leaving the current loop, because no further packaging required.
1224 ###########################################################
1225 # Analyzing the package structure
1226 ###########################################################
1228 installer
::logger
::print_message
( "... analyzing package list ...\n" );
1230 my $packages = installer
::packagelist
::collectpackages
($modulesinproductlanguageresolvedarrayref, $languagesarrayref);
1231 installer
::packagelist
::check_packagelist
($packages);
1233 $packages = installer
::packagelist
::analyze_list
($packages, $modulesinproductlanguageresolvedarrayref);
1234 installer
::packagelist
::remove_multiple_modules_packages
($packages);
1236 # printing packages content:
1237 installer
::packagelist
::log_packages_content
($packages);
1238 installer
::packagelist
::create_module_destination_hash
($packages, $allvariableshashref);
1240 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nEnd of part 1b: The language dependent part\n"); }
1242 # saving debug info, before starting part 2
1243 if ( $installer::globals
::debug
) { installer
::logger
::savedebug
($installer::globals
::exitlog
); }
1245 #################################################
1246 # Part 2: The platform dependent part
1247 #################################################
1249 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 2: The platform dependent part\n"); }
1251 #################################################
1252 # Part 2a: All non-Windows platforms
1253 #################################################
1255 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 2a: All non-Windows platforms\n"); }
1257 #########################################################
1258 # ... creating epm list file ...
1259 # Only for non-Windows platforms
1260 #########################################################
1262 if (!( $installer::globals
::iswindowsbuild
))
1264 ####################################################
1265 # Writing log file before packages are packed
1266 ####################################################
1268 installer
::logger
::print_message
( "... creating log file " . $loggingdir . $installer::globals
::logfilename
. "\n" );
1269 installer
::files
::save_file
($loggingdir . $installer::globals
::logfilename
, \
@installer::globals
::logfileinfo
);
1271 ####################################################
1272 # Creating directories
1273 ####################################################
1275 $installdir = installer
::worker
::create_installation_directory
($shipinstalldir, $languagestringref, \
$current_install_number);
1277 my $listfiledir = installer
::systemactions
::create_directories
("listfile", $languagestringref);
1278 my $installlogdir = installer
::systemactions
::create_directory_next_to_directory
($installdir, "log");
1279 # installer::packagelist::add_defaultpathes_into_filescollector($filesinproductlanguageresolvedarrayref);
1280 # my $installchecksumdir = installer::systemactions::create_directory_next_to_directory($installdir, "checksum");
1282 ####################################################
1283 # Reading for Solaris all package descriptions
1284 # from file defined in property PACKAGEMAP
1285 ####################################################
1287 if ( $installer::globals
::issolarisbuild
) { installer
::epmfile
::read_packagemap
($allvariableshashref, $includepatharrayref, $languagesarrayref); }
1289 my $epmexecutable = "";
1292 # iterating over all packages
1294 for ( my $k = 0; $k <= $#{$packages}; $k++ )
1296 my $onepackage = ${$packages}[$k];
1298 # checking, if this is a language pack or a project pack.
1299 # Creating language packs only, if $installer::globals::languagepack is set. Parameter: -languagepack
1301 if ( $installer::globals
::languagepack
) { installer
::languagepack
::replace_languagestring_variable
($onepackage, $languagestringref); }
1303 my $onepackagename = $onepackage->{'module'}; # name of the top module (required)
1305 my $shellscriptsfilename = "";
1306 if ( $onepackage->{'script'} ) { $shellscriptsfilename = $onepackage->{'script'}; }
1307 # no scripts for Solaris patches!
1308 if (( $installer::globals
::patch
) && ( $installer::globals
::issolarispkgbuild
)) { $shellscriptsfilename = ""; }
1310 ###########################
1312 ###########################
1314 my $packagename = "";
1316 if ( $installer::globals
::issolarisbuild
) # only for Solaris
1318 if ( $onepackage->{'solarispackagename'} ) { $packagename = $onepackage->{'solarispackagename'}; }
1322 if ( $onepackage->{'packagename'} ) { $packagename = $onepackage->{'packagename'}; }
1325 if (!($packagename eq ""))
1327 installer
::packagelist
::resolve_packagevariables
(\
$packagename, $allvariableshashref, 0);
1331 my $linkpackage = 0;
1332 $installer::globals
::add_required_package
= "";
1333 $installer::globals
::linuxlinkrpmprocess
= 0;
1335 if ( $installer::globals
::makelinuxlinkrpm
)
1337 my $oldpackagename = $packagename;
1338 $installer::globals
::add_required_package
= $oldpackagename; # the link rpm requires the non-linked version
1339 if ( $installer::globals
::languagepack
) { $packagename = $packagename . "_u"; }
1340 else { $packagename = $packagename . "u"; }
1341 my $savestring = $oldpackagename . "\t" . $packagename;
1342 push(@installer::globals
::linkrpms
, $savestring);
1343 $linkaddon = "_links";
1344 $installer::globals
::linuxlinkrpmprocess
= 1;
1348 ###########################################
1349 # Root path, can be defined as parameter
1350 ###########################################
1352 my $packagerootpath = "";
1354 if ($installer::globals
::rootpath
eq "")
1356 $packagerootpath = $onepackage->{'destpath'};
1357 installer
::packagelist
::resolve_packagevariables
(\
$packagerootpath, $allvariableshashref, 1);
1358 if ( $^O
=~ /darwin/i ) { $packagerootpath =~ s/\/opt\//\/Applications\
//; }
1362 $packagerootpath = $installer::globals
::rootpath
;
1365 #############################################
1366 # copying the collectors for each package
1367 #############################################
1369 my $filesinpackage = installer
::converter
::copy_collector
($filesinproductlanguageresolvedarrayref);
1370 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files1_" . $packagename . ".log", $filesinpackage); }
1371 my $linksinpackage = installer
::converter
::copy_collector
($linksinproductlanguageresolvedarrayref);
1372 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "links1_" . $packagename . ".log", $linksinpackage); }
1373 my $unixlinksinpackage = installer
::converter
::copy_collector
($unixlinksinproductlanguageresolvedarrayref);
1374 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks1_" . $packagename . ".log", $unixlinksinpackage); }
1375 my $dirsinpackage = installer
::converter
::copy_collector
($directoriesforepmarrayref);
1376 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "dirs1_" . $packagename . ".log", $dirsinpackage); }
1378 ###########################################
1379 # setting the root path for the packages
1380 ###########################################
1382 installer
::scriptitems
::add_rootpath_to_directories
($dirsinpackage, $packagerootpath);
1383 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "dirs2_" . $packagename . ".log", $dirsinpackage); }
1384 installer
::scriptitems
::add_rootpath_to_files
($filesinpackage, $packagerootpath);
1385 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files2_" . $packagename . ".log", $filesinpackage); }
1386 installer
::scriptitems
::add_rootpath_to_links
($linksinpackage, $packagerootpath);
1387 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "links2_" . $packagename . ".log", $linksinpackage); }
1388 installer
::scriptitems
::add_rootpath_to_files
($unixlinksinpackage, $packagerootpath);
1389 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks2_" . $packagename . ".log", $unixlinksinpackage); }
1391 #################################
1392 # collecting items for package
1393 #################################
1395 $filesinpackage = installer
::packagelist
::find_files_for_package
($filesinpackage, $onepackage);
1396 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files3_" . $packagename . ".log", $filesinpackage); }
1397 $unixlinksinpackage = installer
::packagelist
::find_files_for_package
($unixlinksinpackage, $onepackage);
1398 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "unixlinks3_" . $packagename . ".log", $unixlinksinpackage); }
1399 $linksinpackage = installer
::packagelist
::find_links_for_package
($linksinpackage, $filesinpackage);
1400 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "links3_" . $packagename . ".log", $linksinpackage); }
1401 $dirsinpackage = installer
::packagelist
::find_dirs_for_package
($dirsinpackage, $onepackage);
1402 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "dirs3_" . $packagename . ".log", $dirsinpackage); }
1404 ###############################################
1405 # nothing to do, if $filesinpackage is empty
1406 ###############################################
1408 if ( ! ( $#{$filesinpackage} > -1 ))
1410 push(@installer::globals
::emptypackages
, $packagename);
1411 $infoline = "\n\nNo file in package: $packagename \-\> Skipping\n\n";
1412 push(@installer::globals
::logfileinfo
, $infoline);
1413 next; # next package, end of loop !
1416 #################################################################
1417 # nothing to do for Linux patches, if no file has flag PATCH
1418 #################################################################
1420 # Linux Patch: The complete RPM has to be built, if one file in the RPM has the flag PATCH (also for DEBs)
1421 if (( $installer::globals
::patch
) && (( $installer::globals
::islinuxrpmbuild
) || ( $installer::globals
::islinuxdebbuild
)))
1423 my $patchfiles = installer
::worker
::collect_all_items_with_special_flag
($filesinpackage ,"PATCH");
1424 if ( ! ( $#{$patchfiles} > -1 ))
1426 $infoline = "\n\nLinux Patch: No patch file in package: $packagename \-\> Skipping\n\n";
1427 push(@installer::globals
::logfileinfo
, $infoline);
1432 ###########################################
1433 # Stripping libraries
1434 ###########################################
1436 # Building for non Windows platforms in cws requires, that all files are stripped before packaging:
1437 # 1. copy all files that need to be stripped locally
1438 # 2. strip all these files
1440 if ( $installer::globals
::strip
)
1442 installer
::strip
::strip_libraries
($filesinpackage, $languagestringref);
1443 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . $packagename ."_files.log", $filesinpackage); }
1446 ###############################################################
1447 # Searching for files in $filesinpackage with flag LINUXLINK
1448 ###############################################################
1450 if (( $installer::globals
::islinuxbuild
) && ( ! $installer::globals
::simple
)) # for rpms and debian packages
1452 # special handling for all RPMs in $installer::globals::linuxlinkrpms
1454 # if (( $installer::globals::linuxlinkrpms =~ /\b$onepackagename\b/ ) || ( $installer::globals::languagepack ))
1455 if ( $installer::globals
::linuxlinkrpms
=~ /\b$onepackagename\b/ )
1459 if (( $installer::globals
::makelinuxlinkrpm
) && ( ! $run ))
1461 $filesinpackage = \
@installer::globals
::linuxpatchfiles
;
1462 $linksinpackage = \
@installer::globals
::linuxlinks
;
1463 $installer::globals
::makelinuxlinkrpm
= 0;
1464 if ( $installer::globals
::patch
) { $installer::globals
::call_epm
= 1; } # enabling packing again
1467 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files3b_" . $packagename . ".log", $filesinpackage); }
1468 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "links3b_" . $packagename . ".log", $linksinpackage); }
1469 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "dirs3b_" . $packagename . ".log", $dirsinpackage); }
1472 if (( ! $installer::globals
::makelinuxlinkrpm
) && ( ! $run ))
1474 $filesinpackage = installer
::worker
::prepare_linuxlinkfiles
($filesinpackage);
1475 $linksinpackage = installer
::worker
::prepare_forced_linuxlinkfiles
($linksinpackage);
1476 $installer::globals
::makelinuxlinkrpm
= 1;
1477 if ( $allvariableshashref->{'OPENSOURCE'} ) { $installer::globals
::add_required_package
= $packagename . "u"; }
1478 if ( $installer::globals
::patch
) { $installer::globals
::call_epm
= 0; } # no packing of core module in patch
1479 $shellscriptsfilename = ""; # shell scripts only need to be included into the link rpm
1482 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files3a_" . $packagename . ".log", $filesinpackage); }
1483 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "links3a_" . $packagename . ".log", $linksinpackage); }
1484 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "dirs3a_" . $packagename . ".log", $dirsinpackage); }
1489 ###########################################
1490 # Simple installation mechanism
1491 ###########################################
1493 if ( $installer::globals
::simple
) { installer
::worker
::install_simple
($onepackagename, $$languagestringref, $dirsinpackage, $filesinpackage, $linksinpackage, $unixlinksinpackage); }
1495 ###########################################
1496 # Creating epm list file
1497 ###########################################
1499 if (! $installer::globals
::simple
)
1501 # epm list file format:
1502 # type mode owner group destination source options
1503 # Example for a file: f 755 root sys /usr/bin/foo foo
1504 # Example for a directory: d 755 root sys /var/spool/foo -
1505 # Example for a link: l 000 root sys /usr/bin/linkname filename
1506 # The source field specifies the file to link to
1508 my $epmfilename = "epm_" . $onepackagename . $linkaddon . ".lst";
1510 installer
::logger
::print_message
( "... creating epm list file $epmfilename ... \n" );
1512 my $completeepmfilename = $listfiledir . $installer::globals
::separator
. $epmfilename;
1516 my $epmheaderref = installer
::epmfile
::create_epm_header
($allvariableshashref, $filesinproductlanguageresolvedarrayref, $languagesarrayref, $onepackage);
1517 installer
::epmfile
::adding_header_to_epm_file
(\
@epmfile, $epmheaderref);
1519 if (( $installer::globals
::patch
) && ( $installer::globals
::issolarispkgbuild
))
1521 $filesinpackage = installer
::worker
::analyze_patch_files
($filesinpackage);
1522 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "files4_" . $packagename . ".log", $filesinpackage); }
1524 if ( ! ( $#{$filesinpackage} > -1 ))
1526 push(@installer::globals
::emptypackages
, $packagename);
1527 $infoline = "\nNo file in package: $packagename \-\> Skipping\n";
1528 push(@installer::globals
::logfileinfo
, $infoline);
1529 next; # next package, end of loop !
1533 # adding directories, files and links into epm file
1535 installer
::epmfile
::put_directories_into_epmfile
($dirsinpackage, \
@epmfile, $allvariableshashref, $packagerootpath);
1536 installer
::epmfile
::put_files_into_epmfile
($filesinpackage, \
@epmfile );
1537 installer
::epmfile
::put_links_into_epmfile
($linksinpackage, \
@epmfile );
1538 installer
::epmfile
::put_unixlinks_into_epmfile
($unixlinksinpackage, \
@epmfile );
1540 if ((!( $shellscriptsfilename eq "" )) && (!($installer::globals
::iswindowsbuild
))) { installer
::epmfile
::adding_shellscripts_to_epm_file
(\
@epmfile, $shellscriptsfilename, $packagerootpath, $allvariableshashref, $filesinpackage); }
1542 installer
::files
::save_file
($completeepmfilename ,\
@epmfile);
1544 # ... splitting the rootpath into a relocatable part and a static part, if possible
1546 my $staticpath = "";
1547 my $relocatablepath = "";
1548 # relocatable path can be defined in package list
1549 if ( $onepackage->{'relocatablepath'} ) { $relocatablepath = $onepackage->{'relocatablepath'}; }
1550 # setting fix part and variable part of destination path
1551 installer
::epmfile
::analyze_rootpath
($packagerootpath, \
$staticpath, \
$relocatablepath, $allvariableshashref);
1553 # ... replacing the variable PRODUCTDIRECTORYNAME in the shellscriptfile by $staticpath
1555 installer
::epmfile
::resolve_path_in_epm_list_before_packaging
(\
@epmfile, $completeepmfilename, "PRODUCTDIRECTORYNAME", $staticpath);
1556 installer
::epmfile
::resolve_path_in_epm_list_before_packaging
(\
@epmfile, $completeepmfilename, "SOLSUREPACKAGEPREFIX", $allvariableshashref->{'SOLSUREPACKAGEPREFIX'});
1557 installer
::epmfile
::resolve_path_in_epm_list_before_packaging
(\
@epmfile, $completeepmfilename, "UREPACKAGEPREFIX", $allvariableshashref->{'UREPACKAGEPREFIX'});
1558 # installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "BASISDIRECTORYVERSION", $allvariableshashref->{'OOOBASEVERSION'});
1559 installer
::files
::save_file
($completeepmfilename ,\
@epmfile);
1561 # changing into the "install" directory to create installation sets
1563 $currentdir = cwd
(); # $currentdir is global in this file
1565 chdir($installdir); # changing into install directory ($installdir is global in this file)
1567 ###########################################
1569 ###########################################
1571 # With a patched epm, it is now possible to set the relocatable directory, change
1572 # the directory in which the packages are created, setting "requires" and "provides"
1573 # (Linux) or creating the "depend" file (Solaris) and finally to begin
1574 # the packaging process with standard tooling and standard parameter
1575 # Linux: Adding into the spec file: Prefix: /opt
1576 # Solaris: Adding into the pkginfo file: BASEDIR=/opt
1577 # Attention: Changing of the path can influence the shell scripts
1579 if (( $installer::globals
::call_epm
) && ( ! $found_epm ))
1581 $epmexecutable = installer
::epmfile
::find_epm_on_system
($includepatharrayref);
1582 installer
::epmfile
::set_patch_state
($epmexecutable); # setting $installer::globals::is_special_epm
1583 $found_epm = 1; # searching only once
1586 if (( $installer::globals
::is_special_epm
) && ( ($installer::globals
::islinuxrpmbuild
) || ($installer::globals
::issolarispkgbuild
) )) # special handling only for Linux RPMs and Solaris Packages
1588 if ( $installer::globals
::call_epm
) # only do something, if epm is really executed
1590 # ... now epm can be started, to create the installation sets
1592 installer
::logger
::print_message
( "... starting patched epm ... \n" );
1594 installer
::epmfile
::call_epm
($epmexecutable, $completeepmfilename, $packagename, $includepatharrayref);
1596 my $newepmdir = installer
::epmfile
::prepare_packages
($loggingdir, $packagename, $staticpath, $relocatablepath, $onepackage, $allvariableshashref, $filesinpackage, $languagestringref); # adding the line for Prefix / Basedir, include rpmdir
1598 installer
::epmfile
::create_packages_without_epm
($newepmdir, $packagename, $includepatharrayref, $allvariableshashref, $languagestringref); # start to package
1600 # finally removing all temporary files
1602 installer
::epmfile
::remove_temporary_epm_files
($newepmdir, $loggingdir, $packagename);
1605 # Install: pkgadd -a myAdminfile -d ./SUNWso8m34.pkg
1606 # Install: rpm -i --prefix=/opt/special --nodeps so8m35.rpm
1608 # $installer::globals::subdir is only "RPMS" or "packages"
1609 $installer::globals
::subdir
= installer
::epmfile
::create_new_directory_structure
($newepmdir);
1610 $installer::globals
::postprocess_specialepm
= 1;
1612 # solaris patch not needed anymore
1613 # if (( $installer::globals::patch ) && ( $installer::globals::issolarisx86build )) { installer::worker::fix2_solaris_x86_patch($packagename, $installer::globals::subdir); }
1616 else # this is the standard epm (not relocatable) or ( nonlinux and nonsolaris )
1618 installer
::epmfile
::resolve_path_in_epm_list_before_packaging
(\
@epmfile, $completeepmfilename, "\$\$PRODUCTINSTALLLOCATION", $relocatablepath);
1619 installer
::files
::save_file
($completeepmfilename ,\
@epmfile);
1621 if ( $installer::globals
::call_epm
)
1623 # ... now epm can be started, to create the installation sets
1625 installer
::logger
::print_message
( "... starting unpatched epm ... \n" );
1627 if ( $installer::globals
::call_epm
) { installer
::epmfile
::call_epm
($epmexecutable, $completeepmfilename, $packagename, $includepatharrayref); }
1629 if (($installer::globals
::islinuxrpmbuild
) || ($installer::globals
::issolarispkgbuild
) || ($installer::globals
::debian
))
1631 $installer::globals
::postprocess_standardepm
= 1;
1636 chdir($currentdir); # changing back into start directory
1638 ###########################################
1639 # xpd installation mechanism
1640 ###########################################
1642 # creating the xpd file for the package
1644 if ( $installer::globals
::isxpdplatform
)
1646 if (( ! $installer::globals
::languagepack
) && ( ! $installer::globals
::patch
))
1648 if (( $allvariableshashref->{'XPDINSTALLER'} ) && ( $installer::globals
::call_epm
!= 0 ))
1650 # installer::xpdinstaller::create_xpd_file($onepackage, $packages, $languagestringref, $allvariableshashref, $modulesinproductlanguageresolvedarrayref, $installdir, $installer::globals::subdir, $linkpackage);
1651 installer
::xpdinstaller
::create_xpd_file
($onepackage, $packages, $languagestringref, $allvariableshashref, $modulesinproductarrayref, $installdir, $installer::globals
::subdir
, $linkpackage);
1652 $installer::globals
::xpd_files_prepared
= 1;
1657 } # end of "if (! $installer::globals::simple)"
1659 if ( $installer::globals
::makelinuxlinkrpm
) { $k--; } # decreasing the counter to create the link rpm!
1661 } # end of "for ( my $k = 0; $k <= $#{$packages}; $k++ )"
1663 ##############################################################
1664 # Post epm functionality, after the last package is packed
1665 ##############################################################
1667 if ( $installer::globals
::postprocess_specialepm
)
1669 installer
::logger
::include_header_into_logfile
("Post EPM processes (Patched EPM):");
1673 # Copying the cde, kde and gnome packages into the installation set
1674 if ( $installer::globals
::addsystemintegration
) { installer
::epmfile
::put_systemintegration_into_installset
($installer::globals
::subdir
, $includepatharrayref, $allvariableshashref, $modulesinproductarrayref); }
1676 # Adding license and readme into installation set
1677 # if ($installer::globals::addlicensefile) { installer::epmfile::put_installsetfiles_into_installset($installer::globals::subdir); }
1678 if ($installer::globals
::addlicensefile
) { installer
::worker
::put_scpactions_into_installset
("."); }
1680 # Adding child projects to installation dynamically
1681 if ($installer::globals
::addchildprojects
) { installer
::epmfile
::put_childprojects_into_installset
($installer::globals
::subdir
, $allvariableshashref, $modulesinproductarrayref, $includepatharrayref); }
1683 # Adding license file into setup
1684 if ( $allvariableshashref->{'PUT_LICENSE_INTO_SETUP'} ) { installer
::worker
::put_license_into_setup
(".", $includepatharrayref); }
1686 # Creating installation set for Unix language packs, that are not part of multi lingual installation sets
1687 if ( ( $installer::globals
::languagepack
) && ( ! $installer::globals
::debian
) && ( ! $installer::globals
::makedownload
) ) { installer
::languagepack
::build_installer_for_languagepack
($installer::globals
::subdir
, $allvariableshashref, $includepatharrayref, $languagesarrayref, $languagestringref); }
1689 # Finalizing patch installation sets
1690 if (( $installer::globals
::patch
) && ( $installer::globals
::issolarispkgbuild
)) { installer
::epmfile
::finalize_patch
($installer::globals
::subdir
, $allvariableshashref); }
1691 if (( $installer::globals
::patch
) && ( $installer::globals
::islinuxrpmbuild
)) { installer
::epmfile
::finalize_linux_patch
($installer::globals
::subdir
, $allvariableshashref, $includepatharrayref); }
1693 # Copying the xpd installer into the installation set
1694 if (( $allvariableshashref->{'XPDINSTALLER'} ) && ( $installer::globals
::isxpdplatform
) && ( $installer::globals
::xpd_files_prepared
))
1696 installer
::xpdinstaller
::create_xpd_installer
($installdir, $allvariableshashref, $languagestringref);
1697 $installer::globals
::addjavainstaller
= 0; # only one java installer possible
1700 # Copying the java installer into the installation set
1701 chdir($currentdir); # changing back into start directory
1702 if ( $installer::globals
::addjavainstaller
) { installer
::javainstaller
::create_java_installer
($installdir, $installer::globals
::subdir
, $languagestringref, $languagesarrayref, $allvariableshashref, $includepatharrayref, $modulesinproductarrayref); }
1705 if ( $installer::globals
::postprocess_standardepm
)
1707 installer
::logger
::include_header_into_logfile
("Post EPM processes (Standard EPM):");
1711 # determine the destination directory
1712 my $newepmdir = installer
::epmfile
::determine_installdir_ooo
();
1714 # Copying the cde, kde and gnome packages into the installation set
1715 if ( $installer::globals
::addsystemintegration
) { installer
::epmfile
::put_systemintegration_into_installset
($newepmdir, $includepatharrayref, $allvariableshashref, $modulesinproductarrayref); }
1717 # Adding license and readme into installation set
1718 # if ($installer::globals::addlicensefile) { installer::epmfile::put_installsetfiles_into_installset($newepmdir); }
1719 if ($installer::globals
::addlicensefile
) { installer
::worker
::put_scpactions_into_installset
("."); }
1721 # Adding license file into setup
1722 if ( $allvariableshashref->{'PUT_LICENSE_INTO_SETUP'} ) { installer
::worker
::put_license_into_setup
(".", $includepatharrayref); }
1724 # Creating installation set for Unix language packs, that are not part of multi lingual installation sets
1725 if ( ( $installer::globals
::languagepack
) && ( ! $installer::globals
::debian
) && ( ! $installer::globals
::makedownload
) ) { installer
::languagepack
::build_installer_for_languagepack
($newepmdir, $allvariableshashref, $includepatharrayref, $languagesarrayref, $languagestringref); }
1727 chdir($currentdir); # changing back into start directory
1730 #######################################################
1731 # Analyzing the log file
1732 #######################################################
1735 my $finalinstalldir = "";
1737 installer
::worker
::clean_output_tree
(); # removing directories created in the output tree
1738 ($is_success, $finalinstalldir) = installer
::worker
::analyze_and_save_logfile
($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
1739 my $downloadname = installer
::ziplist
::getinfofromziplist
($allsettingsarrayref, "downloadname");
1740 if ( $is_success ) { installer
::followme
::save_followme_info
($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref, $current_install_number, $loggingdir, $installlogdir); }
1742 #######################################################
1743 # Creating download installation set
1744 #######################################################
1746 if ( $installer::globals
::makedownload
)
1748 my $create_download = 0;
1749 if ( $$downloadname ne "" ) { $create_download = 1; }
1750 if (( $is_success ) && ( $create_download ) && ( $ENV{'ENABLE_DOWNLOADSETS'} ))
1752 my $downloaddir = installer
::download
::create_download_sets
($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref);
1753 installer
::worker
::analyze_and_save_logfile
($loggingdir, $downloaddir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
1757 #######################################################
1758 # Creating jds installation set
1759 #######################################################
1761 if ( $installer::globals
::makejds
)
1765 if ( $allvariableshashref->{'JDSBUILD'} ) { $create_jds = 1; }
1766 if (! $installer::globals
::issolarispkgbuild
) { $create_jds = 0; }
1768 if (( $is_success ) && ( $create_jds ))
1770 if ( ! $installer::globals
::jds_language_controlled
)
1772 my $correct_language = installer
::worker
::check_jds_language
($allvariableshashref, $languagestringref);
1773 $installer::globals
::correct_jds_language
= $correct_language;
1774 $installer::globals
::jds_language_controlled
= 1;
1777 if ( $installer::globals
::correct_jds_language
)
1779 my $jdsdir = installer
::worker
::create_jds_sets
($finalinstalldir, $allvariableshashref, $languagestringref, $languagesarrayref, $includepatharrayref);
1780 installer
::worker
::clean_jds_temp_dirs
();
1781 installer
::worker
::analyze_and_save_logfile
($loggingdir, $jdsdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
1786 } # end of "if (!( $installer::globals::iswindowsbuild ))"
1788 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nEnd of part 2a: All non-Windows platforms\n"); }
1790 #################################################
1791 # Part 2b: The Windows platform
1792 #################################################
1794 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nPart 2b: The Windows platform\n"); }
1796 #####################################################################
1797 # ... creating idt files ...
1798 # Only for Windows builds ($installer::globals::compiler is wntmsci)
1799 #####################################################################
1801 if ( $installer::globals
::iswindowsbuild
)
1803 ###########################################
1804 # Stripping libraries
1805 ###########################################
1807 # Building for gcc build in cws requires, that all files are stripped before packaging:
1808 # 1. copy all files that need to be stripped locally
1809 # 2. strip all these files
1811 if ( $installer::globals
::compiler
=~ /wntgcci/ )
1813 installer
::windows
::strip
::strip_binaries
($filesinproductlanguageresolvedarrayref, $languagestringref);
1814 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles16e.log", $filesinproductlanguageresolvedarrayref); }
1817 $installdir = installer
::worker
::create_installation_directory
($shipinstalldir, $languagestringref, \
$current_install_number);
1819 my $idtdirbase = installer
::systemactions
::create_directories
("idt_files", $languagestringref);
1820 $installer::globals
::infodirectory
= installer
::systemactions
::create_directories
("info_files", $languagestringref);
1821 my $installlogdir = installer
::systemactions
::create_directory_next_to_directory
($installdir, "log");
1822 # my $installchecksumdir = installer::systemactions::create_directory_next_to_directory($installdir, "checksum");
1824 #################################################################################
1825 # Preparing cabinet files from package definitions
1826 #################################################################################
1828 # installer::packagelist::prepare_cabinet_files($packages, $allvariableshashref, $$languagestringref);
1829 installer
::packagelist
::prepare_cabinet_files
($packages, $allvariableshashref);
1830 # printing packages content:
1831 installer
::packagelist
::log_cabinet_assignments
();
1833 #################################################################################
1834 # Begin of functions that are used for the creation of idt files (Windows only)
1835 #################################################################################
1837 installer
::logger
::print_message
( "... creating idt files ...\n" );
1839 installer
::logger
::include_header_into_logfile
("Creating idt files:");
1841 my $newidtdir = $idtdirbase . $installer::globals
::separator
. "00"; # new files into language independent directory "00"
1842 installer
::systemactions
::create_directory
($newidtdir);
1844 my @allfilecomponents = ();
1845 my @allregistrycomponents = ();
1847 # Collecting all files with flag "BINARYTABLE"
1848 my $binarytablefiles = installer
::worker
::collect_all_items_with_special_flag
($filesinproductlanguageresolvedarrayref ,"BINARYTABLE");
1850 # Removing all files with flag "BINARYTABLE_ONLY"
1851 @installer::globals
::binarytableonlyfiles
= ();
1852 $filesinproductlanguageresolvedarrayref = installer
::worker
::remove_all_items_with_special_flag
($filesinproductlanguageresolvedarrayref ,"BINARYTABLE_ONLY");
1853 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles17.log", $filesinproductlanguageresolvedarrayref); }
1855 # Collecting all profileitems with flag "INIFILETABLE" for table "IniFile"
1856 my $inifiletableentries = installer
::worker
::collect_all_items_with_special_flag
($profileitemsinproductlanguageresolvedarrayref ,"INIFILETABLE");
1858 # Creating the important dynamic idt files
1859 installer
::windows
::msiglobal
::set_msiproductversion
($allvariableshashref);
1860 installer
::windows
::msiglobal
::put_msiproductversion_into_bootstrapfile
($filesinproductlanguageresolvedarrayref);
1862 # Add cabinet assignments to files
1863 installer
::windows
::file
::assign_cab_to_files
($filesinproductlanguageresolvedarrayref);
1864 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles17a.log", $filesinproductlanguageresolvedarrayref); }
1865 installer
::windows
::file
::assign_sequencenumbers_to_files
($filesinproductlanguageresolvedarrayref);
1866 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles17b.log", $filesinproductlanguageresolvedarrayref); }
1868 # Collection all available directory trees
1869 installer
::windows
::directory
::collectdirectorytrees
($directoriesforepmarrayref);
1871 $filesinproductlanguageresolvedarrayref = installer
::windows
::file
::create_files_table
($filesinproductlanguageresolvedarrayref, \
@allfilecomponents, $newidtdir, $allvariableshashref, $uniquefilename, $allupdatesequences, $allupdatecomponents, $allupdatefileorder);
1872 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles17c.log", $filesinproductlanguageresolvedarrayref); }
1873 if ( $installer::globals
::updatedatabase
) { installer
::windows
::file
::check_file_sequences
($allupdatefileorder, $allupdatecomponentorder); }
1875 installer
::windows
::directory
::create_directory_table
($directoriesforepmarrayref, $newidtdir, $allvariableshashref, $shortdirname);
1876 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles18.log", $filesinproductlanguageresolvedarrayref); }
1877 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "directoriesforidt1.log", $directoriesforepmarrayref); }
1879 # Attention: The table "Registry.idt" contains language specific strings -> parameter: $languagesarrayref !
1880 installer
::windows
::registry
::create_registry_table
($registryitemsinproductlanguageresolvedarrayref, \
@allregistrycomponents, $newidtdir, $languagesarrayref, $allvariableshashref);
1881 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems4.log", $registryitemsinproductlanguageresolvedarrayref); }
1883 installer
::windows
::component
::create_component_table
($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $directoriesforepmarrayref, \
@allfilecomponents, \
@allregistrycomponents, $newidtdir, $componentid, $componentidkeypath);
1884 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles19.log", $filesinproductlanguageresolvedarrayref); }
1885 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "registryitems5.log", $registryitemsinproductlanguageresolvedarrayref); }
1887 # Attention: The table "Feature.idt" contains language specific strings -> parameter: $languagesarrayref !
1888 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules4.log", $modulesinproductlanguageresolvedarrayref); }
1889 installer
::windows
::feature
::add_uniquekey
($modulesinproductlanguageresolvedarrayref);
1890 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules4a.log", $modulesinproductlanguageresolvedarrayref); }
1891 $modulesinproductlanguageresolvedarrayref = installer
::windows
::feature
::sort_feature
($modulesinproductlanguageresolvedarrayref);
1892 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "modules4b.log", $modulesinproductlanguageresolvedarrayref); }
1893 installer
::windows
::feature
::create_feature_table
($modulesinproductlanguageresolvedarrayref, $newidtdir, $languagesarrayref, $allvariableshashref);
1895 installer
::windows
::featurecomponent
::create_featurecomponent_table
($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $newidtdir);
1897 installer
::windows
::media
::create_media_table
($filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref, $allupdatelastsequences, $allupdatediskids);
1898 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles20.log", $filesinproductlanguageresolvedarrayref); }
1900 installer
::windows
::font
::create_font_table
($filesinproductlanguageresolvedarrayref, $newidtdir);
1902 # Attention: The table "Shortcut.idt" contains language specific strings -> parameter: $languagesarrayref !
1903 # Attention: Shortcuts (Folderitems) have icon files, that have to be copied into the Icon directory (last parameter)
1904 my @iconfilecollector = ();
1906 installer
::windows
::shortcut
::create_shortcut_table
($filesinproductlanguageresolvedarrayref, $linksinproductlanguageresolvedarrayref, $folderinproductlanguageresolvedarrayref, $folderitemsinproductlanguageresolvedarrayref, $directoriesforepmarrayref, $newidtdir, $languagesarrayref, $includepatharrayref, \
@iconfilecollector);
1907 if ( $installer::globals
::globallogging
) { installer
::files
::save_array_of_hashes
($loggingdir . "folderitems4.log", $folderitemsinproductlanguageresolvedarrayref); }
1909 installer
::windows
::inifile
::create_inifile_table
($inifiletableentries, $filesinproductlanguageresolvedarrayref, $newidtdir);
1911 installer
::windows
::icon
::create_icon_table
(\
@iconfilecollector, $newidtdir); # creating the icon table with all iconfiles used as shortcuts (FolderItems)
1913 installer
::windows
::createfolder
::create_createfolder_table
($directoriesforepmarrayref, $filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref);
1915 installer
::windows
::upgrade
::create_upgrade_table
($newidtdir, $allvariableshashref);
1917 if ( ! $installer::globals
::languagepack
) # the following tables not for language packs
1919 installer
::windows
::removefile
::create_removefile_table
($folderitemsinproductlanguageresolvedarrayref, $newidtdir);
1921 installer
::windows
::selfreg
::create_selfreg_table
($filesinproductlanguageresolvedarrayref, $newidtdir);
1923 # Adding Assemblies into the tables MsiAssembly and MsiAssemblyName dynamically
1924 installer
::windows
::assembly
::create_msiassembly_table
($filesinproductlanguageresolvedarrayref, $newidtdir);
1925 installer
::windows
::assembly
::create_msiassemblyname_table
($filesinproductlanguageresolvedarrayref, $newidtdir);
1926 installer
::windows
::assembly
::add_assembly_condition_into_component_table
($filesinproductlanguageresolvedarrayref, $newidtdir);
1930 push(@installer::globals
::logfileinfo
, $infoline);
1932 # Localizing the language dependent idt files
1933 # For every language there will be a localized msi database
1934 # For multilingual installation sets, the differences of this
1935 # databases have to be stored in transforms.
1937 for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ )
1939 my $onelanguage = ${$languagesarrayref}[$m];
1942 if ( installer
::existence
::exists_in_array
($onelanguage, \
@installer::globals
::bidilanguages
) ) { $is_bidi = 1; }
1944 my $languageidtdir = $idtdirbase . $installer::globals
::separator
. $onelanguage;
1945 if ( -d
$languageidtdir ) { installer
::systemactions
::remove_complete_directory
($languageidtdir, 1); }
1946 installer
::systemactions
::create_directory
($languageidtdir);
1948 # Copy the template idt files and the new created idt files into this language directory
1950 installer
::logger
::print_message
( "... copying idt files ...\n" );
1952 installer
::logger
::include_header_into_logfile
("Copying idt files to $languageidtdir:");
1954 installer
::windows
::idtglobal
::prepare_language_idt_directory
($languageidtdir, $newidtdir, $onelanguage, $filesinproductlanguageresolvedarrayref, \
@iconfilecollector, $binarytablefiles, $allvariableshashref);
1956 if ( ! $installer::globals
::languagepack
)
1958 # For multilingual installation sets, the dialog for the language selection can now be prepared, with
1959 # a checkbox for each available language. This has to happen before the following translation.
1960 # The new controls have to be added into the Control.idt
1962 my $controlidttablename = $languageidtdir . $installer::globals
::separator
. "Control.idt";
1963 my $controlidttable = installer
::files
::read_file
($controlidttablename);
1964 installer
::windows
::idtglobal
::add_language_checkboxes_to_database
($controlidttable, $languagesarrayref);
1965 installer
::files
::save_file
($controlidttablename, $controlidttable);
1966 $infoline = "Added checkboxes for language selection dialog into table $controlidttablename\n";
1967 push(@installer::globals
::logfileinfo
, $infoline);
1970 # Now all files are copied into a language specific directory
1971 # The template idt files can be translated
1973 installer
::logger
::print_message
( "... localizing idt files (language: $onelanguage) ...\n" );
1975 installer
::logger
::include_header_into_logfile
("Localizing idt files (Language: $onelanguage):");
1977 my @translationfiles = (); # all idt files, that need a translation
1978 push(@translationfiles, "ActionTe.idt");
1979 push(@translationfiles, "Control.idt");
1980 push(@translationfiles, "CustomAc.idt");
1981 push(@translationfiles, "Error.idt");
1982 push(@translationfiles, "LaunchCo.idt");
1983 push(@translationfiles, "RadioBut.idt");
1984 push(@translationfiles, "Property.idt");
1985 push(@translationfiles, "UIText.idt");
1990 foreach $oneidtfilename (@translationfiles)
1992 my $languagefilename = installer
::windows
::idtglobal
::get_languagefilename
($oneidtfilename, $installer::globals
::idtlanguagepath
);
1993 my $languagefile = installer
::files
::read_file
($languagefilename);
1995 $oneidtfilename = $languageidtdir . $installer::globals
::separator
. $oneidtfilename;
1996 $oneidtfile = installer
::files
::read_file
($oneidtfilename);
1998 # Now the substitution can start
1999 installer
::windows
::idtglobal
::translate_idtfile
($oneidtfile, $languagefile, $onelanguage);
2001 installer
::files
::save_file
($oneidtfilename, $oneidtfile);
2003 $infoline = "Translated idt file: $oneidtfilename into language $onelanguage\n";
2004 push(@installer::globals
::logfileinfo
, $infoline);
2005 $infoline = "Used languagefile: $languagefilename\n";
2006 push(@installer::globals
::logfileinfo
, $infoline);
2009 # setting the encoding in every table (replacing WINDOWSENCODINGTEMPLATE)
2011 installer
::windows
::idtglobal
::setencoding
($languageidtdir, $onelanguage);
2013 # setting bidi attributes, if required
2015 if ( $is_bidi ) { installer
::windows
::idtglobal
::setbidiattributes
($languageidtdir, $onelanguage); }
2017 # setting the encoding in every table (replacing WINDOWSENCODINGTEMPLATE)
2018 installer
::windows
::idtglobal
::set_multilanguageonly_condition
($languageidtdir);
2020 # include the license text into the table Control.idt
2022 # my $licensefilesource = installer::windows::idtglobal::get_licensefilesource($onelanguage, $filesinproductlanguageresolvedarrayref);
2023 my $licensefilesource = installer
::windows
::idtglobal
::get_rtflicensefilesource
($onelanguage, $includepatharrayref_lang);
2024 my $licensefile = installer
::files
::read_file
($licensefilesource);
2025 installer
::scpzipfiles
::replace_all_ziplistvariables_in_rtffile
($licensefile, $allvariablesarrayref, $onelanguage, $loggingdir);
2026 my $controltablename = $languageidtdir . $installer::globals
::separator
. "Control.idt";
2027 my $controltable = installer
::files
::read_file
($controltablename);
2028 installer
::windows
::idtglobal
::add_licensefile_to_database
($licensefile, $controltable);
2029 installer
::files
::save_file
($controltablename, $controltable);
2031 $infoline = "Added licensefile $licensefilesource into database $controltablename\n";
2032 push(@installer::globals
::logfileinfo
, $infoline);
2034 # include office directory in CustomAction table
2036 installer
::windows
::idtglobal
::add_officedir_to_database
($languageidtdir, $allvariableshashref);
2038 # include a component into environment table if required
2040 installer
::windows
::component
::set_component_in_environment_table
($languageidtdir, $filesinproductlanguageresolvedarrayref);
2042 # include the ProductCode and the UpgradeCode from codes-file into the Property.idt
2044 installer
::windows
::property
::set_codes_in_property_table
($languageidtdir);
2046 # the language specific properties can now be set in the Property.idt
2048 installer
::windows
::property
::update_property_table
($languageidtdir, $onelanguage, $allvariableshashref, $languagestringref);
2050 # replacing variables in RegLocat.idt
2052 installer
::windows
::msiglobal
::update_reglocat_table
($languageidtdir, $allvariableshashref);
2054 # replacing variables in RemoveRe.idt (RemoveRegistry.idt)
2056 installer
::windows
::msiglobal
::update_removere_table
($languageidtdir);
2058 # adding language specific properties for multilingual installation sets
2060 installer
::windows
::property
::set_languages_in_property_table
($languageidtdir, $languagesarrayref);
2062 # adding settings into CheckBox.idt
2063 installer
::windows
::property
::update_checkbox_table
($languageidtdir, $allvariableshashref);
2065 # adding the files from the binary directory into the binary table
2066 installer
::windows
::binary
::update_binary_table
($languageidtdir, $filesinproductlanguageresolvedarrayref, $binarytablefiles);
2068 # setting patch codes to detect installed products
2070 if (( $installer::globals
::patch
) || ( $installer::globals
::languagepack
) || ( $allvariableshashref->{'PDFCONVERTER'} )) { installer
::windows
::patch
::update_patch_tables
($languageidtdir, $allvariableshashref); }
2072 # Adding Windows Installer CustomActions
2074 installer
::windows
::idtglobal
::addcustomactions
($languageidtdir, $windowscustomactionsarrayref, $filesinproductlanguageresolvedarrayref);
2076 # Adding child projects if specified
2078 if ($installer::globals
::addchildprojects
)
2080 # Adding child projects to installation dynamically (also in feature table)
2081 installer
::windows
::idtglobal
::add_childprojects
($languageidtdir, $filesinproductlanguageresolvedarrayref, $allvariableshashref);
2082 # setting Java variables for Java products
2083 if ( $allvariableshashref->{'JAVAPRODUCT'} ) { installer
::windows
::java
::update_java_tables
($languageidtdir, $allvariableshashref); }
2086 # Then the language specific msi database can be created
2088 if ( $installer::globals
::iswin
) # only possible on a Windows platform
2090 my $msidatabasename = installer
::windows
::msiglobal
::get_msidatabasename
($allvariableshashref, $onelanguage);
2091 my $msifilename = $languageidtdir . $installer::globals
::separator
. $msidatabasename;
2093 installer
::logger
::print_message
( "... creating msi database (language $onelanguage) ... \n" );
2095 installer
::windows
::msiglobal
::set_uuid_into_component_table
($languageidtdir, $allvariableshashref); # setting new GUID for the components using the tool uuidgen.exe
2096 installer
::windows
::msiglobal
::create_msi_database
($languageidtdir ,$msifilename);
2098 # validating the database # ToDo
2100 my $languagefile = installer
::files
::read_file
($installer::globals
::idtlanguagepath
. $installer::globals
::separator
. "SIS.mlf");
2101 # my $languagefile = installer::files::read_file($installer::globals::idtlanguagepath . $installer::globals::separator . "SIS.ulf");
2103 installer
::windows
::msiglobal
::write_summary_into_msi_database
($msifilename, $onelanguage, $languagefile, $allvariableshashref);
2105 # if there are Merge Modules, they have to be integrated now
2106 $filesinproductlanguageresolvedarrayref = installer
::windows
::mergemodule
::merge_mergemodules_into_msi_database
($mergemodulesarrayref, $filesinproductlanguageresolvedarrayref, $msifilename, $languagestringref, $onelanguage, $languagefile, $allvariableshashref, $includepatharrayref, $allupdatesequences, $allupdatelastsequences, $allupdatediskids);
2107 if (( $installer::globals
::globallogging
) && ($installer::globals
::globalloggingform21
)) { installer
::files
::save_array_of_hashes
($loggingdir . "productfiles21_" . $onelanguage . ".log", $filesinproductlanguageresolvedarrayref); }
2108 $installer::globals
::globalloggingform21
= 0;
2109 if ( $installer::globals
::use_packages_for_cabs
) { installer
::windows
::media
::create_media_table
($filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref, $allupdatelastsequences, $allupdatediskids); }
2111 # copy msi database into installation directory
2113 my $msidestfilename = $installdir . $installer::globals
::separator
. $msidatabasename;
2114 installer
::systemactions
::copy_one_file
($msifilename, $msidestfilename);
2118 # Creating transforms, if the installation set has more than one language
2119 # renaming the msi database and generating the setup.ini file
2121 my $defaultlanguage = installer
::languages
::get_default_language
($languagesarrayref);
2123 if ( $installer::globals
::iswin
) # only possible on a Windows platform
2125 if ( $#{$languagesarrayref} > 0 )
2127 installer
::windows
::msiglobal
::create_transforms
($languagesarrayref, $defaultlanguage, $installdir, $allvariableshashref);
2130 installer
::windows
::msiglobal
::rename_msi_database_in_installset
($defaultlanguage, $installdir, $allvariableshashref);
2132 if ( $allvariableshashref->{'ADDLANGUAGEINDATABASENAME'} ) { installer
::windows
::msiglobal
::add_language_to_msi_database
($defaultlanguage, $installdir, $allvariableshashref); }
2134 installer
::logger
::print_message
( "... generating setup.ini ...\n" );
2136 if ( ! $allvariableshashref->{'NOLOADERREQUIRED'} ) { installer
::windows
::msiglobal
::create_setup_ini
($languagesarrayref, $defaultlanguage, $installdir, $allvariableshashref); }
2139 # Analyzing the ScpActions and copying the files into the installation set
2140 # At least the loader, instmsia.exe and instmsiw.exe
2142 installer
::logger
::print_message
( "... copying files into installation set ...\n" );
2144 # installer::windows::msiglobal::copy_scpactions_into_installset($defaultlanguage, $installdir, $scpactionsinproductlanguageresolvedarrayref);
2145 installer
::worker
::put_scpactions_into_installset
($installdir);
2147 # ... copying the setup.exe, instmsia.exe and instmsiw.exe
2149 installer
::windows
::msiglobal
::copy_windows_installer_files_into_installset
($installdir, $includepatharrayref, $allvariableshashref);
2151 # ... copying MergeModules into installation set
2153 if ( ! $installer::globals
::fix_number_of_cab_files
) { installer
::windows
::msiglobal
::copy_merge_modules_into_installset
($installdir); }
2155 # ... copying the child projects
2157 if ($installer::globals
::addchildprojects
)
2159 installer
::windows
::msiglobal
::copy_child_projects_into_installset
($installdir, $allvariableshashref);
2162 installer
::logger
::print_message
( "... creating ddf files ...\n" );
2164 # Creating all needed ddf files and generating a list
2165 # for the package process containing all system calls
2167 my $ddfdir = installer
::systemactions
::create_directories
("ddf", $languagestringref);
2169 $installer::globals
::packjobref
= installer
::windows
::msiglobal
::generate_cab_file_list
($filesinproductlanguageresolvedarrayref, $installdir, $ddfdir, $allvariableshashref);
2171 # Update and patch reasons the pack order needs to be saved
2172 installer
::windows
::msiglobal
::save_packorder
();
2175 push(@installer::globals
::logfileinfo
, $infoline);
2177 ####################################
2179 # before cab files are packed
2180 ####################################
2182 installer
::logger
::print_message
( "... creating log file $installer::globals::logfilename \n" );
2184 installer
::files
::save_file
($loggingdir . $installer::globals
::logfilename
, \
@installer::globals
::logfileinfo
);
2186 #######################################################
2187 # Finally really create the installation packages,
2188 # Only for Windows and only on a windows platform.
2189 #######################################################
2191 if ( $installer::globals
::iswin
) # only possible on a Windows platform
2193 installer
::logger
::print_message
( "... packaging installation set ... \n" );
2194 installer
::windows
::msiglobal
::execute_packaging
($installer::globals
::packjobref
, $loggingdir, $allvariableshashref);
2195 if ( $installer::globals
::include_cab_in_msi
) { installer
::windows
::msiglobal
::include_cabs_into_msi
($installdir); }
2197 ####################################
2199 # after cab files are packed
2200 ####################################
2202 installer
::logger
::print_message
( "\n... creating log file $installer::globals::logfilename \n" );
2203 installer
::files
::save_file
($loggingdir . $installer::globals
::logfilename
, \
@installer::globals
::logfileinfo
);
2206 #######################################################
2207 # Analyzing the log file
2208 #######################################################
2211 my $finalinstalldir = "";
2212 installer
::worker
::clean_output_tree
(); # removing directories created in the output tree
2213 ($is_success, $finalinstalldir) = installer
::worker
::analyze_and_save_logfile
($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
2215 #######################################################
2216 # Creating Windows msp patches
2217 #######################################################
2219 if (( $is_success ) && ( $installer::globals
::updatedatabase
) && ( $allvariableshashref->{'CREATE_MSP_INSTALLSET'} ) && ( ! ( $^O
=~ /cygwin/i ))) # not supported for cygwin yet
2222 # Temp path for administrative installations: $installer::globals::temppath
2223 # Path of new installation set: $finalinstalldir
2224 # Path of old installation set: $installer::globals::updatedatabasepath
2225 my $mspdir = installer
::windows
::msp
::create_msp_patch
($finalinstalldir, $includepatharrayref, $allvariableshashref, $languagestringref, $filesinproductlanguageresolvedarrayref);
2226 ($is_success, $finalinstalldir) = installer
::worker
::analyze_and_save_logfile
($loggingdir, $mspdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
2227 installer
::worker
::clean_output_tree
(); # removing directories created in the output tree
2230 #######################################################
2231 # Creating download installation set
2232 #######################################################
2234 my $create_download = 0;
2235 my $downloadname = installer
::ziplist
::getinfofromziplist
($allsettingsarrayref, "downloadname");
2236 if ( $installer::globals
::languagepack
) { $downloadname = installer
::ziplist
::getinfofromziplist
($allsettingsarrayref, "langpackdownloadname"); }
2237 if ( $installer::globals
::patch
) { $downloadname = installer
::ziplist
::getinfofromziplist
($allsettingsarrayref, "patchdownloadname"); }
2239 if ( $is_success ) { installer
::followme
::save_followme_info
($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref, $current_install_number, $loggingdir, $installlogdir); }
2241 if ( $$downloadname ne "" ) { $create_download = 1; }
2242 if (( $is_success ) && ( $create_download ) && ( $ENV{'ENABLE_DOWNLOADSETS'} ))
2244 my $downloaddir = installer
::download
::create_download_sets
($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref);
2245 installer
::worker
::analyze_and_save_logfile
($loggingdir, $downloaddir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
2248 } # end of "if ( $installer::globals::iswindowsbuild )"
2250 if ( $installer::globals
::debug
) { installer
::logger
::debuginfo
("\nEnd of part 2b: The Windows platform\n"); }
2252 # saving file_info file for later analysis
2253 my $speciallogfilename = "fileinfo_" . $installer::globals
::product
. "\.log";
2254 installer
::files
::save_array_of_hashes
($loggingdir . $speciallogfilename, $filesinproductlanguageresolvedarrayref);
2256 } # end of iteration for one language group
2258 # saving debug info at end
2259 if ( $installer::globals
::debug
) { installer
::logger
::savedebug
($installer::globals
::exitlog
); }
2261 #######################################################
2263 #######################################################
2265 installer
::logger
::stoptime
();
2267 ####################################
2269 ####################################