xref: /trunk/main/solenv/bin/modules/installer/windows/binary.pm (revision ec6d9e159f5d40bf5d1f27b0b525436f7e942929)
19780544fSAndrew Rist#**************************************************************
2cdf0e10cSrcweir#
39780544fSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
49780544fSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
59780544fSAndrew Rist#  distributed with this work for additional information
69780544fSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
79780544fSAndrew Rist#  to you under the Apache License, Version 2.0 (the
89780544fSAndrew Rist#  "License"); you may not use this file except in compliance
99780544fSAndrew Rist#  with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir#
119780544fSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir#
139780544fSAndrew Rist#  Unless required by applicable law or agreed to in writing,
149780544fSAndrew Rist#  software distributed under the License is distributed on an
159780544fSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
169780544fSAndrew Rist#  KIND, either express or implied.  See the License for the
179780544fSAndrew Rist#  specific language governing permissions and limitations
189780544fSAndrew Rist#  under the License.
19cdf0e10cSrcweir#
209780544fSAndrew Rist#**************************************************************
219780544fSAndrew Rist
22cdf0e10cSrcweirpackage installer::windows::binary;
23cdf0e10cSrcweir
24cdf0e10cSrcweiruse installer::existence;
25cdf0e10cSrcweiruse installer::files;
26cdf0e10cSrcweiruse installer::globals;
27cdf0e10cSrcweir
28*04be0b07SAndre Fischeruse strict;
29*04be0b07SAndre Fischer
30cdf0e10cSrcweir###########################################################################################################
31cdf0e10cSrcweir# Updating the table Binary dynamically with all files from $binarytablefiles
32cdf0e10cSrcweir# Content:
33cdf0e10cSrcweir# Name  Data
34cdf0e10cSrcweir# s72   v0
35cdf0e10cSrcweir# Binary    Name
36cdf0e10cSrcweir###########################################################################################################
37cdf0e10cSrcweir
38cdf0e10cSrcweirsub update_binary_table
39cdf0e10cSrcweir{
40cdf0e10cSrcweir    my ($languageidtdir, $filesref, $binarytablefiles) = @_;
41cdf0e10cSrcweir
42cdf0e10cSrcweir    my $binaryidttablename = $languageidtdir . $installer::globals::separator . "Binary.idt";
43cdf0e10cSrcweir    my $binaryidttable = installer::files::read_file($binaryidttablename);
44cdf0e10cSrcweir
45cdf0e10cSrcweir    # Only the iconfiles, that are used in the shortcut table for the
46cdf0e10cSrcweir    # FolderItems (entries in Windows startmenu) are added into the icon table.
47cdf0e10cSrcweir
48*04be0b07SAndre Fischer    foreach my $binaryfile (@$binarytablefiles)
49cdf0e10cSrcweir    {
50cdf0e10cSrcweir        my $binaryfilename = $binaryfile->{'Name'};
51cdf0e10cSrcweir        my $binaryfiledata = $binaryfilename;
52cdf0e10cSrcweir
53*04be0b07SAndre Fischer        # removing "." in filename: "abc.dll" to "abcdll" in name column
54*04be0b07SAndre Fischer        $binaryfilename =~ s/\.//g;
55cdf0e10cSrcweir
56*04be0b07SAndre Fischer        push @$binaryidttable, $binaryfilename . "\t" . $binaryfiledata . "\n";
57cdf0e10cSrcweir    }
58cdf0e10cSrcweir
59cdf0e10cSrcweir    # Saving the file
60cdf0e10cSrcweir
61cdf0e10cSrcweir    installer::files::save_file($binaryidttablename ,$binaryidttable);
62b274bc22SAndre Fischer    $installer::logger::Lang->printf("Updated idt file: %s\n", $binaryidttablename);
63cdf0e10cSrcweir}
64cdf0e10cSrcweir
65cdf0e10cSrcweir1;
66