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::binary;
25
26use installer::existence;
27use installer::files;
28use installer::globals;
29
30###########################################################################################################
31# Updating the table Binary dynamically with all files from $binarytablefiles
32# Content:
33# Name	Data
34# s72	v0
35# Binary	Name
36###########################################################################################################
37
38sub update_binary_table
39{
40	my ($languageidtdir, $filesref, $binarytablefiles) = @_;
41
42	my $binaryidttablename = $languageidtdir . $installer::globals::separator . "Binary.idt";
43	my $binaryidttable = installer::files::read_file($binaryidttablename);
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 <= $#{$binarytablefiles}; $i++ )
49	{
50		my $binaryfile = ${$binarytablefiles}[$i];
51		my $binaryfilename = $binaryfile->{'Name'};
52		my $binaryfiledata = $binaryfilename;
53
54		$binaryfilename =~ s/\.//g;	 # removing "." in filename: "abc.dll" to "abcdll" in name column
55
56		my %binary = ();
57
58		$binary{'Name'} = $binaryfilename;
59		$binary{'Data'} = $binaryfiledata;
60
61		my $oneline = $binary{'Name'} . "\t" . $binary{'Data'} . "\n";
62
63		push(@{$binaryidttable}, $oneline);
64	}
65
66	# Saving the file
67
68	installer::files::save_file($binaryidttablename ,$binaryidttable);
69	my $infoline = "Updated idt file: $binaryidttablename\n";
70	push(@installer::globals::logfileinfo, $infoline);
71}
72
731;
74