2 # ws-manifest.pl - create a generic manifest file (including u3 information) from the wireshark.nsi
6 # These are the known directories in the distribution and where they should live on a U3 device
7 my %u3locs = qw($INSTDIR device
8 $INSTDIR\plugins\${VERSION} device
10 $INSTDIR\snmp\mibs device
11 $INSTDIR\diameter device
13 $INSTDIR\radius device
14 $INSTDIR\wimaxasncp device
16 $INSTDIR\${GTK_WIMP_RCDST_DIR} host
17 $INSTDIR\etc\gtk-2.0 host
18 $INSTDIR\etc\pango host
19 $INSTDIR\lib\gtk-2.0\${GTK2_LIB_DIR}\immodules host
20 $INSTDIR\${GTK_WIMP_DLLDST_DIR} host);
22 my @dirs; # the directories in the manifest
23 my @defines; # stack of defines
26 if($line =~ /^SetOutPath (.+)$/) {
28 if($outpath ne '$PROFILE') { # ignore the PROFILE
29 push(@dirs, $outpath);
31 } elsif ($line =~ /!ifdef (.*)$/) {
33 } elsif ($line =~ /!endif/) {
35 if(scalar(@defines) == 0) {
38 } elsif ($line =~ /^File[^\"]+\"([^\"]+)\"/) {
40 # make things relative to the root rather than the NSIS directory
41 if($file =~ /^[^\.\$]/) { $file = "packaging\\nsis\\" . $file; }
42 $file =~ s/\.\.\\\.\.\\//; # remove ../../
43 push(@$outpath, $file);
45 if(defined @defines) {
46 push(@$file, "ifdef=" . $defines[-1]);
49 # there may be a parameter - copy it across
50 if($line =~ /\/(\S+)/) {
56 print "#\n# DO NOT EDIT - autogenerated from wireshark.nsi\n#\n";
58 foreach $dir(sort @dirs) {
65 print "[". $dir . " u3loc=" . $loc . "]\n";
67 foreach $file(sort @$dir) {
70 foreach $param (sort(@$file)) {
74 if($dir eq '$INSTDIR') { # try and find a better location
75 if($file =~ /\.dll$|\.exe$|EXE}$|DLL}$/) {
91 if(defined @ignored) {
93 print STDERR "ERROR\nThe following directories have no known location on a U3 device:\n";
95 foreach $dir(sort @ignored) {
96 print STDERR "\t" . $dir . " ";