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