19780544fSAndrew Rist#************************************************************** 29780544fSAndrew Rist# 39780544fSAndrew Rist# Licensed to the Apache Software Foundation (ASF) under one 49780544fSAndrew Rist# or more contributor license agreements. See the NOTICE file 59780544fSAndrew Rist# distributed with this work for additional information 69780544fSAndrew Rist# regarding copyright ownership. The ASF licenses this file 79780544fSAndrew Rist# to you under the Apache License, Version 2.0 (the 89780544fSAndrew Rist# "License"); you may not use this file except in compliance 99780544fSAndrew Rist# with the License. You may obtain a copy of the License at 109780544fSAndrew Rist# 119780544fSAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 129780544fSAndrew Rist# 139780544fSAndrew Rist# Unless required by applicable law or agreed to in writing, 149780544fSAndrew Rist# software distributed under the License is distributed on an 159780544fSAndrew Rist# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 169780544fSAndrew Rist# KIND, either express or implied. See the License for the 179780544fSAndrew Rist# specific language governing permissions and limitations 189780544fSAndrew Rist# under the License. 199780544fSAndrew Rist# 209780544fSAndrew Rist#************************************************************** 219780544fSAndrew Rist 229780544fSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweirpackage installer::windows::property; 25cdf0e10cSrcweir 26cdf0e10cSrcweiruse installer::exiter; 27cdf0e10cSrcweiruse installer::files; 28cdf0e10cSrcweiruse installer::globals; 29cdf0e10cSrcweiruse installer::windows::idtglobal; 30cdf0e10cSrcweiruse installer::windows::language; 31cdf0e10cSrcweir 32cdf0e10cSrcweir############################################# 33cdf0e10cSrcweir# Setting the properties dynamically 34cdf0e10cSrcweir# for the table Property.idt 35cdf0e10cSrcweir############################################# 36cdf0e10cSrcweir 37cdf0e10cSrcweirsub get_arpcomments_for_property_table 38cdf0e10cSrcweir{ 39cdf0e10cSrcweir my ( $allvariables, $languagestringref ) = @_; 40cdf0e10cSrcweir 41cdf0e10cSrcweir my $name = $allvariables->{'PRODUCTNAME'}; 42cdf0e10cSrcweir my $version = $allvariables->{'PRODUCTVERSION'}; 43cdf0e10cSrcweir my $comment = $name . " " . $version; 44cdf0e10cSrcweir 45cdf0e10cSrcweir my $postversionextension = ""; 46cdf0e10cSrcweir if ( $allvariables->{'POSTVERSIONEXTENSION'} ) 47cdf0e10cSrcweir { 48cdf0e10cSrcweir $postversionextension = $allvariables->{'POSTVERSIONEXTENSION'}; 49cdf0e10cSrcweir $comment = $comment . " " . $postversionextension; 50cdf0e10cSrcweir } 51cdf0e10cSrcweir 52cdf0e10cSrcweir if ( $installer::globals::languagepack ) { $comment = $comment . " " . "Language Pack"; } 53cdf0e10cSrcweir 54cdf0e10cSrcweir if ( $installer::globals::patch ) 55cdf0e10cSrcweir { 56cdf0e10cSrcweir if ( ! $allvariables->{'WINDOWSPATCHLEVEL'} ) { installer::exiter::exit_program("ERROR: No Patch level defined for Windows patch: WINDOWSPATCHLEVEL", "get_arpcomments_for_property_table"); } 57cdf0e10cSrcweir my $patchstring = "Product Update" . " " . $allvariables->{'WINDOWSPATCHLEVEL'}; 58cdf0e10cSrcweir $comment = $comment . " " . $patchstring; 59cdf0e10cSrcweir } 60cdf0e10cSrcweir 61cdf0e10cSrcweir my $languagestring = $$languagestringref; 62cdf0e10cSrcweir $languagestring =~ s/\_/\,/g; 63cdf0e10cSrcweir 64cdf0e10cSrcweir $comment = $comment . " ($languagestring)"; 65cdf0e10cSrcweir 66cdf0e10cSrcweir my $localminor = ""; 67cdf0e10cSrcweir if ( $installer::globals::updatepack ) { $localminor = $installer::globals::lastminor; } 68cdf0e10cSrcweir else { $localminor = $installer::globals::minor; } 69cdf0e10cSrcweir 70cdf0e10cSrcweir my $buildidstring = "(" . $installer::globals::build . $localminor . "(Build:" . $installer::globals::buildid . "))"; 71cdf0e10cSrcweir 72cdf0e10cSrcweir # the environment variable CWS_WORK_STAMP is set only in CWS 73cdf0e10cSrcweir if ( $ENV{'CWS_WORK_STAMP'} ) { $buildidstring = $buildidstring . "\[CWS\:" . $ENV{'CWS_WORK_STAMP'} . "\]"; } 74cdf0e10cSrcweir 75cdf0e10cSrcweir $comment = $comment . " " . $buildidstring; 76cdf0e10cSrcweir 77cdf0e10cSrcweir return $comment; 78cdf0e10cSrcweir} 79cdf0e10cSrcweir 80cdf0e10cSrcweirsub get_installlevel_for_property_table 81cdf0e10cSrcweir{ 82cdf0e10cSrcweir my $installlevel = "100"; 83cdf0e10cSrcweir return $installlevel; 84cdf0e10cSrcweir} 85cdf0e10cSrcweir 86cdf0e10cSrcweirsub get_ischeckforproductupdates_for_property_table 87cdf0e10cSrcweir{ 88cdf0e10cSrcweir my $ischeckforproductupdates = "1"; 89cdf0e10cSrcweir return $ischeckforproductupdates; 90cdf0e10cSrcweir} 91cdf0e10cSrcweir 92cdf0e10cSrcweirsub get_manufacturer_for_property_table 93cdf0e10cSrcweir{ 94cdf0e10cSrcweir return $installer::globals::manufacturer; 95cdf0e10cSrcweir} 96cdf0e10cSrcweir 97cdf0e10cSrcweirsub get_productlanguage_for_property_table 98cdf0e10cSrcweir{ 99cdf0e10cSrcweir my ($language) = @_; 100cdf0e10cSrcweir my $windowslanguage = installer::windows::language::get_windows_language($language); 101cdf0e10cSrcweir return $windowslanguage; 102cdf0e10cSrcweir} 103cdf0e10cSrcweir 104cdf0e10cSrcweirsub get_language_string 105cdf0e10cSrcweir{ 106cdf0e10cSrcweir my $langstring = ""; 107cdf0e10cSrcweir 108cdf0e10cSrcweir for ( my $i = 0; $i <= $#installer::globals::languagenames; $i++ ) 109cdf0e10cSrcweir { 110cdf0e10cSrcweir $langstring = $langstring . $installer::globals::languagenames[$i] . ", "; 111cdf0e10cSrcweir } 112cdf0e10cSrcweir 113cdf0e10cSrcweir $langstring =~ s/\,\s*$//; 114cdf0e10cSrcweir $langstring = "(" . $langstring . ")"; 115cdf0e10cSrcweir 116cdf0e10cSrcweir return $langstring; 117cdf0e10cSrcweir} 118cdf0e10cSrcweir 119cdf0e10cSrcweirsub get_english_language_string 120cdf0e10cSrcweir{ 121cdf0e10cSrcweir my $langstring = ""; 122cdf0e10cSrcweir 123cdf0e10cSrcweir # Sorting value not keys, therefore collecting all values 124cdf0e10cSrcweir my %helper = (); 125cdf0e10cSrcweir foreach my $lang ( keys %installer::globals::all_required_english_languagestrings ) 126cdf0e10cSrcweir { 127cdf0e10cSrcweir $helper{$installer::globals::all_required_english_languagestrings{$lang}} = 1; 128cdf0e10cSrcweir } 129cdf0e10cSrcweir 130cdf0e10cSrcweir foreach my $lang ( sort keys %helper ) 131cdf0e10cSrcweir { 132cdf0e10cSrcweir $langstring = $langstring . $lang . ", "; 133cdf0e10cSrcweir } 134cdf0e10cSrcweir 135cdf0e10cSrcweir $langstring =~ s/\,\s*$//; 136cdf0e10cSrcweir $langstring = "(" . $langstring . ")"; 137cdf0e10cSrcweir 138cdf0e10cSrcweir return $langstring; 139cdf0e10cSrcweir} 140cdf0e10cSrcweir 141cdf0e10cSrcweirsub get_productname_for_property_table 142cdf0e10cSrcweir{ 143cdf0e10cSrcweir my ( $allvariables ) = @_; 144cdf0e10cSrcweir 145cdf0e10cSrcweir my $name = $allvariables->{'PRODUCTNAME'}; 146cdf0e10cSrcweir my $version = $allvariables->{'PRODUCTVERSION'}; 147cdf0e10cSrcweir my $productname = $name . " " . $version; 148cdf0e10cSrcweir 149cdf0e10cSrcweir my $postversionextension = ""; 150cdf0e10cSrcweir if ( $allvariables->{'POSTVERSIONEXTENSION'} ) 151cdf0e10cSrcweir { 152cdf0e10cSrcweir $postversionextension = $allvariables->{'POSTVERSIONEXTENSION'}; 153cdf0e10cSrcweir $productname = $productname . " " . $postversionextension; 154cdf0e10cSrcweir } 155cdf0e10cSrcweir 156cdf0e10cSrcweir my $productextension = ""; 157cdf0e10cSrcweir if ( $allvariables->{'PRODUCTEXTENSION'} ) 158cdf0e10cSrcweir { 159cdf0e10cSrcweir $productextension = $allvariables->{'PRODUCTEXTENSION'}; 160cdf0e10cSrcweir $productname = $productname . " " . $productextension; 161cdf0e10cSrcweir } 162cdf0e10cSrcweir 163cdf0e10cSrcweir if ( $installer::globals::languagepack ) 164cdf0e10cSrcweir { 165cdf0e10cSrcweir # my $langstring = get_language_string(); # Example (English, Deutsch) 166cdf0e10cSrcweir my $langstring = get_english_language_string(); # New: (English, German) 167cdf0e10cSrcweir $productname = $name . " " . $version . " Language Pack" . " " . $langstring; 168cdf0e10cSrcweir } 169cdf0e10cSrcweir 170cdf0e10cSrcweir if ( $installer::globals::patch ) 171cdf0e10cSrcweir { 172cdf0e10cSrcweir if ( ! $allvariables->{'WINDOWSPATCHLEVEL'} ) { installer::exiter::exit_program("ERROR: No Patch level defined for Windows patch: WINDOWSPATCHLEVEL", "get_productname_for_property_table"); } 173cdf0e10cSrcweir my $patchstring = "Product Update" . " " . $allvariables->{'WINDOWSPATCHLEVEL'}; 174cdf0e10cSrcweir $productname = $productname . " " . $patchstring; 175cdf0e10cSrcweir } 176cdf0e10cSrcweir 177cdf0e10cSrcweir # Saving this name in hash $allvariables for further usage 178cdf0e10cSrcweir $allvariables->{'PROPERTYTABLEPRODUCTNAME'} = $productname; 179cdf0e10cSrcweir my $infoline = "Defined variable PROPERTYTABLEPRODUCTNAME: $productname\n"; 180*b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 181cdf0e10cSrcweir 182cdf0e10cSrcweir return $productname; 183cdf0e10cSrcweir} 184cdf0e10cSrcweir 185cdf0e10cSrcweirsub get_quickstarterlinkname_for_property_table 186cdf0e10cSrcweir{ 187cdf0e10cSrcweir my ( $allvariables ) = @_; 188cdf0e10cSrcweir 189cdf0e10cSrcweir # no usage of POSTVERSIONEXTENSION for Quickstarter link name! 190cdf0e10cSrcweir 191cdf0e10cSrcweir my $name = $allvariables->{'PRODUCTNAME'}; 192cdf0e10cSrcweir my $version = $allvariables->{'PRODUCTVERSION'}; 193cdf0e10cSrcweir my $quickstartername = $name . " " . $version; 194cdf0e10cSrcweir 195cdf0e10cSrcweir my $infoline = "Defined Quickstarter Link name: $quickstartername\n"; 196*b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 197cdf0e10cSrcweir 198cdf0e10cSrcweir return $quickstartername; 199cdf0e10cSrcweir} 200cdf0e10cSrcweir 201cdf0e10cSrcweirsub get_productversion_for_property_table 202cdf0e10cSrcweir{ 203cdf0e10cSrcweir return $installer::globals::msiproductversion; 204cdf0e10cSrcweir} 205cdf0e10cSrcweir 206cdf0e10cSrcweir####################################################### 207cdf0e10cSrcweir# Setting all feature names as Properties. This is 208cdf0e10cSrcweir# required for the Windows patch process. 209cdf0e10cSrcweir####################################################### 210cdf0e10cSrcweir 211cdf0e10cSrcweirsub set_featurename_properties_for_patch 212cdf0e10cSrcweir{ 213cdf0e10cSrcweir ($propertyfile) = @_; 214cdf0e10cSrcweir 215cdf0e10cSrcweir for ( my $i = 0; $i <= $#installer::globals::featurecollector; $i++ ) 216cdf0e10cSrcweir { 217cdf0e10cSrcweir my $onepropertyline = $installer::globals::featurecollector[$i] . "\t" . "1" . "\n"; 218cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 219cdf0e10cSrcweir } 220cdf0e10cSrcweir 221cdf0e10cSrcweir} 222cdf0e10cSrcweir 223cdf0e10cSrcweir####################################################### 224cdf0e10cSrcweir# Setting some important properties 225cdf0e10cSrcweir# (for finding the product in deinstallation process) 226cdf0e10cSrcweir####################################################### 227cdf0e10cSrcweir 228cdf0e10cSrcweirsub set_important_properties 229cdf0e10cSrcweir{ 230cdf0e10cSrcweir my ($propertyfile, $allvariables, $languagestringref) = @_; 231cdf0e10cSrcweir 232cdf0e10cSrcweir # Setting new variables with the content of %PRODUCTNAME and %PRODUCTVERSION 233cdf0e10cSrcweir if ( $allvariables->{'PRODUCTNAME'} ) 234cdf0e10cSrcweir { 235cdf0e10cSrcweir my $onepropertyline = "DEFINEDPRODUCT" . "\t" . $allvariables->{'PRODUCTNAME'} . "\n"; 236cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 237cdf0e10cSrcweir } 238cdf0e10cSrcweir 239cdf0e10cSrcweir if ( $allvariables->{'PRODUCTVERSION'} ) 240cdf0e10cSrcweir { 241cdf0e10cSrcweir my $onepropertyline = "DEFINEDVERSION" . "\t" . $allvariables->{'PRODUCTVERSION'} . "\n"; 242cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 243cdf0e10cSrcweir } 244cdf0e10cSrcweir 245cdf0e10cSrcweir if (( $allvariables->{'PRODUCTNAME'} ) && ( $allvariables->{'PRODUCTVERSION'} ) && ( $allvariables->{'MANUFACTURER'} ) && ( $allvariables->{'PRODUCTCODE'} )) 246cdf0e10cSrcweir { 247cdf0e10cSrcweir my $onepropertyline = "FINDPRODUCT" . "\t" . "Software\\" . $allvariables->{'MANUFACTURER'} . "\\" . $allvariables->{'PRODUCTNAME'} . $allvariables->{'PRODUCTADDON'} . "\\" . $allvariables->{'PRODUCTVERSION'} . "\\" . $allvariables->{'PRODUCTCODE'} . "\n"; 248cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 249cdf0e10cSrcweir } 250cdf0e10cSrcweir 251cdf0e10cSrcweir if ( $allvariables->{'PRODUCTMAJOR'} ) 252cdf0e10cSrcweir { 253cdf0e10cSrcweir my $onepropertyline = "PRODUCTMAJOR" . "\t" . $allvariables->{'PRODUCTMAJOR'} . "\n"; 254cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 255cdf0e10cSrcweir } 256cdf0e10cSrcweir 257cdf0e10cSrcweir if ( $allvariables->{'PRODUCTMINOR'} ) 258cdf0e10cSrcweir { 259cdf0e10cSrcweir my $onepropertyline = "PRODUCTMINOR" . "\t" . $allvariables->{'PRODUCTMINOR'} . "\n"; 260cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 261cdf0e10cSrcweir } 262cdf0e10cSrcweir 263cdf0e10cSrcweir if ( $allvariables->{'PRODUCTBUILDID'} ) 264cdf0e10cSrcweir { 265cdf0e10cSrcweir my $onepropertyline = "PRODUCTBUILDID" . "\t" . $allvariables->{'PRODUCTBUILDID'} . "\n"; 266cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 267cdf0e10cSrcweir } 268cdf0e10cSrcweir 269cdf0e10cSrcweir if ( $allvariables->{'OOOBASEVERSION'} ) 270cdf0e10cSrcweir { 271cdf0e10cSrcweir my $onepropertyline = "OOOBASEVERSION" . "\t" . $allvariables->{'OOOBASEVERSION'} . "\n"; 272cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 273cdf0e10cSrcweir } 274cdf0e10cSrcweir 275cdf0e10cSrcweir if ( $allvariables->{'URELAYERVERSION'} ) 276cdf0e10cSrcweir { 277cdf0e10cSrcweir my $onepropertyline = "URELAYERVERSION" . "\t" . $allvariables->{'URELAYERVERSION'} . "\n"; 278cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 279cdf0e10cSrcweir } 280cdf0e10cSrcweir 281cdf0e10cSrcweir if ( $allvariables->{'BRANDPACKAGEVERSION'} ) 282cdf0e10cSrcweir { 283cdf0e10cSrcweir my $onepropertyline = "BRANDPACKAGEVERSION" . "\t" . $allvariables->{'BRANDPACKAGEVERSION'} . "\n"; 284cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 285cdf0e10cSrcweir } 286cdf0e10cSrcweir 287cdf0e10cSrcweir if ( $allvariables->{'BASISROOTNAME'} ) 288cdf0e10cSrcweir { 289cdf0e10cSrcweir my $onepropertyline = "BASISROOTNAME" . "\t" . $allvariables->{'BASISROOTNAME'} . "\n"; 290cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 291cdf0e10cSrcweir } 292cdf0e10cSrcweir 293cdf0e10cSrcweir if ( $allvariables->{'EXCLUDE_FROM_REBASE'} ) 294cdf0e10cSrcweir { 295cdf0e10cSrcweir my $onepropertyline = "EXCLUDE_FROM_REBASE" . "\t" . $allvariables->{'EXCLUDE_FROM_REBASE'} . "\n"; 296cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 297cdf0e10cSrcweir } 298cdf0e10cSrcweir 299cdf0e10cSrcweir if ( $allvariables->{'PREREQUIREDPATCH'} ) 300cdf0e10cSrcweir { 301cdf0e10cSrcweir my $onepropertyline = "PREREQUIREDPATCH" . "\t" . $allvariables->{'PREREQUIREDPATCH'} . "\n"; 302cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 303cdf0e10cSrcweir } 304cdf0e10cSrcweir 305cdf0e10cSrcweir my $onepropertyline = "IGNOREPREREQUIREDPATCH" . "\t" . "1" . "\n"; 306cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 307cdf0e10cSrcweir 308cdf0e10cSrcweir $onepropertyline = "DONTOPTIMIZELIBS" . "\t" . "0" . "\n"; 309cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 310cdf0e10cSrcweir 311cdf0e10cSrcweir if ( $installer::globals::sundirexists ) 312cdf0e10cSrcweir { 313cdf0e10cSrcweir my $onepropertyline = "SUNDIREXISTS" . "\t" . "1" . "\n"; 314cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 315cdf0e10cSrcweir } 316cdf0e10cSrcweir 317cdf0e10cSrcweir if ( $installer::globals::officedirhostname ) 318cdf0e10cSrcweir { 319cdf0e10cSrcweir my $onepropertyline = "OFFICEDIRHOSTNAME" . "\t" . $installer::globals::officedirhostname . "\n"; 320cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 321cdf0e10cSrcweir 322cdf0e10cSrcweir my $localofficedirhostname = $installer::globals::officedirhostname; 323cdf0e10cSrcweir $localofficedirhostname =~ s/\//\\/g; 324cdf0e10cSrcweir $onepropertyline = "OFFICEDIRHOSTNAME_" . "\t" . $localofficedirhostname . "\n"; 325cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 326cdf0e10cSrcweir } 327cdf0e10cSrcweir 328cdf0e10cSrcweir if ( $installer::globals::sundirhostname ) 329cdf0e10cSrcweir { 330cdf0e10cSrcweir my $onepropertyline = "SUNDIRHOSTNAME" . "\t" . $installer::globals::sundirhostname . "\n"; 331cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 332cdf0e10cSrcweir } 333cdf0e10cSrcweir 334cdf0e10cSrcweir if ( $installer::globals::desktoplinkexists ) 335cdf0e10cSrcweir { 336cdf0e10cSrcweir my $onepropertyline = "DESKTOPLINKEXISTS" . "\t" . "1" . "\n"; 337cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 338cdf0e10cSrcweir 339cdf0e10cSrcweir $onepropertyline = "CREATEDESKTOPLINK" . "\t" . "1" . "\n"; # Setting the default 340cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 341cdf0e10cSrcweir } 342cdf0e10cSrcweir 343cdf0e10cSrcweir if ( $installer::globals::patch ) 344cdf0e10cSrcweir { 345cdf0e10cSrcweir my $onepropertyline = "ISPATCH" . "\t" . "1" . "\n"; 346cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 347cdf0e10cSrcweir 348cdf0e10cSrcweir $onepropertyline = "SETUP_USED" . "\t" . "0" . "\n"; 349cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 350cdf0e10cSrcweir } 351cdf0e10cSrcweir 352cdf0e10cSrcweir if ( $installer::globals::languagepack ) 353cdf0e10cSrcweir { 354cdf0e10cSrcweir my $onepropertyline = "ISLANGUAGEPACK" . "\t" . "1" . "\n"; 355cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 356cdf0e10cSrcweir } 357cdf0e10cSrcweir 358cdf0e10cSrcweir my $languagesline = "PRODUCTALLLANGUAGES" . "\t" . $$languagestringref . "\n"; 359cdf0e10cSrcweir push(@{$propertyfile}, $languagesline); 360cdf0e10cSrcweir 361cdf0e10cSrcweir if (( $allvariables->{'PRODUCTEXTENSION'} ) && ( $allvariables->{'PRODUCTEXTENSION'} eq "Beta" )) 362cdf0e10cSrcweir { 363cdf0e10cSrcweir # my $registryline = "WRITE_REGISTRY" . "\t" . "0" . "\n"; 364cdf0e10cSrcweir # push(@{$propertyfile}, $registryline); 365cdf0e10cSrcweir my $betainfoline = "BETAPRODUCT" . "\t" . "1" . "\n"; 366cdf0e10cSrcweir push(@{$propertyfile}, $betainfoline); 367cdf0e10cSrcweir } 368cdf0e10cSrcweir elsif ( $allvariables->{'DEVELOPMENTPRODUCT'} ) 369cdf0e10cSrcweir { 370cdf0e10cSrcweir my $registryline = "WRITE_REGISTRY" . "\t" . "0" . "\n"; 371cdf0e10cSrcweir push(@{$propertyfile}, $registryline); 372cdf0e10cSrcweir } 373cdf0e10cSrcweir else 374cdf0e10cSrcweir { 375cdf0e10cSrcweir my $registryline = "WRITE_REGISTRY" . "\t" . "1" . "\n"; # Default: Write complete registry 376cdf0e10cSrcweir push(@{$propertyfile}, $registryline); 377cdf0e10cSrcweir } 378cdf0e10cSrcweir 379cdf0e10cSrcweir # Adding also used tree conditions for multilayer products. 380cdf0e10cSrcweir # These are saved in %installer::globals::usedtreeconditions 381cdf0e10cSrcweir foreach my $treecondition (keys %installer::globals::usedtreeconditions) 382cdf0e10cSrcweir { 383cdf0e10cSrcweir my $onepropertyline = $treecondition . "\t" . "1" . "\n"; 384cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 385cdf0e10cSrcweir } 386cdf0e10cSrcweir 387cdf0e10cSrcweir # No more license dialog for selected products 388cdf0e10cSrcweir if ( $allvariables->{'HIDELICENSEDIALOG'} ) 389cdf0e10cSrcweir { 390cdf0e10cSrcweir my $onepropertyline = "HIDEEULA" . "\t" . "1" . "\n"; 391cdf0e10cSrcweir 392cdf0e10cSrcweir my $already_defined = 0; 393cdf0e10cSrcweir 394cdf0e10cSrcweir for ( my $i = 0; $i <= $#{$propertyfile}; $i++ ) 395cdf0e10cSrcweir { 396cdf0e10cSrcweir if ( ${$propertyfile}[$i] =~ /^\s*HIDEEULA\t/ ) 397cdf0e10cSrcweir { 398cdf0e10cSrcweir ${$propertyfile}[$i] = $onepropertyline; 399cdf0e10cSrcweir $already_defined = 1; 400cdf0e10cSrcweir last; 401cdf0e10cSrcweir } 402cdf0e10cSrcweir } 403cdf0e10cSrcweir 404cdf0e10cSrcweir if ( ! $already_defined ) 405cdf0e10cSrcweir { 406cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 407cdf0e10cSrcweir } 408cdf0e10cSrcweir } 409cdf0e10cSrcweir 410cdf0e10cSrcweir # Setting .NET requirements 411cdf0e10cSrcweir if ( $installer::globals::required_dotnet_version ne "" ) 412cdf0e10cSrcweir { 413cdf0e10cSrcweir my $onepropertyline = "REQUIRED_DOTNET_VERSION" . "\t" . $installer::globals::required_dotnet_version . "\n"; 414cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 415cdf0e10cSrcweir 416cdf0e10cSrcweir $onepropertyline = "DOTNET_SUFFICIENT" . "\t" . "1" . "\n"; # default value for found .NET 417cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 418cdf0e10cSrcweir } 419cdf0e10cSrcweir 420cdf0e10cSrcweir} 421cdf0e10cSrcweir 422cdf0e10cSrcweir####################################################### 423cdf0e10cSrcweir# Setting properties needed for ms file type registration 424cdf0e10cSrcweir####################################################### 425cdf0e10cSrcweir 426cdf0e10cSrcweirsub set_ms_file_types_properties 427cdf0e10cSrcweir{ 428cdf0e10cSrcweir my ($propertyfile) = @_; 429cdf0e10cSrcweir 430cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPS" . "\t" . "0" . "\n"); 431cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPSX" . "\t" . "0" . "\n"); 432cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPSM" . "\t" . "0" . "\n"); 433cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPAM" . "\t" . "0" . "\n"); 434cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPT" . "\t" . "0" . "\n"); 435cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPTX" . "\t" . "0" . "\n"); 436cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPTM" . "\t" . "0" . "\n"); 437cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_POT" . "\t" . "0" . "\n"); 438cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_POTX" . "\t" . "0" . "\n"); 439cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_POTM" . "\t" . "0" . "\n"); 440cdf0e10cSrcweir 441cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOC" . "\t" . "0" . "\n"); 442cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOCX" . "\t" . "0" . "\n"); 443cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOCM" . "\t" . "0" . "\n"); 444cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOT" . "\t" . "0" . "\n"); 445cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOTX" . "\t" . "0" . "\n"); 446cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOTM" . "\t" . "0" . "\n"); 447cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_RTF" . "\t" . "0" . "\n"); 448cdf0e10cSrcweir 449cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLS" . "\t" . "0" . "\n"); 450cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLSX" . "\t" . "0" . "\n"); 451cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLSM" . "\t" . "0" . "\n"); 452cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLSB" . "\t" . "0" . "\n"); 453cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLAM" . "\t" . "0" . "\n"); 454cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLT" . "\t" . "0" . "\n"); 455cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLTX" . "\t" . "0" . "\n"); 456cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLTM" . "\t" . "0" . "\n"); 457cdf0e10cSrcweir 458cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_NO_MSO_TYPES" . "\t" . "0" . "\n"); 459cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_ALL_MSO_TYPES" . "\t" . "0" . "\n"); 460cdf0e10cSrcweir} 461cdf0e10cSrcweir 462cdf0e10cSrcweir#################################################################################### 463cdf0e10cSrcweir# Updating the file Property.idt dynamically 464cdf0e10cSrcweir# Content: 465cdf0e10cSrcweir# Property Value 466cdf0e10cSrcweir#################################################################################### 467cdf0e10cSrcweir 468cdf0e10cSrcweirsub update_property_table 469cdf0e10cSrcweir{ 470cdf0e10cSrcweir my ($basedir, $language, $allvariables, $languagestringref) = @_; 471cdf0e10cSrcweir 472cdf0e10cSrcweir my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; 473cdf0e10cSrcweir 474cdf0e10cSrcweir my $propertyfile = installer::files::read_file($properyfilename); 475cdf0e10cSrcweir 476cdf0e10cSrcweir # Getting the new values 477cdf0e10cSrcweir # Some values (arpcomments, arpcontacts, ...) are inserted from the Property.mlf 478cdf0e10cSrcweir 479cdf0e10cSrcweir my $arpcomments = get_arpcomments_for_property_table($allvariables, $languagestringref); 480cdf0e10cSrcweir my $installlevel = get_installlevel_for_property_table(); 481cdf0e10cSrcweir my $ischeckforproductupdates = get_ischeckforproductupdates_for_property_table(); 482a6a1cc63SJürgen Schmidt my $manufacturer = $allvariables->{'OOOVENDOR'}; 483cdf0e10cSrcweir my $productlanguage = get_productlanguage_for_property_table($language); 484cdf0e10cSrcweir my $productname = get_productname_for_property_table($allvariables); 485cdf0e10cSrcweir my $productversion = get_productversion_for_property_table(); 486cdf0e10cSrcweir my $quickstarterlinkname = get_quickstarterlinkname_for_property_table($allvariables); 487cdf0e10cSrcweir 488cdf0e10cSrcweir # Updating the values 489cdf0e10cSrcweir 490cdf0e10cSrcweir for ( my $i = 0; $i <= $#{$propertyfile}; $i++ ) 491cdf0e10cSrcweir { 492cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bARPCOMMENTSTEMPLATE\b/$arpcomments/; 493cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bINSTALLLEVELTEMPLATE\b/$installlevel/; 494cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bISCHECKFORPRODUCTUPDATESTEMPLATE\b/$ischeckforproductupdates/; 495cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bMANUFACTURERTEMPLATE\b/$manufacturer/; 496cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bPRODUCTLANGUAGETEMPLATE\b/$productlanguage/; 497cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bPRODUCTNAMETEMPLATE\b/$productname/; 498cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bPRODUCTVERSIONTEMPLATE\b/$productversion/; 499cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bQUICKSTARTERLINKNAMETEMPLATE\b/$quickstarterlinkname/; 500cdf0e10cSrcweir } 501cdf0e10cSrcweir 502cdf0e10cSrcweir # Setting variables into propertytable 503cdf0e10cSrcweir set_important_properties($propertyfile, $allvariables, $languagestringref); 504cdf0e10cSrcweir 505cdf0e10cSrcweir # Setting feature names as properties for Windows patch mechanism 506cdf0e10cSrcweir if ( $installer::globals::patch ) { set_featurename_properties_for_patch($propertyfile); } 507cdf0e10cSrcweir 508cdf0e10cSrcweir # Setting variables for register for ms file types 509cdf0e10cSrcweir set_ms_file_types_properties($propertyfile); 510cdf0e10cSrcweir 511cdf0e10cSrcweir # Saving the file 512cdf0e10cSrcweir 513cdf0e10cSrcweir installer::files::save_file($properyfilename ,$propertyfile); 514cdf0e10cSrcweir my $infoline = "Updated idt file: $properyfilename\n"; 515*b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 516cdf0e10cSrcweir 517cdf0e10cSrcweir} 518cdf0e10cSrcweir 519cdf0e10cSrcweir#################################################################################### 520cdf0e10cSrcweir# Setting language specific Properties in file Property.idt dynamically 521cdf0e10cSrcweir# Adding: 522cdf0e10cSrcweir# is1033 = 1 523cdf0e10cSrcweir# isMulti = 1 524cdf0e10cSrcweir#################################################################################### 525cdf0e10cSrcweir 526cdf0e10cSrcweirsub set_languages_in_property_table 527cdf0e10cSrcweir{ 528cdf0e10cSrcweir my ($basedir, $languagesarrayref) = @_; 529cdf0e10cSrcweir 530cdf0e10cSrcweir my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; 531cdf0e10cSrcweir my $propertyfile = installer::files::read_file($properyfilename); 532cdf0e10cSrcweir 533cdf0e10cSrcweir # Setting the component properties saved in %installer::globals::languageproperties 534cdf0e10cSrcweir foreach my $localproperty ( keys %installer::globals::languageproperties ) 535cdf0e10cSrcweir { 536cdf0e10cSrcweir $onepropertyline = $localproperty . "\t" . $installer::globals::languageproperties{$localproperty} . "\n"; 537cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 538cdf0e10cSrcweir } 539cdf0e10cSrcweir 540cdf0e10cSrcweir # Setting the info about multilingual installation in property "isMulti" 541cdf0e10cSrcweir 542cdf0e10cSrcweir my $propertyname = "isMulti"; 543cdf0e10cSrcweir my $ismultivalue = 0; 544cdf0e10cSrcweir 545cdf0e10cSrcweir if ( $installer::globals::ismultilingual ) { $ismultivalue = 1; } 546cdf0e10cSrcweir 547cdf0e10cSrcweir my $onepropertyline = $propertyname . "\t" . $ismultivalue . "\n"; 548cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 549cdf0e10cSrcweir 550cdf0e10cSrcweir # setting the ARPPRODUCTICON 551cdf0e10cSrcweir 552cdf0e10cSrcweir if ($installer::globals::sofficeiconadded) # set in shortcut.pm 553cdf0e10cSrcweir { 554cdf0e10cSrcweir $onepropertyline = "ARPPRODUCTICON" . "\t" . "soffice.ico" . "\n"; 555cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 556cdf0e10cSrcweir } 557cdf0e10cSrcweir 558cdf0e10cSrcweir # Saving the file 559cdf0e10cSrcweir 560cdf0e10cSrcweir installer::files::save_file($properyfilename ,$propertyfile); 561cdf0e10cSrcweir my $infoline = "Added language content into idt file: $properyfilename\n"; 562*b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 563cdf0e10cSrcweir 564cdf0e10cSrcweir} 565cdf0e10cSrcweir 566cdf0e10cSrcweir############################################################ 567cdf0e10cSrcweir# Setting the ProductCode and the UpgradeCode 568cdf0e10cSrcweir# into the Property table. Both have to be stored 569cdf0e10cSrcweir# in the global file $installer::globals::codefilename 570cdf0e10cSrcweir############################################################ 571cdf0e10cSrcweir 572cdf0e10cSrcweirsub set_codes_in_property_table 573cdf0e10cSrcweir{ 574cdf0e10cSrcweir my ($basedir) = @_; 575cdf0e10cSrcweir 576cdf0e10cSrcweir # Reading the property file 577cdf0e10cSrcweir 578cdf0e10cSrcweir my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; 579cdf0e10cSrcweir my $propertyfile = installer::files::read_file($properyfilename); 580cdf0e10cSrcweir 581cdf0e10cSrcweir # Updating the values 582cdf0e10cSrcweir 583cdf0e10cSrcweir for ( my $i = 0; $i <= $#{$propertyfile}; $i++ ) 584cdf0e10cSrcweir { 585cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bPRODUCTCODETEMPLATE\b/$installer::globals::productcode/; 586cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bUPGRADECODETEMPLATE\b/$installer::globals::upgradecode/; 587cdf0e10cSrcweir } 588cdf0e10cSrcweir 589cdf0e10cSrcweir # Saving the property file 590cdf0e10cSrcweir 591cdf0e10cSrcweir installer::files::save_file($properyfilename ,$propertyfile); 592cdf0e10cSrcweir my $infoline = "Added language content into idt file: $properyfilename\n"; 593*b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 594cdf0e10cSrcweir 595cdf0e10cSrcweir} 596cdf0e10cSrcweir 597cdf0e10cSrcweir############################################################ 598cdf0e10cSrcweir# Setting the variable REGKEYPRODPATH, that is used 599cdf0e10cSrcweir# by the language packs. 600cdf0e10cSrcweir############################################################ 601cdf0e10cSrcweir 602cdf0e10cSrcweirsub set_regkeyprodpath_in_property_table 603cdf0e10cSrcweir{ 604cdf0e10cSrcweir my ($basedir, , $allvariables) = @_; 605cdf0e10cSrcweir 606cdf0e10cSrcweir # Reading the property file 607cdf0e10cSrcweir 608cdf0e10cSrcweir my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; 609cdf0e10cSrcweir my $propertyfile = installer::files::read_file($properyfilename); 610cdf0e10cSrcweir 611cdf0e10cSrcweir my $name = $allvariables->{'PRODUCTNAME'}; 612cdf0e10cSrcweir my $version = $allvariables->{'PRODUCTVERSION'}; 613cdf0e10cSrcweir 614cdf0e10cSrcweir my $onepropertyline = "REGKEYPRODPATH" . "\t" . "Software" . "\\" . $installer::globals::manufacturer . "\\". $name; 615cdf0e10cSrcweir 616cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 617cdf0e10cSrcweir 618cdf0e10cSrcweir # Saving the property file 619cdf0e10cSrcweir 620cdf0e10cSrcweir installer::files::save_file($properyfilename ,$propertyfile); 621cdf0e10cSrcweir my $infoline = "Added language content into idt file: $properyfilename\n"; 622*b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 623cdf0e10cSrcweir 624cdf0e10cSrcweir} 625cdf0e10cSrcweir 626cdf0e10cSrcweir############################################################ 627cdf0e10cSrcweir# Changing default for MS file type registration 628cdf0e10cSrcweir# in Beta products. 629cdf0e10cSrcweir############################################################ 630cdf0e10cSrcweir 631cdf0e10cSrcweirsub update_checkbox_table 632cdf0e10cSrcweir{ 633cdf0e10cSrcweir my ($basedir, $allvariables) = @_; 634cdf0e10cSrcweir 635cdf0e10cSrcweir if (( $allvariables->{'PRODUCTEXTENSION'} ) && ( $allvariables->{'PRODUCTEXTENSION'} eq "Beta" )) 636cdf0e10cSrcweir { 637cdf0e10cSrcweir my $checkboxfilename = $basedir . $installer::globals::separator . "CheckBox.idt"; 638cdf0e10cSrcweir 639cdf0e10cSrcweir if ( -f $checkboxfilename ) 640cdf0e10cSrcweir { 641cdf0e10cSrcweir my $checkboxfile = installer::files::read_file($checkboxfilename); 642cdf0e10cSrcweir 643cdf0e10cSrcweir my $checkboxline = "SELECT_WORD" . "\t" . "0" . "\n"; 644cdf0e10cSrcweir push(@{$checkboxfile}, $checkboxline); 645cdf0e10cSrcweir $checkboxline = "SELECT_EXCEL" . "\t" . "0" . "\n"; 646cdf0e10cSrcweir push(@{$checkboxfile}, $checkboxline); 647cdf0e10cSrcweir $checkboxline = "SELECT_POWERPOINT" . "\t" . "0" . "\n"; 648cdf0e10cSrcweir push(@{$checkboxfile}, $checkboxline); 649cdf0e10cSrcweir 650cdf0e10cSrcweir # Saving the property file 651cdf0e10cSrcweir installer::files::save_file($checkboxfilename ,$checkboxfile); 652cdf0e10cSrcweir my $infoline = "Added ms file type defaults into idt file: $checkboxfilename\n"; 653*b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 654cdf0e10cSrcweir } 655cdf0e10cSrcweir } 656cdf0e10cSrcweir} 657cdf0e10cSrcweir 658cdf0e10cSrcweir1; 659