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"; 180b274bc22SAndre 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"; 196b274bc22SAndre 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 211*677600b0SAndre Fischersub set_featurename_properties_for_patch ($) 212cdf0e10cSrcweir{ 213*677600b0SAndre Fischer my ($propertyfile) = @_; 214cdf0e10cSrcweir 215*677600b0SAndre Fischer foreach my $feature_gid (keys %installer::globals::featurecollector) 216cdf0e10cSrcweir { 217*677600b0SAndre Fischer push @$propertyfile, $feature_gid . "\t" . "1" . "\n"; 218cdf0e10cSrcweir } 219cdf0e10cSrcweir} 220cdf0e10cSrcweir 221cdf0e10cSrcweir####################################################### 222cdf0e10cSrcweir# Setting some important properties 223cdf0e10cSrcweir# (for finding the product in deinstallation process) 224cdf0e10cSrcweir####################################################### 225cdf0e10cSrcweir 226cdf0e10cSrcweirsub set_important_properties 227cdf0e10cSrcweir{ 228cdf0e10cSrcweir my ($propertyfile, $allvariables, $languagestringref) = @_; 229cdf0e10cSrcweir 230cdf0e10cSrcweir # Setting new variables with the content of %PRODUCTNAME and %PRODUCTVERSION 231cdf0e10cSrcweir if ( $allvariables->{'PRODUCTNAME'} ) 232cdf0e10cSrcweir { 233cdf0e10cSrcweir my $onepropertyline = "DEFINEDPRODUCT" . "\t" . $allvariables->{'PRODUCTNAME'} . "\n"; 234cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 235cdf0e10cSrcweir } 236cdf0e10cSrcweir 237cdf0e10cSrcweir if ( $allvariables->{'PRODUCTVERSION'} ) 238cdf0e10cSrcweir { 239cdf0e10cSrcweir my $onepropertyline = "DEFINEDVERSION" . "\t" . $allvariables->{'PRODUCTVERSION'} . "\n"; 240cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 241cdf0e10cSrcweir } 242cdf0e10cSrcweir 243cdf0e10cSrcweir if (( $allvariables->{'PRODUCTNAME'} ) && ( $allvariables->{'PRODUCTVERSION'} ) && ( $allvariables->{'MANUFACTURER'} ) && ( $allvariables->{'PRODUCTCODE'} )) 244cdf0e10cSrcweir { 245cdf0e10cSrcweir my $onepropertyline = "FINDPRODUCT" . "\t" . "Software\\" . $allvariables->{'MANUFACTURER'} . "\\" . $allvariables->{'PRODUCTNAME'} . $allvariables->{'PRODUCTADDON'} . "\\" . $allvariables->{'PRODUCTVERSION'} . "\\" . $allvariables->{'PRODUCTCODE'} . "\n"; 246cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 247cdf0e10cSrcweir } 248cdf0e10cSrcweir 249cdf0e10cSrcweir if ( $allvariables->{'PRODUCTMAJOR'} ) 250cdf0e10cSrcweir { 251cdf0e10cSrcweir my $onepropertyline = "PRODUCTMAJOR" . "\t" . $allvariables->{'PRODUCTMAJOR'} . "\n"; 252cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 253cdf0e10cSrcweir } 254cdf0e10cSrcweir 255cdf0e10cSrcweir if ( $allvariables->{'PRODUCTMINOR'} ) 256cdf0e10cSrcweir { 257cdf0e10cSrcweir my $onepropertyline = "PRODUCTMINOR" . "\t" . $allvariables->{'PRODUCTMINOR'} . "\n"; 258cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 259cdf0e10cSrcweir } 260cdf0e10cSrcweir 261cdf0e10cSrcweir if ( $allvariables->{'PRODUCTBUILDID'} ) 262cdf0e10cSrcweir { 263cdf0e10cSrcweir my $onepropertyline = "PRODUCTBUILDID" . "\t" . $allvariables->{'PRODUCTBUILDID'} . "\n"; 264cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 265cdf0e10cSrcweir } 266cdf0e10cSrcweir 267cdf0e10cSrcweir if ( $allvariables->{'OOOBASEVERSION'} ) 268cdf0e10cSrcweir { 269cdf0e10cSrcweir my $onepropertyline = "OOOBASEVERSION" . "\t" . $allvariables->{'OOOBASEVERSION'} . "\n"; 270cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 271cdf0e10cSrcweir } 272cdf0e10cSrcweir 273cdf0e10cSrcweir if ( $allvariables->{'URELAYERVERSION'} ) 274cdf0e10cSrcweir { 275cdf0e10cSrcweir my $onepropertyline = "URELAYERVERSION" . "\t" . $allvariables->{'URELAYERVERSION'} . "\n"; 276cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 277cdf0e10cSrcweir } 278cdf0e10cSrcweir 279cdf0e10cSrcweir if ( $allvariables->{'BRANDPACKAGEVERSION'} ) 280cdf0e10cSrcweir { 281cdf0e10cSrcweir my $onepropertyline = "BRANDPACKAGEVERSION" . "\t" . $allvariables->{'BRANDPACKAGEVERSION'} . "\n"; 282cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 283cdf0e10cSrcweir } 284cdf0e10cSrcweir 285cdf0e10cSrcweir if ( $allvariables->{'BASISROOTNAME'} ) 286cdf0e10cSrcweir { 287cdf0e10cSrcweir my $onepropertyline = "BASISROOTNAME" . "\t" . $allvariables->{'BASISROOTNAME'} . "\n"; 288cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 289cdf0e10cSrcweir } 290cdf0e10cSrcweir 291cdf0e10cSrcweir if ( $allvariables->{'EXCLUDE_FROM_REBASE'} ) 292cdf0e10cSrcweir { 293cdf0e10cSrcweir my $onepropertyline = "EXCLUDE_FROM_REBASE" . "\t" . $allvariables->{'EXCLUDE_FROM_REBASE'} . "\n"; 294cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 295cdf0e10cSrcweir } 296cdf0e10cSrcweir 297cdf0e10cSrcweir if ( $allvariables->{'PREREQUIREDPATCH'} ) 298cdf0e10cSrcweir { 299cdf0e10cSrcweir my $onepropertyline = "PREREQUIREDPATCH" . "\t" . $allvariables->{'PREREQUIREDPATCH'} . "\n"; 300cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 301cdf0e10cSrcweir } 302cdf0e10cSrcweir 303cdf0e10cSrcweir my $onepropertyline = "IGNOREPREREQUIREDPATCH" . "\t" . "1" . "\n"; 304cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 305cdf0e10cSrcweir 306cdf0e10cSrcweir $onepropertyline = "DONTOPTIMIZELIBS" . "\t" . "0" . "\n"; 307cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 308cdf0e10cSrcweir 309cdf0e10cSrcweir if ( $installer::globals::officedirhostname ) 310cdf0e10cSrcweir { 311cdf0e10cSrcweir my $onepropertyline = "OFFICEDIRHOSTNAME" . "\t" . $installer::globals::officedirhostname . "\n"; 312cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 313cdf0e10cSrcweir 314cdf0e10cSrcweir my $localofficedirhostname = $installer::globals::officedirhostname; 315cdf0e10cSrcweir $localofficedirhostname =~ s/\//\\/g; 316cdf0e10cSrcweir $onepropertyline = "OFFICEDIRHOSTNAME_" . "\t" . $localofficedirhostname . "\n"; 317cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 318cdf0e10cSrcweir } 319cdf0e10cSrcweir 320cdf0e10cSrcweir if ( $installer::globals::desktoplinkexists ) 321cdf0e10cSrcweir { 322cdf0e10cSrcweir my $onepropertyline = "DESKTOPLINKEXISTS" . "\t" . "1" . "\n"; 323cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 324cdf0e10cSrcweir 325cdf0e10cSrcweir $onepropertyline = "CREATEDESKTOPLINK" . "\t" . "1" . "\n"; # Setting the default 326cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 327cdf0e10cSrcweir } 328cdf0e10cSrcweir 329cdf0e10cSrcweir if ( $installer::globals::patch ) 330cdf0e10cSrcweir { 331cdf0e10cSrcweir my $onepropertyline = "ISPATCH" . "\t" . "1" . "\n"; 332cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 333cdf0e10cSrcweir 334cdf0e10cSrcweir $onepropertyline = "SETUP_USED" . "\t" . "0" . "\n"; 335cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 336cdf0e10cSrcweir } 337cdf0e10cSrcweir 338cdf0e10cSrcweir if ( $installer::globals::languagepack ) 339cdf0e10cSrcweir { 340cdf0e10cSrcweir my $onepropertyline = "ISLANGUAGEPACK" . "\t" . "1" . "\n"; 341cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 342cdf0e10cSrcweir } 343cdf0e10cSrcweir 344cdf0e10cSrcweir my $languagesline = "PRODUCTALLLANGUAGES" . "\t" . $$languagestringref . "\n"; 345cdf0e10cSrcweir push(@{$propertyfile}, $languagesline); 346cdf0e10cSrcweir 347cdf0e10cSrcweir if (( $allvariables->{'PRODUCTEXTENSION'} ) && ( $allvariables->{'PRODUCTEXTENSION'} eq "Beta" )) 348cdf0e10cSrcweir { 349cdf0e10cSrcweir # my $registryline = "WRITE_REGISTRY" . "\t" . "0" . "\n"; 350cdf0e10cSrcweir # push(@{$propertyfile}, $registryline); 351cdf0e10cSrcweir my $betainfoline = "BETAPRODUCT" . "\t" . "1" . "\n"; 352cdf0e10cSrcweir push(@{$propertyfile}, $betainfoline); 353cdf0e10cSrcweir } 354cdf0e10cSrcweir elsif ( $allvariables->{'DEVELOPMENTPRODUCT'} ) 355cdf0e10cSrcweir { 356cdf0e10cSrcweir my $registryline = "WRITE_REGISTRY" . "\t" . "0" . "\n"; 357cdf0e10cSrcweir push(@{$propertyfile}, $registryline); 358cdf0e10cSrcweir } 359cdf0e10cSrcweir else 360cdf0e10cSrcweir { 361cdf0e10cSrcweir my $registryline = "WRITE_REGISTRY" . "\t" . "1" . "\n"; # Default: Write complete registry 362cdf0e10cSrcweir push(@{$propertyfile}, $registryline); 363cdf0e10cSrcweir } 364cdf0e10cSrcweir 365cdf0e10cSrcweir # Adding also used tree conditions for multilayer products. 366cdf0e10cSrcweir # These are saved in %installer::globals::usedtreeconditions 367cdf0e10cSrcweir foreach my $treecondition (keys %installer::globals::usedtreeconditions) 368cdf0e10cSrcweir { 369cdf0e10cSrcweir my $onepropertyline = $treecondition . "\t" . "1" . "\n"; 370cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 371cdf0e10cSrcweir } 372cdf0e10cSrcweir 373cdf0e10cSrcweir # No more license dialog for selected products 374cdf0e10cSrcweir if ( $allvariables->{'HIDELICENSEDIALOG'} ) 375cdf0e10cSrcweir { 376cdf0e10cSrcweir my $onepropertyline = "HIDEEULA" . "\t" . "1" . "\n"; 377cdf0e10cSrcweir 378cdf0e10cSrcweir my $already_defined = 0; 379cdf0e10cSrcweir 380cdf0e10cSrcweir for ( my $i = 0; $i <= $#{$propertyfile}; $i++ ) 381cdf0e10cSrcweir { 382cdf0e10cSrcweir if ( ${$propertyfile}[$i] =~ /^\s*HIDEEULA\t/ ) 383cdf0e10cSrcweir { 384cdf0e10cSrcweir ${$propertyfile}[$i] = $onepropertyline; 385cdf0e10cSrcweir $already_defined = 1; 386cdf0e10cSrcweir last; 387cdf0e10cSrcweir } 388cdf0e10cSrcweir } 389cdf0e10cSrcweir 390cdf0e10cSrcweir if ( ! $already_defined ) 391cdf0e10cSrcweir { 392cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 393cdf0e10cSrcweir } 394cdf0e10cSrcweir } 395cdf0e10cSrcweir 396cdf0e10cSrcweir # Setting .NET requirements 397cdf0e10cSrcweir if ( $installer::globals::required_dotnet_version ne "" ) 398cdf0e10cSrcweir { 399cdf0e10cSrcweir my $onepropertyline = "REQUIRED_DOTNET_VERSION" . "\t" . $installer::globals::required_dotnet_version . "\n"; 400cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 401cdf0e10cSrcweir 402cdf0e10cSrcweir $onepropertyline = "DOTNET_SUFFICIENT" . "\t" . "1" . "\n"; # default value for found .NET 403cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 404cdf0e10cSrcweir } 405cdf0e10cSrcweir 406cdf0e10cSrcweir} 407cdf0e10cSrcweir 408cdf0e10cSrcweir####################################################### 409cdf0e10cSrcweir# Setting properties needed for ms file type registration 410cdf0e10cSrcweir####################################################### 411cdf0e10cSrcweir 412cdf0e10cSrcweirsub set_ms_file_types_properties 413cdf0e10cSrcweir{ 414cdf0e10cSrcweir my ($propertyfile) = @_; 415cdf0e10cSrcweir 416cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPS" . "\t" . "0" . "\n"); 417cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPSX" . "\t" . "0" . "\n"); 418cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPSM" . "\t" . "0" . "\n"); 419cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPAM" . "\t" . "0" . "\n"); 420cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPT" . "\t" . "0" . "\n"); 421cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPTX" . "\t" . "0" . "\n"); 422cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_PPTM" . "\t" . "0" . "\n"); 423cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_POT" . "\t" . "0" . "\n"); 424cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_POTX" . "\t" . "0" . "\n"); 425cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_POTM" . "\t" . "0" . "\n"); 426cdf0e10cSrcweir 427cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOC" . "\t" . "0" . "\n"); 428cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOCX" . "\t" . "0" . "\n"); 429cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOCM" . "\t" . "0" . "\n"); 430cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOT" . "\t" . "0" . "\n"); 431cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOTX" . "\t" . "0" . "\n"); 432cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_DOTM" . "\t" . "0" . "\n"); 433cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_RTF" . "\t" . "0" . "\n"); 434cdf0e10cSrcweir 435cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLS" . "\t" . "0" . "\n"); 436cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLSX" . "\t" . "0" . "\n"); 437cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLSM" . "\t" . "0" . "\n"); 438cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLSB" . "\t" . "0" . "\n"); 439cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLAM" . "\t" . "0" . "\n"); 440cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLT" . "\t" . "0" . "\n"); 441cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLTX" . "\t" . "0" . "\n"); 442cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_XLTM" . "\t" . "0" . "\n"); 443cdf0e10cSrcweir 444cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_NO_MSO_TYPES" . "\t" . "0" . "\n"); 445cdf0e10cSrcweir push(@{$propertyfile}, "REGISTER_ALL_MSO_TYPES" . "\t" . "0" . "\n"); 446cdf0e10cSrcweir} 447cdf0e10cSrcweir 448cdf0e10cSrcweir#################################################################################### 449cdf0e10cSrcweir# Updating the file Property.idt dynamically 450cdf0e10cSrcweir# Content: 451cdf0e10cSrcweir# Property Value 452cdf0e10cSrcweir#################################################################################### 453cdf0e10cSrcweir 454cdf0e10cSrcweirsub update_property_table 455cdf0e10cSrcweir{ 456cdf0e10cSrcweir my ($basedir, $language, $allvariables, $languagestringref) = @_; 457cdf0e10cSrcweir 458cdf0e10cSrcweir my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; 459cdf0e10cSrcweir 460cdf0e10cSrcweir my $propertyfile = installer::files::read_file($properyfilename); 461cdf0e10cSrcweir 462cdf0e10cSrcweir # Getting the new values 463cdf0e10cSrcweir # Some values (arpcomments, arpcontacts, ...) are inserted from the Property.mlf 464cdf0e10cSrcweir 465cdf0e10cSrcweir my $arpcomments = get_arpcomments_for_property_table($allvariables, $languagestringref); 466cdf0e10cSrcweir my $installlevel = get_installlevel_for_property_table(); 467cdf0e10cSrcweir my $ischeckforproductupdates = get_ischeckforproductupdates_for_property_table(); 468a6a1cc63SJürgen Schmidt my $manufacturer = $allvariables->{'OOOVENDOR'}; 469cdf0e10cSrcweir my $productlanguage = get_productlanguage_for_property_table($language); 470cdf0e10cSrcweir my $productname = get_productname_for_property_table($allvariables); 471cdf0e10cSrcweir my $productversion = get_productversion_for_property_table(); 472cdf0e10cSrcweir my $quickstarterlinkname = get_quickstarterlinkname_for_property_table($allvariables); 473cdf0e10cSrcweir 474cdf0e10cSrcweir # Updating the values 475cdf0e10cSrcweir 476cdf0e10cSrcweir for ( my $i = 0; $i <= $#{$propertyfile}; $i++ ) 477cdf0e10cSrcweir { 478cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bARPCOMMENTSTEMPLATE\b/$arpcomments/; 479cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bINSTALLLEVELTEMPLATE\b/$installlevel/; 480cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bISCHECKFORPRODUCTUPDATESTEMPLATE\b/$ischeckforproductupdates/; 481cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bMANUFACTURERTEMPLATE\b/$manufacturer/; 482cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bPRODUCTLANGUAGETEMPLATE\b/$productlanguage/; 483cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bPRODUCTNAMETEMPLATE\b/$productname/; 484cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bPRODUCTVERSIONTEMPLATE\b/$productversion/; 485cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bQUICKSTARTERLINKNAMETEMPLATE\b/$quickstarterlinkname/; 486cdf0e10cSrcweir } 487cdf0e10cSrcweir 488cdf0e10cSrcweir # Setting variables into propertytable 489cdf0e10cSrcweir set_important_properties($propertyfile, $allvariables, $languagestringref); 490cdf0e10cSrcweir 491cdf0e10cSrcweir # Setting feature names as properties for Windows patch mechanism 492cdf0e10cSrcweir if ( $installer::globals::patch ) { set_featurename_properties_for_patch($propertyfile); } 493cdf0e10cSrcweir 494cdf0e10cSrcweir # Setting variables for register for ms file types 495cdf0e10cSrcweir set_ms_file_types_properties($propertyfile); 496cdf0e10cSrcweir 497cdf0e10cSrcweir # Saving the file 498cdf0e10cSrcweir 499cdf0e10cSrcweir installer::files::save_file($properyfilename ,$propertyfile); 500cdf0e10cSrcweir my $infoline = "Updated idt file: $properyfilename\n"; 501b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 502cdf0e10cSrcweir 503cdf0e10cSrcweir} 504cdf0e10cSrcweir 505cdf0e10cSrcweir#################################################################################### 506cdf0e10cSrcweir# Setting language specific Properties in file Property.idt dynamically 507cdf0e10cSrcweir# Adding: 508cdf0e10cSrcweir# is1033 = 1 509cdf0e10cSrcweir# isMulti = 1 510cdf0e10cSrcweir#################################################################################### 511cdf0e10cSrcweir 512cdf0e10cSrcweirsub set_languages_in_property_table 513cdf0e10cSrcweir{ 514cdf0e10cSrcweir my ($basedir, $languagesarrayref) = @_; 515cdf0e10cSrcweir 516cdf0e10cSrcweir my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; 517cdf0e10cSrcweir my $propertyfile = installer::files::read_file($properyfilename); 518cdf0e10cSrcweir 519cdf0e10cSrcweir # Setting the component properties saved in %installer::globals::languageproperties 520cdf0e10cSrcweir foreach my $localproperty ( keys %installer::globals::languageproperties ) 521cdf0e10cSrcweir { 522cdf0e10cSrcweir $onepropertyline = $localproperty . "\t" . $installer::globals::languageproperties{$localproperty} . "\n"; 523cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 524cdf0e10cSrcweir } 525cdf0e10cSrcweir 526cdf0e10cSrcweir # Setting the info about multilingual installation in property "isMulti" 527cdf0e10cSrcweir 528cdf0e10cSrcweir my $propertyname = "isMulti"; 529cdf0e10cSrcweir my $ismultivalue = 0; 530cdf0e10cSrcweir 531cdf0e10cSrcweir if ( $installer::globals::ismultilingual ) { $ismultivalue = 1; } 532cdf0e10cSrcweir 533cdf0e10cSrcweir my $onepropertyline = $propertyname . "\t" . $ismultivalue . "\n"; 534cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 535cdf0e10cSrcweir 536cdf0e10cSrcweir # setting the ARPPRODUCTICON 537cdf0e10cSrcweir 538cdf0e10cSrcweir if ($installer::globals::sofficeiconadded) # set in shortcut.pm 539cdf0e10cSrcweir { 540cdf0e10cSrcweir $onepropertyline = "ARPPRODUCTICON" . "\t" . "soffice.ico" . "\n"; 541cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 542cdf0e10cSrcweir } 543cdf0e10cSrcweir 544cdf0e10cSrcweir # Saving the file 545cdf0e10cSrcweir 546cdf0e10cSrcweir installer::files::save_file($properyfilename ,$propertyfile); 547cdf0e10cSrcweir my $infoline = "Added language content into idt file: $properyfilename\n"; 548b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 549cdf0e10cSrcweir 550cdf0e10cSrcweir} 551cdf0e10cSrcweir 552cdf0e10cSrcweir############################################################ 553cdf0e10cSrcweir# Setting the ProductCode and the UpgradeCode 554cdf0e10cSrcweir# into the Property table. Both have to be stored 555cdf0e10cSrcweir# in the global file $installer::globals::codefilename 556cdf0e10cSrcweir############################################################ 557cdf0e10cSrcweir 558cdf0e10cSrcweirsub set_codes_in_property_table 559cdf0e10cSrcweir{ 560cdf0e10cSrcweir my ($basedir) = @_; 561cdf0e10cSrcweir 562cdf0e10cSrcweir # Reading the property file 563cdf0e10cSrcweir 564cdf0e10cSrcweir my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; 565cdf0e10cSrcweir my $propertyfile = installer::files::read_file($properyfilename); 566cdf0e10cSrcweir 567cdf0e10cSrcweir # Updating the values 568cdf0e10cSrcweir 569cdf0e10cSrcweir for ( my $i = 0; $i <= $#{$propertyfile}; $i++ ) 570cdf0e10cSrcweir { 571cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bPRODUCTCODETEMPLATE\b/$installer::globals::productcode/; 572cdf0e10cSrcweir ${$propertyfile}[$i] =~ s/\bUPGRADECODETEMPLATE\b/$installer::globals::upgradecode/; 573cdf0e10cSrcweir } 574cdf0e10cSrcweir 575cdf0e10cSrcweir # Saving the property file 576cdf0e10cSrcweir 577cdf0e10cSrcweir installer::files::save_file($properyfilename ,$propertyfile); 578cdf0e10cSrcweir my $infoline = "Added language content into idt file: $properyfilename\n"; 579b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 580cdf0e10cSrcweir 581cdf0e10cSrcweir} 582cdf0e10cSrcweir 583cdf0e10cSrcweir############################################################ 584cdf0e10cSrcweir# Setting the variable REGKEYPRODPATH, that is used 585cdf0e10cSrcweir# by the language packs. 586cdf0e10cSrcweir############################################################ 587cdf0e10cSrcweir 588cdf0e10cSrcweirsub set_regkeyprodpath_in_property_table 589cdf0e10cSrcweir{ 590cdf0e10cSrcweir my ($basedir, , $allvariables) = @_; 591cdf0e10cSrcweir 592cdf0e10cSrcweir # Reading the property file 593cdf0e10cSrcweir 594cdf0e10cSrcweir my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; 595cdf0e10cSrcweir my $propertyfile = installer::files::read_file($properyfilename); 596cdf0e10cSrcweir 597cdf0e10cSrcweir my $name = $allvariables->{'PRODUCTNAME'}; 598cdf0e10cSrcweir my $version = $allvariables->{'PRODUCTVERSION'}; 599cdf0e10cSrcweir 600cdf0e10cSrcweir my $onepropertyline = "REGKEYPRODPATH" . "\t" . "Software" . "\\" . $installer::globals::manufacturer . "\\". $name; 601cdf0e10cSrcweir 602cdf0e10cSrcweir push(@{$propertyfile}, $onepropertyline); 603cdf0e10cSrcweir 604cdf0e10cSrcweir # Saving the property file 605cdf0e10cSrcweir 606cdf0e10cSrcweir installer::files::save_file($properyfilename ,$propertyfile); 607cdf0e10cSrcweir my $infoline = "Added language content into idt file: $properyfilename\n"; 608b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 609cdf0e10cSrcweir 610cdf0e10cSrcweir} 611cdf0e10cSrcweir 612cdf0e10cSrcweir############################################################ 613cdf0e10cSrcweir# Changing default for MS file type registration 614cdf0e10cSrcweir# in Beta products. 615cdf0e10cSrcweir############################################################ 616cdf0e10cSrcweir 617cdf0e10cSrcweirsub update_checkbox_table 618cdf0e10cSrcweir{ 619cdf0e10cSrcweir my ($basedir, $allvariables) = @_; 620cdf0e10cSrcweir 621cdf0e10cSrcweir if (( $allvariables->{'PRODUCTEXTENSION'} ) && ( $allvariables->{'PRODUCTEXTENSION'} eq "Beta" )) 622cdf0e10cSrcweir { 623cdf0e10cSrcweir my $checkboxfilename = $basedir . $installer::globals::separator . "CheckBox.idt"; 624cdf0e10cSrcweir 625cdf0e10cSrcweir if ( -f $checkboxfilename ) 626cdf0e10cSrcweir { 627cdf0e10cSrcweir my $checkboxfile = installer::files::read_file($checkboxfilename); 628cdf0e10cSrcweir 629cdf0e10cSrcweir my $checkboxline = "SELECT_WORD" . "\t" . "0" . "\n"; 630cdf0e10cSrcweir push(@{$checkboxfile}, $checkboxline); 631cdf0e10cSrcweir $checkboxline = "SELECT_EXCEL" . "\t" . "0" . "\n"; 632cdf0e10cSrcweir push(@{$checkboxfile}, $checkboxline); 633cdf0e10cSrcweir $checkboxline = "SELECT_POWERPOINT" . "\t" . "0" . "\n"; 634cdf0e10cSrcweir push(@{$checkboxfile}, $checkboxline); 635cdf0e10cSrcweir 636cdf0e10cSrcweir # Saving the property file 637cdf0e10cSrcweir installer::files::save_file($checkboxfilename ,$checkboxfile); 638cdf0e10cSrcweir my $infoline = "Added ms file type defaults into idt file: $checkboxfilename\n"; 639b274bc22SAndre Fischer $installer::logger::Lang->print($infoline); 640cdf0e10cSrcweir } 641cdf0e10cSrcweir } 642cdf0e10cSrcweir} 643cdf0e10cSrcweir 644cdf0e10cSrcweir1; 645