merge the formfield patch from ooo-build
[ooovba.git] / solenv / bin / modules / installer / windows / icon.pm
blobfd906943ded448ab461b45cd66ee3a3dddc4875f
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: icon.pm,v $
11 # $Revision: 1.4 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 package installer::windows::icon;
34 use installer::files;
35 use installer::globals;
36 use installer::pathanalyzer;
37 use installer::windows::idtglobal;
39 ###########################################################################################################
40 # Creating the file Icon.idt dynamically
41 # Content:
42 # Name Data
43 ###########################################################################################################
45 sub create_icon_table
47 my ($iconfilecollector, $basedir) = @_;
49 my @icontable = ();
51 installer::windows::idtglobal::write_idt_header(\@icontable, "icon");
53 # Only the iconfiles, that are used in the shortcut table for the
54 # FolderItems (entries in Windows startmenu) are added into the icon table.
56 for ( my $i = 0; $i <= $#{$iconfilecollector}; $i++ )
58 my $iconfile = ${$iconfilecollector}[$i];
60 installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$iconfile);
62 my %icon = ();
64 $icon{'Name'} = $iconfile; # simply soffice.exe
65 $icon{'Data'} = $iconfile; # simply soffice.exe
67 my $oneline = $icon{'Name'} . "\t" . $icon{'Data'} . "\n";
69 push(@icontable, $oneline);
72 # Saving the file
74 my $icontablename = $basedir . $installer::globals::separator . "Icon.idt";
75 installer::files::save_file($icontablename ,\@icontable);
76 my $infoline = "Created idt file: $icontablename\n";
77 push(@installer::globals::logfileinfo, $infoline);