xref: /AOO41X/main/solenv/bin/modules/installer/windows/property.pm (revision 4bfbcde8d64cc5d114df10dce4a9ed79eff32278)
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    my $productlanguage = get_productlanguage_for_property_table($language);
484    my $productname = get_productname_for_property_table($allvariables);
485    my $productversion = get_productversion_for_property_table();
486    my $quickstarterlinkname = get_quickstarterlinkname_for_property_table($allvariables);
487
488    # Updating the values
489
490    for ( my $i = 0; $i <= $#{$propertyfile}; $i++ )
491    {
492        ${$propertyfile}[$i] =~ s/\bARPCOMMENTSTEMPLATE\b/$arpcomments/;
493        ${$propertyfile}[$i] =~ s/\bINSTALLLEVELTEMPLATE\b/$installlevel/;
494        ${$propertyfile}[$i] =~ s/\bISCHECKFORPRODUCTUPDATESTEMPLATE\b/$ischeckforproductupdates/;
495        ${$propertyfile}[$i] =~ s/\bMANUFACTURERTEMPLATE\b/$manufacturer/;
496        ${$propertyfile}[$i] =~ s/\bPRODUCTLANGUAGETEMPLATE\b/$productlanguage/;
497        ${$propertyfile}[$i] =~ s/\bPRODUCTNAMETEMPLATE\b/$productname/;
498        ${$propertyfile}[$i] =~ s/\bPRODUCTVERSIONTEMPLATE\b/$productversion/;
499        ${$propertyfile}[$i] =~ s/\bQUICKSTARTERLINKNAMETEMPLATE\b/$quickstarterlinkname/;
500    }
501
502    # Setting variables into propertytable
503    set_important_properties($propertyfile, $allvariables, $languagestringref);
504
505    # Setting feature names as properties for Windows patch mechanism
506    if ( $installer::globals::patch ) { set_featurename_properties_for_patch($propertyfile); }
507
508    # Setting variables for register for ms file types
509    set_ms_file_types_properties($propertyfile);
510
511    # Saving the file
512
513    installer::files::save_file($properyfilename ,$propertyfile);
514    my $infoline = "Updated idt file: $properyfilename\n";
515    push(@installer::globals::logfileinfo, $infoline);
516
517}
518
519####################################################################################
520# Setting language specific Properties in file Property.idt dynamically
521# Adding:
522# is1033 = 1
523# isMulti = 1
524####################################################################################
525
526sub set_languages_in_property_table
527{
528    my ($basedir, $languagesarrayref) = @_;
529
530    my $properyfilename = $basedir . $installer::globals::separator . "Property.idt";
531    my $propertyfile = installer::files::read_file($properyfilename);
532
533    # Setting the component properties saved in %installer::globals::languageproperties
534    foreach my $localproperty ( keys %installer::globals::languageproperties )
535    {
536        $onepropertyline =  $localproperty . "\t" . $installer::globals::languageproperties{$localproperty} . "\n";
537        push(@{$propertyfile}, $onepropertyline);
538    }
539
540    # Setting the info about multilingual installation in property "isMulti"
541
542    my $propertyname = "isMulti";
543    my $ismultivalue = 0;
544
545    if ( $installer::globals::ismultilingual ) { $ismultivalue = 1; }
546
547    my $onepropertyline =  $propertyname . "\t" . $ismultivalue . "\n";
548    push(@{$propertyfile}, $onepropertyline);
549
550    # setting the ARPPRODUCTICON
551
552    if ($installer::globals::sofficeiconadded)  # set in shortcut.pm
553    {
554        $onepropertyline =  "ARPPRODUCTICON" . "\t" . "soffice.ico" . "\n";
555        push(@{$propertyfile}, $onepropertyline);
556    }
557
558    # Saving the file
559
560    installer::files::save_file($properyfilename ,$propertyfile);
561    my $infoline = "Added language content into idt file: $properyfilename\n";
562    push(@installer::globals::logfileinfo, $infoline);
563
564}
565
566############################################################
567# Setting the ProductCode and the UpgradeCode
568# into the Property table. Both have to be stored
569# in the global file $installer::globals::codefilename
570############################################################
571
572sub set_codes_in_property_table
573{
574    my ($basedir) = @_;
575
576    # Reading the property file
577
578    my $properyfilename = $basedir . $installer::globals::separator . "Property.idt";
579    my $propertyfile = installer::files::read_file($properyfilename);
580
581    # Updating the values
582
583    for ( my $i = 0; $i <= $#{$propertyfile}; $i++ )
584    {
585        ${$propertyfile}[$i] =~ s/\bPRODUCTCODETEMPLATE\b/$installer::globals::productcode/;
586        ${$propertyfile}[$i] =~ s/\bUPGRADECODETEMPLATE\b/$installer::globals::upgradecode/;
587    }
588
589    # Saving the property file
590
591    installer::files::save_file($properyfilename ,$propertyfile);
592    my $infoline = "Added language content into idt file: $properyfilename\n";
593    push(@installer::globals::logfileinfo, $infoline);
594
595}
596
597############################################################
598# Setting the variable REGKEYPRODPATH, that is used
599# by the language packs.
600############################################################
601
602sub set_regkeyprodpath_in_property_table
603{
604    my ($basedir, , $allvariables) = @_;
605
606    # Reading the property file
607
608    my $properyfilename = $basedir . $installer::globals::separator . "Property.idt";
609    my $propertyfile = installer::files::read_file($properyfilename);
610
611    my $name = $allvariables->{'PRODUCTNAME'};
612    my $version = $allvariables->{'PRODUCTVERSION'};
613
614    my $onepropertyline = "REGKEYPRODPATH" . "\t" . "Software" . "\\" . $installer::globals::manufacturer . "\\". $name;
615
616    push(@{$propertyfile}, $onepropertyline);
617
618    # Saving the property file
619
620    installer::files::save_file($properyfilename ,$propertyfile);
621    my $infoline = "Added language content into idt file: $properyfilename\n";
622    push(@installer::globals::logfileinfo, $infoline);
623
624}
625
626############################################################
627# Changing default for MS file type registration
628# in Beta products.
629############################################################
630
631sub update_checkbox_table
632{
633    my ($basedir, $allvariables) = @_;
634
635    if (( $allvariables->{'PRODUCTEXTENSION'} ) && ( $allvariables->{'PRODUCTEXTENSION'}  eq "Beta" ))
636    {
637        my $checkboxfilename = $basedir . $installer::globals::separator . "CheckBox.idt";
638
639        if ( -f $checkboxfilename )
640        {
641            my $checkboxfile = installer::files::read_file($checkboxfilename);
642
643            my $checkboxline = "SELECT_WORD" . "\t" . "0" . "\n";
644            push(@{$checkboxfile}, $checkboxline);
645            $checkboxline = "SELECT_EXCEL" . "\t" . "0" . "\n";
646            push(@{$checkboxfile}, $checkboxline);
647            $checkboxline = "SELECT_POWERPOINT" . "\t" . "0" . "\n";
648            push(@{$checkboxfile}, $checkboxline);
649
650            # Saving the property file
651            installer::files::save_file($checkboxfilename ,$checkboxfile);
652            my $infoline = "Added ms file type defaults into idt file: $checkboxfilename\n";
653            push(@installer::globals::logfileinfo, $infoline);
654        }
655    }
656}
657
6581;
659