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::icon;
25
26use installer::files;
27use installer::globals;
28use installer::pathanalyzer;
29use installer::windows::idtglobal;
30
31###########################################################################################################
32# Creating the file Icon.idt dynamically
33# Content:
34# Name Data
35###########################################################################################################
36
37sub create_icon_table
38{
39	my ($iconfilecollector, $basedir) = @_;
40
41	my @icontable = ();
42
43	installer::windows::idtglobal::write_idt_header(\@icontable, "icon");
44
45	# Only the iconfiles, that are used in the shortcut table for the
46	# FolderItems (entries in Windows startmenu) are added into the icon table.
47
48	for ( my $i = 0; $i <= $#{$iconfilecollector}; $i++ )
49	{
50		my $iconfile = ${$iconfilecollector}[$i];
51
52		installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$iconfile);
53
54		my %icon = ();
55
56		$icon{'Name'} = $iconfile;	# simply soffice.exe
57		$icon{'Data'} = $iconfile;	# simply soffice.exe
58
59		my $oneline = $icon{'Name'} . "\t" . $icon{'Data'} . "\n";
60
61		push(@icontable, $oneline);
62	}
63
64	# Saving the file
65
66	my $icontablename = $basedir . $installer::globals::separator . "Icon.idt";
67	installer::files::save_file($icontablename ,\@icontable);
68	my $infoline = "Created idt file: $icontablename\n";
69	push(@installer::globals::logfileinfo, $infoline);
70
71}
72
731;
74