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