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
22package installer::windows::binary;
23
24use installer::existence;
25use installer::files;
26use installer::globals;
27
28use strict;
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	foreach my $binaryfile (@$binarytablefiles)
49	{
50		my $binaryfilename = $binaryfile->{'Name'};
51		my $binaryfiledata = $binaryfilename;
52
53        # removing "." in filename: "abc.dll" to "abcdll" in name column
54		$binaryfilename =~ s/\.//g;
55
56		push @$binaryidttable, $binaryfilename . "\t" . $binaryfiledata . "\n";
57	}
58
59	# Saving the file
60
61	installer::files::save_file($binaryidttablename ,$binaryidttable);
62    $installer::logger::Lang->printf("Updated idt file: %s\n", $binaryidttablename);
63}
64
651;
66