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