I have attached a perl program and the exe was created with:
pp -o hello.exe -a parinc/cygrunsrv.exe hello.pl
Put an executable (or any file?) in a sub directory called parinc.
I tried different file names other than $0 and if didn't seem to make a
difference.
./hello.exe fails
hello.exe works if on path
/c/scripts/hello.exe works
c:/scripts/hello.exe works
Also using PAR::read_file works all the time and this is what I use instead.
---------------------------------------
I have:
[EMAIL PROTECTED]/c/scripts$ perl -v
This is perl, v5.8.8 built for cygwin-thread-multi-64int
(with 8 registered patches, see perl -V for more detail)
[EMAIL PROTECTED]/c/scripts$ cygcheck -c cygwin
Cygwin Package Information
Package Version Status
cygwin 1.5.25-7 OK
[EMAIL PROTECTED]/c/scripts$ cygcheck -c perl
Cygwin Package Information
Package Version Status
perl 5.8.8-4 OK
winxp sp3
#!/usr/bin/perl
use strict;
# doesnt work with ./hello.exe
#my $Exe="$FindBin::Bin/$FindBin::Script";
print "ziparch=$0\n";
#my $zip = PAR::par_handle($Exe);
my $zip = PAR::par_handle($0);
print "zip=$zip\n";
if ($zip) {
my $file = "cygrunsrv.exe";
if ($zip->extractMemberWithoutPaths("parinc/$file") == 0) {
print "$file extracted\n";
my $num = chmod 0777, "$file";
print "chmod 777 $num $file\n";
} else {
print "$file missing\n";
}
}
=pod
# this works with any calling path
my $file = "cygrunsrv.exe";
my $cyg = PAR::read_file("parinc/$file");
open (TMP, ">$file") or print "cant open output $file $!\n";
binmode(TMP);
print TMP $cyg;
close TMP;
my $num = chmod 0777, "$file";
print "chmod 777 $num $file\n";
=cut
print "hello bob\n";