1#************************************************************************* 2# 3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4# 5# Copyright 2000, 2010 Oracle and/or its affiliates. 6# 7# OpenOffice.org - a multi-platform office productivity suite 8# 9# This file is part of OpenOffice.org. 10# 11# OpenOffice.org is free software: you can redistribute it and/or modify 12# it under the terms of the GNU Lesser General Public License version 3 13# only, as published by the Free Software Foundation. 14# 15# OpenOffice.org is distributed in the hope that it will be useful, 16# but WITHOUT ANY WARRANTY; without even the implied warranty of 17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18# GNU Lesser General Public License version 3 for more details 19# (a copy is included in the LICENSE file that accompanied this code). 20# 21# You should have received a copy of the GNU Lesser General Public License 22# version 3 along with OpenOffice.org. If not, see 23# <http://www.openoffice.org/license.html> 24# for a copy of the LGPLv3 License. 25# 26#************************************************************************* 27 28package installer::windows::property; 29 30use installer::exiter; 31use installer::files; 32use installer::globals; 33use installer::windows::idtglobal; 34use installer::windows::language; 35 36############################################# 37# Setting the properties dynamically 38# for the table Property.idt 39############################################# 40 41sub get_arpcomments_for_property_table 42{ 43 my ( $allvariables, $languagestringref ) = @_; 44 45 my $name = $allvariables->{'PRODUCTNAME'}; 46 my $version = $allvariables->{'PRODUCTVERSION'}; 47 my $comment = $name . " " . $version; 48 49 my $postversionextension = ""; 50 if ( $allvariables->{'POSTVERSIONEXTENSION'} ) 51 { 52 $postversionextension = $allvariables->{'POSTVERSIONEXTENSION'}; 53 $comment = $comment . " " . $postversionextension; 54 } 55 56 if ( $installer::globals::languagepack ) { $comment = $comment . " " . "Language Pack"; } 57 58 if ( $installer::globals::patch ) 59 { 60 if ( ! $allvariables->{'WINDOWSPATCHLEVEL'} ) { installer::exiter::exit_program("ERROR: No Patch level defined for Windows patch: WINDOWSPATCHLEVEL", "get_arpcomments_for_property_table"); } 61 my $patchstring = "Product Update" . " " . $allvariables->{'WINDOWSPATCHLEVEL'}; 62 $comment = $comment . " " . $patchstring; 63 } 64 65 my $languagestring = $$languagestringref; 66 $languagestring =~ s/\_/\,/g; 67 68 $comment = $comment . " ($languagestring)"; 69 70 my $localminor = ""; 71 if ( $installer::globals::updatepack ) { $localminor = $installer::globals::lastminor; } 72 else { $localminor = $installer::globals::minor; } 73 74 my $buildidstring = "(" . $installer::globals::build . $localminor . "(Build:" . $installer::globals::buildid . "))"; 75 76 # the environment variable CWS_WORK_STAMP is set only in CWS 77 if ( $ENV{'CWS_WORK_STAMP'} ) { $buildidstring = $buildidstring . "\[CWS\:" . $ENV{'CWS_WORK_STAMP'} . "\]"; } 78 79 $comment = $comment . " " . $buildidstring; 80 81 return $comment; 82} 83 84sub get_installlevel_for_property_table 85{ 86 my $installlevel = "100"; 87 return $installlevel; 88} 89 90sub get_ischeckforproductupdates_for_property_table 91{ 92 my $ischeckforproductupdates = "1"; 93 return $ischeckforproductupdates; 94} 95 96sub get_manufacturer_for_property_table 97{ 98 return $installer::globals::manufacturer; 99} 100 101sub get_productlanguage_for_property_table 102{ 103 my ($language) = @_; 104 my $windowslanguage = installer::windows::language::get_windows_language($language); 105 return $windowslanguage; 106} 107 108sub get_language_string 109{ 110 my $langstring = ""; 111 112 for ( my $i = 0; $i <= $#installer::globals::languagenames; $i++ ) 113 { 114 $langstring = $langstring . $installer::globals::languagenames[$i] . ", "; 115 } 116 117 $langstring =~ s/\,\s*$//; 118 $langstring = "(" . $langstring . ")"; 119 120 return $langstring; 121} 122 123sub get_english_language_string 124{ 125 my $langstring = ""; 126 127 # Sorting value not keys, therefore collecting all values 128 my %helper = (); 129 foreach my $lang ( keys %installer::globals::all_required_english_languagestrings ) 130 { 131 $helper{$installer::globals::all_required_english_languagestrings{$lang}} = 1; 132 } 133 134 foreach my $lang ( sort keys %helper ) 135 { 136 $langstring = $langstring . $lang . ", "; 137 } 138 139 $langstring =~ s/\,\s*$//; 140 $langstring = "(" . $langstring . ")"; 141 142 return $langstring; 143} 144 145sub get_productname_for_property_table 146{ 147 my ( $allvariables ) = @_; 148 149 my $name = $allvariables->{'PRODUCTNAME'}; 150 my $version = $allvariables->{'PRODUCTVERSION'}; 151 my $productname = $name . " " . $version; 152 153 my $postversionextension = ""; 154 if ( $allvariables->{'POSTVERSIONEXTENSION'} ) 155 { 156 $postversionextension = $allvariables->{'POSTVERSIONEXTENSION'}; 157 $productname = $productname . " " . $postversionextension; 158 } 159 160 my $productextension = ""; 161 if ( $allvariables->{'PRODUCTEXTENSION'} ) 162 { 163 $productextension = $allvariables->{'PRODUCTEXTENSION'}; 164 $productname = $productname . " " . $productextension; 165 } 166 167 if ( $installer::globals::languagepack ) 168 { 169 # my $langstring = get_language_string(); # Example (English, Deutsch) 170 my $langstring = get_english_language_string(); # New: (English, German) 171 $productname = $name . " " . $version . " Language Pack" . " " . $langstring; 172 } 173 174 if ( $installer::globals::patch ) 175 { 176 if ( ! $allvariables->{'WINDOWSPATCHLEVEL'} ) { installer::exiter::exit_program("ERROR: No Patch level defined for Windows patch: WINDOWSPATCHLEVEL", "get_productname_for_property_table"); } 177 my $patchstring = "Product Update" . " " . $allvariables->{'WINDOWSPATCHLEVEL'}; 178 $productname = $productname . " " . $patchstring; 179 } 180 181 # Saving this name in hash $allvariables for further usage 182 $allvariables->{'PROPERTYTABLEPRODUCTNAME'} = $productname; 183 my $infoline = "Defined variable PROPERTYTABLEPRODUCTNAME: $productname\n"; 184 push(@installer::globals::logfileinfo, $infoline); 185 186 return $productname; 187} 188 189sub get_quickstarterlinkname_for_property_table 190{ 191 my ( $allvariables ) = @_; 192 193 # no usage of POSTVERSIONEXTENSION for Quickstarter link name! 194 195 my $name = $allvariables->{'PRODUCTNAME'}; 196 my $version = $allvariables->{'PRODUCTVERSION'}; 197 my $quickstartername = $name . " " . $version; 198 199 my $infoline = "Defined Quickstarter Link name: $quickstartername\n"; 200 push(@installer::globals::logfileinfo, $infoline); 201 202 return $quickstartername; 203} 204 205sub get_productversion_for_property_table 206{ 207 return $installer::globals::msiproductversion; 208} 209 210####################################################### 211# Setting all feature names as Properties. This is 212# required for the Windows patch process. 213####################################################### 214 215sub set_featurename_properties_for_patch 216{ 217 ($propertyfile) = @_; 218 219 for ( my $i = 0; $i <= $#installer::globals::featurecollector; $i++ ) 220 { 221 my $onepropertyline = $installer::globals::featurecollector[$i] . "\t" . "1" . "\n"; 222 push(@{$propertyfile}, $onepropertyline); 223 } 224 225} 226 227####################################################### 228# Setting some important properties 229# (for finding the product in deinstallation process) 230####################################################### 231 232sub set_important_properties 233{ 234 my ($propertyfile, $allvariables, $languagestringref) = @_; 235 236 # Setting new variables with the content of %PRODUCTNAME and %PRODUCTVERSION 237 if ( $allvariables->{'PRODUCTNAME'} ) 238 { 239 my $onepropertyline = "DEFINEDPRODUCT" . "\t" . $allvariables->{'PRODUCTNAME'} . "\n"; 240 push(@{$propertyfile}, $onepropertyline); 241 } 242 243 if ( $allvariables->{'PRODUCTVERSION'} ) 244 { 245 my $onepropertyline = "DEFINEDVERSION" . "\t" . $allvariables->{'PRODUCTVERSION'} . "\n"; 246 push(@{$propertyfile}, $onepropertyline); 247 } 248 249 if (( $allvariables->{'PRODUCTNAME'} ) && ( $allvariables->{'PRODUCTVERSION'} ) && ( $allvariables->{'MANUFACTURER'} ) && ( $allvariables->{'PRODUCTCODE'} )) 250 { 251 my $onepropertyline = "FINDPRODUCT" . "\t" . "Software\\" . $allvariables->{'MANUFACTURER'} . "\\" . $allvariables->{'PRODUCTNAME'} . $allvariables->{'PRODUCTADDON'} . "\\" . $allvariables->{'PRODUCTVERSION'} . "\\" . $allvariables->{'PRODUCTCODE'} . "\n"; 252 push(@{$propertyfile}, $onepropertyline); 253 } 254 255 if ( $allvariables->{'PRODUCTMAJOR'} ) 256 { 257 my $onepropertyline = "PRODUCTMAJOR" . "\t" . $allvariables->{'PRODUCTMAJOR'} . "\n"; 258 push(@{$propertyfile}, $onepropertyline); 259 } 260 261 if ( $allvariables->{'PRODUCTMINOR'} ) 262 { 263 my $onepropertyline = "PRODUCTMINOR" . "\t" . $allvariables->{'PRODUCTMINOR'} . "\n"; 264 push(@{$propertyfile}, $onepropertyline); 265 } 266 267 if ( $allvariables->{'PRODUCTBUILDID'} ) 268 { 269 my $onepropertyline = "PRODUCTBUILDID" . "\t" . $allvariables->{'PRODUCTBUILDID'} . "\n"; 270 push(@{$propertyfile}, $onepropertyline); 271 } 272 273 if ( $allvariables->{'OOOBASEVERSION'} ) 274 { 275 my $onepropertyline = "OOOBASEVERSION" . "\t" . $allvariables->{'OOOBASEVERSION'} . "\n"; 276 push(@{$propertyfile}, $onepropertyline); 277 } 278 279 if ( $allvariables->{'URELAYERVERSION'} ) 280 { 281 my $onepropertyline = "URELAYERVERSION" . "\t" . $allvariables->{'URELAYERVERSION'} . "\n"; 282 push(@{$propertyfile}, $onepropertyline); 283 } 284 285 if ( $allvariables->{'BRANDPACKAGEVERSION'} ) 286 { 287 my $onepropertyline = "BRANDPACKAGEVERSION" . "\t" . $allvariables->{'BRANDPACKAGEVERSION'} . "\n"; 288 push(@{$propertyfile}, $onepropertyline); 289 } 290 291 if ( $allvariables->{'BASISROOTNAME'} ) 292 { 293 my $onepropertyline = "BASISROOTNAME" . "\t" . $allvariables->{'BASISROOTNAME'} . "\n"; 294 push(@{$propertyfile}, $onepropertyline); 295 } 296 297 if ( $allvariables->{'EXCLUDE_FROM_REBASE'} ) 298 { 299 my $onepropertyline = "EXCLUDE_FROM_REBASE" . "\t" . $allvariables->{'EXCLUDE_FROM_REBASE'} . "\n"; 300 push(@{$propertyfile}, $onepropertyline); 301 } 302 303 if ( $allvariables->{'PREREQUIREDPATCH'} ) 304 { 305 my $onepropertyline = "PREREQUIREDPATCH" . "\t" . $allvariables->{'PREREQUIREDPATCH'} . "\n"; 306 push(@{$propertyfile}, $onepropertyline); 307 } 308 309 my $onepropertyline = "IGNOREPREREQUIREDPATCH" . "\t" . "1" . "\n"; 310 push(@{$propertyfile}, $onepropertyline); 311 312 $onepropertyline = "DONTOPTIMIZELIBS" . "\t" . "0" . "\n"; 313 push(@{$propertyfile}, $onepropertyline); 314 315 if ( $installer::globals::sundirexists ) 316 { 317 my $onepropertyline = "SUNDIREXISTS" . "\t" . "1" . "\n"; 318 push(@{$propertyfile}, $onepropertyline); 319 } 320 321 if ( $installer::globals::officedirhostname ) 322 { 323 my $onepropertyline = "OFFICEDIRHOSTNAME" . "\t" . $installer::globals::officedirhostname . "\n"; 324 push(@{$propertyfile}, $onepropertyline); 325 326 my $localofficedirhostname = $installer::globals::officedirhostname; 327 $localofficedirhostname =~ s/\//\\/g; 328 $onepropertyline = "OFFICEDIRHOSTNAME_" . "\t" . $localofficedirhostname . "\n"; 329 push(@{$propertyfile}, $onepropertyline); 330 } 331 332 if ( $installer::globals::sundirhostname ) 333 { 334 my $onepropertyline = "SUNDIRHOSTNAME" . "\t" . $installer::globals::sundirhostname . "\n"; 335 push(@{$propertyfile}, $onepropertyline); 336 } 337 338 if ( $installer::globals::desktoplinkexists ) 339 { 340 my $onepropertyline = "DESKTOPLINKEXISTS" . "\t" . "1" . "\n"; 341 push(@{$propertyfile}, $onepropertyline); 342 343 $onepropertyline = "CREATEDESKTOPLINK" . "\t" . "1" . "\n"; # Setting the default 344 push(@{$propertyfile}, $onepropertyline); 345 } 346 347 if ( $installer::globals::patch ) 348 { 349 my $onepropertyline = "ISPATCH" . "\t" . "1" . "\n"; 350 push(@{$propertyfile}, $onepropertyline); 351 352 $onepropertyline = "SETUP_USED" . "\t" . "0" . "\n"; 353 push(@{$propertyfile}, $onepropertyline); 354 } 355 356 if ( $installer::globals::languagepack ) 357 { 358 my $onepropertyline = "ISLANGUAGEPACK" . "\t" . "1" . "\n"; 359 push(@{$propertyfile}, $onepropertyline); 360 } 361 362 my $languagesline = "PRODUCTALLLANGUAGES" . "\t" . $$languagestringref . "\n"; 363 push(@{$propertyfile}, $languagesline); 364 365 if (( $allvariables->{'PRODUCTEXTENSION'} ) && ( $allvariables->{'PRODUCTEXTENSION'} eq "Beta" )) 366 { 367 # my $registryline = "WRITE_REGISTRY" . "\t" . "0" . "\n"; 368 # push(@{$propertyfile}, $registryline); 369 my $betainfoline = "BETAPRODUCT" . "\t" . "1" . "\n"; 370 push(@{$propertyfile}, $betainfoline); 371 } 372 elsif ( $allvariables->{'DEVELOPMENTPRODUCT'} ) 373 { 374 my $registryline = "WRITE_REGISTRY" . "\t" . "0" . "\n"; 375 push(@{$propertyfile}, $registryline); 376 } 377 else 378 { 379 my $registryline = "WRITE_REGISTRY" . "\t" . "1" . "\n"; # Default: Write complete registry 380 push(@{$propertyfile}, $registryline); 381 } 382 383 # Adding also used tree conditions for multilayer products. 384 # These are saved in %installer::globals::usedtreeconditions 385 foreach my $treecondition (keys %installer::globals::usedtreeconditions) 386 { 387 my $onepropertyline = $treecondition . "\t" . "1" . "\n"; 388 push(@{$propertyfile}, $onepropertyline); 389 } 390 391 # No more license dialog for selected products 392 if ( $allvariables->{'HIDELICENSEDIALOG'} ) 393 { 394 my $onepropertyline = "HIDEEULA" . "\t" . "1" . "\n"; 395 396 my $already_defined = 0; 397 398 for ( my $i = 0; $i <= $#{$propertyfile}; $i++ ) 399 { 400 if ( ${$propertyfile}[$i] =~ /^\s*HIDEEULA\t/ ) 401 { 402 ${$propertyfile}[$i] = $onepropertyline; 403 $already_defined = 1; 404 last; 405 } 406 } 407 408 if ( ! $already_defined ) 409 { 410 push(@{$propertyfile}, $onepropertyline); 411 } 412 } 413 414 # Setting .NET requirements 415 if ( $installer::globals::required_dotnet_version ne "" ) 416 { 417 my $onepropertyline = "REQUIRED_DOTNET_VERSION" . "\t" . $installer::globals::required_dotnet_version . "\n"; 418 push(@{$propertyfile}, $onepropertyline); 419 420 $onepropertyline = "DOTNET_SUFFICIENT" . "\t" . "1" . "\n"; # default value for found .NET 421 push(@{$propertyfile}, $onepropertyline); 422 } 423 424} 425 426####################################################### 427# Setting properties needed for ms file type registration 428####################################################### 429 430sub set_ms_file_types_properties 431{ 432 my ($propertyfile) = @_; 433 434 push(@{$propertyfile}, "REGISTER_PPS" . "\t" . "0" . "\n"); 435 push(@{$propertyfile}, "REGISTER_PPSX" . "\t" . "0" . "\n"); 436 push(@{$propertyfile}, "REGISTER_PPSM" . "\t" . "0" . "\n"); 437 push(@{$propertyfile}, "REGISTER_PPAM" . "\t" . "0" . "\n"); 438 push(@{$propertyfile}, "REGISTER_PPT" . "\t" . "0" . "\n"); 439 push(@{$propertyfile}, "REGISTER_PPTX" . "\t" . "0" . "\n"); 440 push(@{$propertyfile}, "REGISTER_PPTM" . "\t" . "0" . "\n"); 441 push(@{$propertyfile}, "REGISTER_POT" . "\t" . "0" . "\n"); 442 push(@{$propertyfile}, "REGISTER_POTX" . "\t" . "0" . "\n"); 443 push(@{$propertyfile}, "REGISTER_POTM" . "\t" . "0" . "\n"); 444 445 push(@{$propertyfile}, "REGISTER_DOC" . "\t" . "0" . "\n"); 446 push(@{$propertyfile}, "REGISTER_DOCX" . "\t" . "0" . "\n"); 447 push(@{$propertyfile}, "REGISTER_DOCM" . "\t" . "0" . "\n"); 448 push(@{$propertyfile}, "REGISTER_DOT" . "\t" . "0" . "\n"); 449 push(@{$propertyfile}, "REGISTER_DOTX" . "\t" . "0" . "\n"); 450 push(@{$propertyfile}, "REGISTER_DOTM" . "\t" . "0" . "\n"); 451 push(@{$propertyfile}, "REGISTER_RTF" . "\t" . "0" . "\n"); 452 453 push(@{$propertyfile}, "REGISTER_XLS" . "\t" . "0" . "\n"); 454 push(@{$propertyfile}, "REGISTER_XLSX" . "\t" . "0" . "\n"); 455 push(@{$propertyfile}, "REGISTER_XLSM" . "\t" . "0" . "\n"); 456 push(@{$propertyfile}, "REGISTER_XLSB" . "\t" . "0" . "\n"); 457 push(@{$propertyfile}, "REGISTER_XLAM" . "\t" . "0" . "\n"); 458 push(@{$propertyfile}, "REGISTER_XLT" . "\t" . "0" . "\n"); 459 push(@{$propertyfile}, "REGISTER_XLTX" . "\t" . "0" . "\n"); 460 push(@{$propertyfile}, "REGISTER_XLTM" . "\t" . "0" . "\n"); 461 462 push(@{$propertyfile}, "REGISTER_NO_MSO_TYPES" . "\t" . "0" . "\n"); 463 push(@{$propertyfile}, "REGISTER_ALL_MSO_TYPES" . "\t" . "0" . "\n"); 464} 465 466#################################################################################### 467# Updating the file Property.idt dynamically 468# Content: 469# Property Value 470#################################################################################### 471 472sub update_property_table 473{ 474 my ($basedir, $language, $allvariables, $languagestringref) = @_; 475 476 my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; 477 478 my $propertyfile = installer::files::read_file($properyfilename); 479 480 # Getting the new values 481 # Some values (arpcomments, arpcontacts, ...) are inserted from the Property.mlf 482 483 my $arpcomments = get_arpcomments_for_property_table($allvariables, $languagestringref); 484 my $installlevel = get_installlevel_for_property_table(); 485 my $ischeckforproductupdates = get_ischeckforproductupdates_for_property_table(); 486 my $manufacturer = get_manufacturer_for_property_table(); 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