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