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