binary.pm (b274bc22) | binary.pm (04be0b07) |
---|---|
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 --- 5 unchanged lines hidden (view full) --- 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 | 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 --- 5 unchanged lines hidden (view full) --- 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 | 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 | 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++ ) | 48 foreach my $binaryfile (@$binarytablefiles) |
49 { | 49 { |
50 my $binaryfile = ${$binarytablefiles}[$i]; | |
51 my $binaryfilename = $binaryfile->{'Name'}; 52 my $binaryfiledata = $binaryfilename; | 50 my $binaryfilename = $binaryfile->{'Name'}; 51 my $binaryfiledata = $binaryfilename; |
53 54 $binaryfilename =~ s/\.//g; # removing "." in filename: "abc.dll" to "abcdll" in name column 55 56 my %binary = (); | |
57 | 52 |
58 $binary{'Name'} = $binaryfilename; 59 $binary{'Data'} = $binaryfiledata; 60 61 my $oneline = $binary{'Name'} . "\t" . $binary{'Data'} . "\n"; 62 63 push(@{$binaryidttable}, $oneline); | 53 # removing "." in filename: "abc.dll" to "abcdll" in name column 54 $binaryfilename =~ s/\.//g; 55 56 push @$binaryidttable, $binaryfilename . "\t" . $binaryfiledata . "\n"; |
64 } 65 66 # Saving the file 67 68 installer::files::save_file($binaryidttablename ,$binaryidttable); 69 $installer::logger::Lang->printf("Updated idt file: %s\n", $binaryidttablename); 70} 71 721; | 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; |