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