| 1 |
# |
| 2 |
# This file is part of the LibreOffice project. |
| 3 |
# |
| 4 |
# This Source Code Form is subject to the terms of the Mozilla Public |
| 5 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 6 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 7 |
# |
| 8 |
# This file incorporates work covered by the following license notice: |
| 9 |
# |
| 10 |
# Licensed to the Apache Software Foundation (ASF) under one or more |
| 11 |
# contributor license agreements. See the NOTICE file distributed |
| 12 |
# with this work for additional information regarding copyright |
| 13 |
# ownership. The ASF licenses this file to you under the Apache |
| 14 |
# License, Version 2.0 (the "License"); you may not use this file |
| 15 |
# except in compliance with the License. You may obtain a copy of |
| 16 |
# the License at http://www.apache.org/licenses/LICENSE-2.0 . |
| 17 |
# |
| 18 |
|
| 19 |
package installer::windows::property; |
| 20 |
|
| 21 |
use strict; |
| 22 |
use warnings; |
| 23 |
|
| 24 |
use installer::exiter; |
| 25 |
use installer::files; |
| 26 |
use installer::globals; |
| 27 |
use installer::windows::idtglobal; |
| 28 |
use installer::windows::language; |
| 29 |
|
| 30 |
############################################# |
| 31 |
# Setting the properties dynamically |
| 32 |
# for the table Property.idt |
| 33 |
############################################# |
| 34 |
|
| 35 |
sub get_arpcomments_for_property_table |
| 36 |
{ |
| 37 |
my ( $allvariables, $languagestringref ) = @_; |
| 38 |
|
| 39 |
my $name = $allvariables->{'PRODUCTNAME'}; |
| 40 |
my $version = $allvariables->{'PRODUCTVERSION'}; |
| 41 |
my $comment = $name . " " . $version; |
| 42 |
|
| 43 |
my $postversionextension = ""; |
| 44 |
if ( $allvariables->{'POSTVERSIONEXTENSION'} ) |
| 45 |
{ |
| 46 |
$postversionextension = $allvariables->{'POSTVERSIONEXTENSION'}; |
| 47 |
$comment = $comment . " " . $postversionextension; |
| 48 |
} |
| 49 |
|
| 50 |
if ( $installer::globals::languagepack ) { $comment = $comment . " " . "Language Pack"; } |
| 51 |
elsif ( $installer::globals::helppack ) { $comment = $comment . " " . "Help Pack"; } |
| 52 |
|
| 53 |
my $languagestring = $$languagestringref; |
| 54 |
$languagestring =~ s/\_/\,/g; |
| 55 |
if ( length($languagestring) > 30 ) { $languagestring = "multilanguage"; } # fdo#64053 |
| 56 |
|
| 57 |
$comment = $comment . " ($languagestring)"; |
| 58 |
|
| 59 |
return $comment; |
| 60 |
} |
| 61 |
|
| 62 |
sub get_installlevel_for_property_table |
| 63 |
{ |
| 64 |
my $installlevel = "100"; |
| 65 |
return $installlevel; |
| 66 |
} |
| 67 |
|
| 68 |
sub get_ischeckforproductupdates_for_property_table |
| 69 |
{ |
| 70 |
my $ischeckforproductupdates = "1"; |
| 71 |
return $ischeckforproductupdates; |
| 72 |
} |
| 73 |
|
| 74 |
sub get_manufacturer_for_property_table |
| 75 |
{ |
| 76 |
return $installer::globals::manufacturer; |
| 77 |
} |
| 78 |
|
| 79 |
sub get_productlanguage_for_property_table |
| 80 |
{ |
| 81 |
my ($language) = @_; |
| 82 |
my $windowslanguage = installer::windows::language::get_windows_language($language); |
| 83 |
return $windowslanguage; |
| 84 |
} |
| 85 |
|
| 86 |
sub get_language_string |
| 87 |
{ |
| 88 |
my $langstring = ""; |
| 89 |
|
| 90 |
for ( my $i = 0; $i <= $#installer::globals::languagenames; $i++ ) |
| 91 |
{ |
| 92 |
$langstring = $langstring . $installer::globals::languagenames[$i] . ", "; |
| 93 |
} |
| 94 |
|
| 95 |
$langstring =~ s/\,\s*$//; |
| 96 |
$langstring = "(" . $langstring . ")"; |
| 97 |
|
| 98 |
return $langstring; |
| 99 |
} |
| 100 |
|
| 101 |
sub get_english_language_string |
| 102 |
{ |
| 103 |
my $langstring = ""; |
| 104 |
|
| 105 |
# Sorting value not keys, therefore collecting all values |
| 106 |
my %helper = (); |
| 107 |
foreach my $lang ( keys %installer::globals::all_required_english_languagestrings ) |
| 108 |
{ |
| 109 |
$helper{$installer::globals::all_required_english_languagestrings{$lang}} = 1; |
| 110 |
} |
| 111 |
|
| 112 |
foreach my $lang ( sort keys %helper ) |
| 113 |
{ |
| 114 |
$langstring = $langstring . $lang . ", "; |
| 115 |
} |
| 116 |
|
| 117 |
$langstring =~ s/\,\s*$//; |
| 118 |
$langstring = "(" . $langstring . ")"; |
| 119 |
|
| 120 |
return $langstring; |
| 121 |
} |
| 122 |
|
| 123 |
sub get_productname($$) |
| 124 |
{ |
| 125 |
my ( $language, $allvariables ) = @_; |
| 126 |
|
| 127 |
my $name = $allvariables->{'PRODUCTNAME'}; |
| 128 |
|
| 129 |
return $name; |
| 130 |
} |
| 131 |
|
| 132 |
sub get_productname_for_property_table($$) |
| 133 |
{ |
| 134 |
my ( $language, $allvariables ) = @_; |
| 135 |
|
| 136 |
my $name = get_productname ($language, $allvariables); |
| 137 |
my $version = $allvariables->{'PRODUCTVERSION'}; |
| 138 |
my $productname = $name . " " . $version; |
| 139 |
|
| 140 |
my $productextension = ""; |
| 141 |
if ( $allvariables->{'PRODUCTEXTENSION'} ) |
| 142 |
{ |
| 143 |
$productextension = $allvariables->{'PRODUCTEXTENSION'}; |
| 144 |
$productname = $productname . $productextension; |
| 145 |
} |
| 146 |
|
| 147 |
my $postversionextension = ""; |
| 148 |
if ( $allvariables->{'POSTVERSIONEXTENSION'} ) |
| 149 |
{ |
| 150 |
$postversionextension = $allvariables->{'POSTVERSIONEXTENSION'}; |
| 151 |
$productname = $productname . " " . $postversionextension; |
| 152 |
} |
| 153 |
|
| 154 |
if ( $installer::globals::languagepack ) |
| 155 |
{ |
| 156 |
my $langstring = get_english_language_string(); # Example: (English, German) |
| 157 |
$productname = $name . " " . $version . " Language Pack" . " " . $langstring; |
| 158 |
} |
| 159 |
elsif ( $installer::globals::helppack ) |
| 160 |
{ |
| 161 |
my $langstring = get_english_language_string(); # New: (English, German) |
| 162 |
$productname = $name . " " . $version . " Help Pack" . " " . $langstring; |
| 163 |
} |
| 164 |
|
| 165 |
# Saving this name in hash $allvariables for further usage |
| 166 |
$allvariables->{'PROPERTYTABLEPRODUCTNAME'} = $productname; |
| 167 |
my $infoline = "Defined variable PROPERTYTABLEPRODUCTNAME: $productname\n"; |
| 168 |
push(@installer::globals::logfileinfo, $infoline); |
| 169 |
|
| 170 |
return $productname; |
| 171 |
} |
| 172 |
|
| 173 |
sub get_quickstarterlinkname_for_property_table($$) |
| 174 |
{ |
| 175 |
my ( $language, $allvariables ) = @_; |
| 176 |
|
| 177 |
# no usage of POSTVERSIONEXTENSION for Quickstarter link name! |
| 178 |
my $name = get_productname ($language, $allvariables); |
| 179 |
my $version = $allvariables->{'PRODUCTVERSION'}; |
| 180 |
my $quickstartername = $name . " " . $version; |
| 181 |
|
| 182 |
my $infoline = "Defined Quickstarter Link name: $quickstartername\n"; |
| 183 |
push(@installer::globals::logfileinfo, $infoline); |
| 184 |
|
| 185 |
return $quickstartername; |
| 186 |
} |
| 187 |
|
| 188 |
sub get_productversion_for_property_table |
| 189 |
{ |
| 190 |
return $installer::globals::msiproductversion; |
| 191 |
} |
| 192 |
|
| 193 |
####################################################### |
| 194 |
# Setting some important properties |
| 195 |
# (for finding the product in deinstallation process) |
| 196 |
####################################################### |
| 197 |
|
| 198 |
sub set_important_properties |
| 199 |
{ |
| 200 |
my ($propertyfile, $allvariables, $languagestringref) = @_; |
| 201 |
|
| 202 |
# Setting new variables with the content of %PRODUCTNAME and %PRODUCTVERSION |
| 203 |
if ( $allvariables->{'PRODUCTNAME'} ) |
| 204 |
{ |
| 205 |
my $onepropertyline = "DEFINEDPRODUCT" . "\t" . $allvariables->{'PRODUCTNAME'} . "\n"; |
| 206 |
push(@{$propertyfile}, $onepropertyline); |
| 207 |
} |
| 208 |
|
| 209 |
if ( $allvariables->{'PRODUCTVERSION'} ) |
| 210 |
{ |
| 211 |
my $onepropertyline = "DEFINEDVERSION" . "\t" . $allvariables->{'PRODUCTVERSION'} . "\n"; |
| 212 |
push(@{$propertyfile}, $onepropertyline); |
| 213 |
} |
| 214 |
|
| 215 |
if ( $allvariables->{'PRODUCTMAJOR'} ) |
| 216 |
{ |
| 217 |
my $onepropertyline = "PRODUCTMAJOR" . "\t" . $allvariables->{'PRODUCTMAJOR'} . "\n"; |
| 218 |
push(@{$propertyfile}, $onepropertyline); |
| 219 |
} |
| 220 |
|
| 221 |
if ( $allvariables->{'PRODUCTBUILDID'} ) |
| 222 |
{ |
| 223 |
my $onepropertyline = "PRODUCTBUILDID" . "\t" . $allvariables->{'PRODUCTBUILDID'} . "\n"; |
| 224 |
push(@{$propertyfile}, $onepropertyline); |
| 225 |
} |
| 226 |
|
| 227 |
if ( $allvariables->{'URELAYERVERSION'} ) |
| 228 |
{ |
| 229 |
my $onepropertyline = "URELAYERVERSION" . "\t" . $allvariables->{'URELAYERVERSION'} . "\n"; |
| 230 |
push(@{$propertyfile}, $onepropertyline); |
| 231 |
} |
| 232 |
|
| 233 |
if ( $allvariables->{'BRANDPACKAGEVERSION'} ) |
| 234 |
{ |
| 235 |
my $onepropertyline = "BRANDPACKAGEVERSION" . "\t" . $allvariables->{'BRANDPACKAGEVERSION'} . "\n"; |
| 236 |
push(@{$propertyfile}, $onepropertyline); |
| 237 |
} |
| 238 |
|
| 239 |
if ( $allvariables->{'EXCLUDE_FROM_REBASE'} ) |
| 240 |
{ |
| 241 |
my $onepropertyline = "EXCLUDE_FROM_REBASE" . "\t" . $allvariables->{'EXCLUDE_FROM_REBASE'} . "\n"; |
| 242 |
push(@{$propertyfile}, $onepropertyline); |
| 243 |
} |
| 244 |
|
| 245 |
if ( $allvariables->{'PREREQUIREDPATCH'} ) |
| 246 |
{ |
| 247 |
my $onepropertyline = "PREREQUIREDPATCH" . "\t" . $allvariables->{'PREREQUIREDPATCH'} . "\n"; |
| 248 |
push(@{$propertyfile}, $onepropertyline); |
| 249 |
} |
| 250 |
|
| 251 |
my $onepropertyline = "IGNOREPREREQUIREDPATCH" . "\t" . "1" . "\n"; |
| 252 |
push(@{$propertyfile}, $onepropertyline); |
| 253 |
|
| 254 |
$onepropertyline = "DONTOPTIMIZELIBS" . "\t" . "0" . "\n"; |
| 255 |
push(@{$propertyfile}, $onepropertyline); |
| 256 |
|
| 257 |
if ( $installer::globals::officedirhostname ) |
| 258 |
{ |
| 259 |
my $onepropertyline = "OFFICEDIRHOSTNAME" . "\t" . $installer::globals::officedirhostname . "\n"; |
| 260 |
push(@{$propertyfile}, $onepropertyline); |
| 261 |
|
| 262 |
my $localofficedirhostname = $installer::globals::officedirhostname; |
| 263 |
$localofficedirhostname =~ s/\//\\/g; |
| 264 |
$onepropertyline = "OFFICEDIRHOSTNAME_" . "\t" . $localofficedirhostname . "\n"; |
| 265 |
push(@{$propertyfile}, $onepropertyline); |
| 266 |
} |
| 267 |
|
| 268 |
if ( $installer::globals::desktoplinkexists ) |
| 269 |
{ |
| 270 |
my $onepropertyline = "DESKTOPLINKEXISTS" . "\t" . "1" . "\n"; |
| 271 |
push(@{$propertyfile}, $onepropertyline); |
| 272 |
|
| 273 |
$onepropertyline = "CREATEDESKTOPLINK" . "\t" . "1" . "\n"; # Setting the default |
| 274 |
push(@{$propertyfile}, $onepropertyline); |
| 275 |
} |
| 276 |
|
| 277 |
if ( $installer::globals::languagepack ) |
| 278 |
{ |
| 279 |
my $onepropertyline = "ISLANGUAGEPACK" . "\t" . "1" . "\n"; |
| 280 |
push(@{$propertyfile}, $onepropertyline); |
| 281 |
} |
| 282 |
elsif ( $installer::globals::helppack ) |
| 283 |
{ |
| 284 |
my $onepropertyline = "ISHELPPACK" . "\t" . "1" . "\n"; |
| 285 |
push(@{$propertyfile}, $onepropertyline); |
| 286 |
} |
| 287 |
|
| 288 |
my $languagesline = "PRODUCTALLLANGUAGES" . "\t" . $$languagestringref . "\n"; |
| 289 |
push(@{$propertyfile}, $languagesline); |
| 290 |
|
| 291 |
if (( $allvariables->{'PRODUCTEXTENSION'} ) && ( $allvariables->{'PRODUCTEXTENSION'} eq "Beta" )) |
| 292 |
{ |
| 293 |
# my $registryline = "WRITE_REGISTRY" . "\t" . "0" . "\n"; |
| 294 |
# push(@{$propertyfile}, $registryline); |
| 295 |
my $betainfoline = "BETAPRODUCT" . "\t" . "1" . "\n"; |
| 296 |
push(@{$propertyfile}, $betainfoline); |
| 297 |
} |
| 298 |
elsif ( $allvariables->{'DEVELOPMENTPRODUCT'} ) |
| 299 |
{ |
| 300 |
my $registryline = "WRITE_REGISTRY" . "\t" . "0" . "\n"; |
| 301 |
push(@{$propertyfile}, $registryline); |
| 302 |
} |
| 303 |
else |
| 304 |
{ |
| 305 |
my $registryline = "WRITE_REGISTRY" . "\t" . "1" . "\n"; # Default: Write complete registry |
| 306 |
push(@{$propertyfile}, $registryline); |
| 307 |
} |
| 308 |
|
| 309 |
# Adding also used tree conditions for multilayer products. |
| 310 |
# These are saved in %installer::globals::usedtreeconditions |
| 311 |
foreach my $treecondition (keys %installer::globals::usedtreeconditions) |
| 312 |
{ |
| 313 |
my $onepropertyline = $treecondition . "\t" . "1" . "\n"; |
| 314 |
push(@{$propertyfile}, $onepropertyline); |
| 315 |
} |
| 316 |
|
| 317 |
# No more license dialog for selected products |
| 318 |
if ( $allvariables->{'HIDELICENSEDIALOG'} ) |
| 319 |
{ |
| 320 |
my $onepropertyline = "HIDEEULA" . "\t" . "1" . "\n"; |
| 321 |
|
| 322 |
my $already_defined = 0; |
| 323 |
|
| 324 |
for ( my $i = 0; $i <= $#{$propertyfile}; $i++ ) |
| 325 |
{ |
| 326 |
if ( ${$propertyfile}[$i] =~ /^\s*HIDEEULA\t/ ) |
| 327 |
{ |
| 328 |
${$propertyfile}[$i] = $onepropertyline; |
| 329 |
$already_defined = 1; |
| 330 |
last; |
| 331 |
} |
| 332 |
} |
| 333 |
|
| 334 |
if ( ! $already_defined ) |
| 335 |
{ |
| 336 |
push(@{$propertyfile}, $onepropertyline); |
| 337 |
} |
| 338 |
} |
| 339 |
} |
| 340 |
|
| 341 |
####################################################### |
| 342 |
# Setting properties needed for ms file type registration |
| 343 |
####################################################### |
| 344 |
|
| 345 |
sub set_ms_file_types_properties |
| 346 |
{ |
| 347 |
my ($propertyfile) = @_; |
| 348 |
|
| 349 |
# we do not register PPSM, PPAM, and XLAM file types in |
| 350 |
# setup_native\source\win32\customactions\reg4allmsdoc\reg4allmsi.cxx |
| 351 |
# (probably because LibreOffice can't deal with them properly (?) |
| 352 |
|
| 353 |
push(@{$propertyfile}, "REGISTER_PPS" . "\t" . "0" . "\n"); |
| 354 |
push(@{$propertyfile}, "REGISTER_PPSX" . "\t" . "0" . "\n"); |
| 355 |
# push(@{$propertyfile}, "REGISTER_PPSM" . "\t" . "0" . "\n"); |
| 356 |
# push(@{$propertyfile}, "REGISTER_PPAM" . "\t" . "0" . "\n"); |
| 357 |
push(@{$propertyfile}, "REGISTER_PPT" . "\t" . "0" . "\n"); |
| 358 |
push(@{$propertyfile}, "REGISTER_PPTX" . "\t" . "0" . "\n"); |
| 359 |
push(@{$propertyfile}, "REGISTER_PPTM" . "\t" . "0" . "\n"); |
| 360 |
push(@{$propertyfile}, "REGISTER_POT" . "\t" . "0" . "\n"); |
| 361 |
push(@{$propertyfile}, "REGISTER_POTX" . "\t" . "0" . "\n"); |
| 362 |
push(@{$propertyfile}, "REGISTER_POTM" . "\t" . "0" . "\n"); |
| 363 |
|
| 364 |
push(@{$propertyfile}, "REGISTER_DOC" . "\t" . "0" . "\n"); |
| 365 |
push(@{$propertyfile}, "REGISTER_DOCX" . "\t" . "0" . "\n"); |
| 366 |
push(@{$propertyfile}, "REGISTER_DOCM" . "\t" . "0" . "\n"); |
| 367 |
push(@{$propertyfile}, "REGISTER_DOT" . "\t" . "0" . "\n"); |
| 368 |
push(@{$propertyfile}, "REGISTER_DOTX" . "\t" . "0" . "\n"); |
| 369 |
push(@{$propertyfile}, "REGISTER_DOTM" . "\t" . "0" . "\n"); |
| 370 |
push(@{$propertyfile}, "REGISTER_RTF" . "\t" . "0" . "\n"); |
| 371 |
|
| 372 |
push(@{$propertyfile}, "REGISTER_XLR" . "\t" . "0" . "\n"); |
| 373 |
push(@{$propertyfile}, "REGISTER_XLS" . "\t" . "0" . "\n"); |
| 374 |
push(@{$propertyfile}, "REGISTER_XLSX" . "\t" . "0" . "\n"); |
| 375 |
push(@{$propertyfile}, "REGISTER_XLSM" . "\t" . "0" . "\n"); |
| 376 |
push(@{$propertyfile}, "REGISTER_XLSB" . "\t" . "0" . "\n"); |
| 377 |
# push(@{$propertyfile}, "REGISTER_XLAM" . "\t" . "0" . "\n"); |
| 378 |
push(@{$propertyfile}, "REGISTER_XLT" . "\t" . "0" . "\n"); |
| 379 |
push(@{$propertyfile}, "REGISTER_XLTX" . "\t" . "0" . "\n"); |
| 380 |
push(@{$propertyfile}, "REGISTER_XLTM" . "\t" . "0" . "\n"); |
| 381 |
push(@{$propertyfile}, "REGISTER_IQY" . "\t" . "0" . "\n"); |
| 382 |
|
| 383 |
push(@{$propertyfile}, "REGISTER_NO_MSO_TYPES" . "\t" . "0" . "\n"); |
| 384 |
push(@{$propertyfile}, "REGISTER_ALL_MSO_TYPES" . "\t" . "0" . "\n"); |
| 385 |
} |
| 386 |
|
| 387 |
#################################################################################### |
| 388 |
# Updating the file Property.idt dynamically |
| 389 |
# Content: |
| 390 |
# Property Value |
| 391 |
#################################################################################### |
| 392 |
|
| 393 |
sub update_property_table |
| 394 |
{ |
| 395 |
my ($basedir, $language, $allvariables, $languagestringref) = @_; |
| 396 |
|
| 397 |
my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; |
| 398 |
|
| 399 |
my $propertyfile = installer::files::read_file($properyfilename); |
| 400 |
|
| 401 |
my $hasarpnomodify = 0; |
| 402 |
|
| 403 |
# Getting the new values |
| 404 |
# Some values (arpcomments, arpcontacts, ...) are inserted from the Property.mlf |
| 405 |
|
| 406 |
my $arpcomments = get_arpcomments_for_property_table($allvariables, $languagestringref); |
| 407 |
my $installlevel = get_installlevel_for_property_table(); |
| 408 |
my $ischeckforproductupdates = get_ischeckforproductupdates_for_property_table(); |
| 409 |
my $manufacturer = get_manufacturer_for_property_table(); |
| 410 |
my $productlanguage = get_productlanguage_for_property_table($language); |
| 411 |
my $productname = get_productname_for_property_table($language, $allvariables); |
| 412 |
my $productversion = get_productversion_for_property_table(); |
| 413 |
my $quickstarterlinkname = get_quickstarterlinkname_for_property_table($language, $allvariables); |
| 414 |
my $windowsminversiontext = "Windows 10"; |
| 415 |
my $winmajorvermin = "#10"; |
| 416 |
|
| 417 |
# Updating the values |
| 418 |
|
| 419 |
for ( my $i = 0; $i <= $#{$propertyfile}; $i++ ) |
| 420 |
{ |
| 421 |
${$propertyfile}[$i] =~ s/\bARPCOMMENTSTEMPLATE\b/$arpcomments/; |
| 422 |
${$propertyfile}[$i] =~ s/\bINSTALLLEVELTEMPLATE\b/$installlevel/; |
| 423 |
${$propertyfile}[$i] =~ s/\bISCHECKFORPRODUCTUPDATESTEMPLATE\b/$ischeckforproductupdates/; |
| 424 |
${$propertyfile}[$i] =~ s/\bMANUFACTURERTEMPLATE\b/$manufacturer/; |
| 425 |
${$propertyfile}[$i] =~ s/\bPRODUCTLANGUAGETEMPLATE\b/$productlanguage/; |
| 426 |
${$propertyfile}[$i] =~ s/\bPRODUCTNAMETEMPLATE\b/$productname/; |
| 427 |
${$propertyfile}[$i] =~ s/\bPRODUCTVERSIONTEMPLATE\b/$productversion/; |
| 428 |
${$propertyfile}[$i] =~ s/\bQUICKSTARTERLINKNAMETEMPLATE\b/$quickstarterlinkname/; |
| 429 |
${$propertyfile}[$i] =~ s/\bWINDOWSMINVERSIONTEXTTEMPLATE\b/$windowsminversiontext/; |
| 430 |
${$propertyfile}[$i] =~ s/\bWINMAJORVERMINTEMPLATE\b/$winmajorvermin/; |
| 431 |
if ( ${$propertyfile}[$i] =~ m/\bARPNOMODIFY\b/ ) { $hasarpnomodify = 1; } |
| 432 |
} |
| 433 |
|
| 434 |
# Check if are building silent MSI |
| 435 |
if ( $ENV{ENABLE_SILENT_MSI} eq "TRUE" ) |
| 436 |
{ |
| 437 |
push(@{$propertyfile}, "LIMITUI" . "\t" . "1" . "\n"); |
| 438 |
if ( !($hasarpnomodify) ) |
| 439 |
{ |
| 440 |
push(@{$propertyfile}, "ARPNOMODIFY" . "\t" . "1" . "\n"); |
| 441 |
} |
| 442 |
} |
| 443 |
|
| 444 |
# Setting variables into propertytable |
| 445 |
set_important_properties($propertyfile, $allvariables, $languagestringref); |
| 446 |
|
| 447 |
# Setting variables for register for ms file types |
| 448 |
set_ms_file_types_properties($propertyfile); |
| 449 |
|
| 450 |
# Saving the file |
| 451 |
|
| 452 |
installer::files::save_file($properyfilename ,$propertyfile); |
| 453 |
my $infoline = "Updated idt file: $properyfilename\n"; |
| 454 |
push(@installer::globals::logfileinfo, $infoline); |
| 455 |
|
| 456 |
} |
| 457 |
|
| 458 |
#################################################################################### |
| 459 |
# Setting language specific Properties in file Property.idt dynamically |
| 460 |
# Adding: |
| 461 |
# isMulti = 1 |
| 462 |
#################################################################################### |
| 463 |
|
| 464 |
sub set_languages_in_property_table |
| 465 |
{ |
| 466 |
my ($basedir, $languagesarrayref) = @_; |
| 467 |
|
| 468 |
my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; |
| 469 |
my $propertyfile = installer::files::read_file($properyfilename); |
| 470 |
|
| 471 |
# Setting the info about multilingual installation in property "isMulti" |
| 472 |
|
| 473 |
my $propertyname = "isMulti"; |
| 474 |
my $ismultivalue = 0; |
| 475 |
|
| 476 |
if ( $installer::globals::ismultilingual ) { $ismultivalue = 1; } |
| 477 |
|
| 478 |
my $onepropertyline = $propertyname . "\t" . $ismultivalue . "\n"; |
| 479 |
push(@{$propertyfile}, $onepropertyline); |
| 480 |
|
| 481 |
# setting the ARPPRODUCTICON |
| 482 |
|
| 483 |
if ($installer::globals::sofficeiconadded) # set in shortcut.pm |
| 484 |
{ |
| 485 |
$onepropertyline = "ARPPRODUCTICON" . "\t" . "soffice.ico" . "\n"; |
| 486 |
push(@{$propertyfile}, $onepropertyline); |
| 487 |
} |
| 488 |
|
| 489 |
# Saving the file |
| 490 |
|
| 491 |
installer::files::save_file($properyfilename ,$propertyfile); |
| 492 |
my $infoline = "Added language content into idt file: $properyfilename\n"; |
| 493 |
push(@installer::globals::logfileinfo, $infoline); |
| 494 |
|
| 495 |
} |
| 496 |
|
| 497 |
############################################################ |
| 498 |
# Setting the ProductCode and the UpgradeCode |
| 499 |
# into the Property table. Both have to be stored |
| 500 |
# in the global file $installer::globals::codefilename |
| 501 |
############################################################ |
| 502 |
|
| 503 |
sub set_codes_in_property_table |
| 504 |
{ |
| 505 |
my ($basedir) = @_; |
| 506 |
|
| 507 |
# Reading the property file |
| 508 |
|
| 509 |
my $properyfilename = $basedir . $installer::globals::separator . "Property.idt"; |
| 510 |
my $propertyfile = installer::files::read_file($properyfilename); |
| 511 |
|
| 512 |
# Updating the values |
| 513 |
|
| 514 |
for ( my $i = 0; $i <= $#{$propertyfile}; $i++ ) |
| 515 |
{ |
| 516 |
${$propertyfile}[$i] =~ s/\bPRODUCTCODETEMPLATE\b/$installer::globals::productcode/; |
| 517 |
${$propertyfile}[$i] =~ s/\bUPGRADECODETEMPLATE\b/$installer::globals::upgradecode/; |
| 518 |
} |
| 519 |
|
| 520 |
# Saving the property file |
| 521 |
|
| 522 |
installer::files::save_file($properyfilename ,$propertyfile); |
| 523 |
my $infoline = "Added language content into idt file: $properyfilename\n"; |
| 524 |
push(@installer::globals::logfileinfo, $infoline); |
| 525 |
|
| 526 |
} |
| 527 |
|
| 528 |
############################################################ |
| 529 |
# Changing default for MS file type registration |
| 530 |
# in Beta products. |
| 531 |
############################################################ |
| 532 |
|
| 533 |
sub update_checkbox_table |
| 534 |
{ |
| 535 |
my ($basedir, $allvariables) = @_; |
| 536 |
|
| 537 |
if (( $allvariables->{'PRODUCTEXTENSION'} ) && ( $allvariables->{'PRODUCTEXTENSION'} eq "Beta" )) |
| 538 |
{ |
| 539 |
my $checkboxfilename = $basedir . $installer::globals::separator . "CheckBox.idt"; |
| 540 |
|
| 541 |
if ( -f $checkboxfilename ) |
| 542 |
{ |
| 543 |
my $checkboxfile = installer::files::read_file($checkboxfilename); |
| 544 |
|
| 545 |
my $checkboxline = "SELECT_WORD" . "\t" . "0" . "\n"; |
| 546 |
push(@{$checkboxfile}, $checkboxline); |
| 547 |
$checkboxline = "SELECT_EXCEL" . "\t" . "0" . "\n"; |
| 548 |
push(@{$checkboxfile}, $checkboxline); |
| 549 |
$checkboxline = "SELECT_POWERPOINT" . "\t" . "0" . "\n"; |
| 550 |
push(@{$checkboxfile}, $checkboxline); |
| 551 |
$checkboxline = "SELECT_VISIO" . "\t" . "0" . "\n"; |
| 552 |
push(@{$checkboxfile}, $checkboxline); |
| 553 |
|
| 554 |
# Saving the property file |
| 555 |
installer::files::save_file($checkboxfilename ,$checkboxfile); |
| 556 |
my $infoline = "Added ms file type defaults into idt file: $checkboxfilename\n"; |
| 557 |
push(@installer::globals::logfileinfo, $infoline); |
| 558 |
} |
| 559 |
} |
| 560 |
} |
| 561 |
|
| 562 |
1; |