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::selfreg; 29 30use installer::exiter; 31use installer::files; 32use installer::globals; 33use installer::worker; 34use installer::windows::idtglobal; 35 36############################################################## 37# Returning the cost for the selfreg table. 38############################################################## 39 40sub get_selfreg_cost 41{ 42 my ( $onefile ) = @_; 43 44 return "0"; 45} 46 47#################################################################################### 48# Creating the file SelfReg.idt dynamically 49# Content: 50# File_ Cost 51# UpgradeCode VersionMin VersionMax Language Attributes Remove ActionProperty 52#################################################################################### 53 54sub create_selfreg_table 55{ 56 my ($filesref, $basedir) = @_; 57 58 my @selfregtable = (); 59 60 installer::windows::idtglobal::write_idt_header(\@selfregtable, "selfreg"); 61 62 # Registering all libraries with flag "SELFREG" 63 64 my $selfregfiles = installer::worker::collect_all_items_with_special_flag($filesref, "SELFREG"); 65 66 for ( my $i = 0; $i <= $#{$selfregfiles}; $i++ ) 67 { 68 my $onefile = ${$selfregfiles}[$i]; 69 70 my %selfreg = (); 71 72 $selfreg{'File_'} = $onefile->{'uniquename'}; 73 $selfreg{'Cost'} = get_selfreg_cost($onefile); 74 75 my $oneline = $selfreg{'File_'} . "\t" . $selfreg{'Cost'} . "\n"; 76 77 push(@selfregtable, $oneline); 78 } 79 80 # Saving the file 81 82 my $selfregtablename = $basedir . $installer::globals::separator . "SelfReg.idt"; 83 installer::files::save_file($selfregtablename ,\@selfregtable); 84 my $infoline = "Created idt file: $selfregtablename\n"; 85 push(@installer::globals::logfileinfo, $infoline); 86} 87 881;