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