I use pp to "zip" the "extra" files into the exe. I don't know if this
is necessary. Maybe somebody on this list could tell us. I thought I saw
a piece of code( in the pp source code) that had to know the whole size
of the exe. I could be wrong.
So to summarize the question:
1. Can zip be used to add files to a pp'ed exe?
2. Or does pp need to be used to add the extra files?
 
I have some sample code in my pgm that uses the extra files in place:
 
 
# get ParTemp if we are running under PAR::
my $ParTemp=$ENV{PAR_TEMP};
$ParTemp="" if ! defined $ParTemp;
 
# mod path to point to temp/inc/parinc
$ENV{PATH} = "$ENV{PAR_TEMP}/inc/parinc:$ENV{PATH}" if $ParTemp;
 
 
Or like this
 
 
$exepath = $FindBin::Bin;
$exepath = `$ENV{PAR_TEMP}/inc/cygpath -m $exepath`;
 
 
I didn't use this code for some reason that I cant remember and went
with copying the files before use instead.
Also I was making a win32 service out of this perl pgm and I had
permission problems with the files. If you run my sample you will see
some pretty restrictive permissions of the files in inc/parinc. 
 
What os's are you running on?
This sample was run on cygwin but should work fine on linux.
I also just tested on strawberry win32 perl.
 
From: Thomas George [mailto:[email protected]] 
Sent: 2009-02-25 11:51
To: Robert Davis
Cc: [email protected]
Subject: Re: PAR/pp with folders
 
Robert,
 
Thanks for getting back to me.  I'll try the sample code you've provided
as soon as my schedule allows..!
 
Just so I understand: is the solution likely to be found in how I am
using PAR/pp, or is the issue more related to my script's ability to
find the text files and executibles I am adding to the resulting .exe..?
 
Currently, my release process has me making the .exe with pp, and then
adding it, along with the folder and CLI executible to a .zip file or an
iso image, for distribution; this works fine, however, the CLI
executibles are not part of the OSes we support, and we would like to
control their release by hiding them in the .exe .. it also makes sense
that the text files I am using should be controlled and versioned, as
part of an official release, and I think it makes sense to physically
include them and and logically reference them in the .exe so that they
cannot be easily modified and used with the script.
Many thanks for all your help..!
 
Thomas
On Wed, Feb 25, 2009 at 6:26 AM, Robert Davis <[email protected]>
wrote:
I made a small test pgm

Copy a text file to a dir/file: parinctest/test.txt

Compile with:
pp -o testpp.exe -a parinctest testpp.pl

and the result should be the gui version of the vim editor will popup.

------------------------ testpp.pl
#!/usr/bin/perl -w
use warnings;
use File::stat;
use strict;

my $file = "test.txt";
my $cyg = PAR::read_file("parinctest/$file");
open (TMP, ">$file") or print STDERR "cant open output $file $!\n";
binmode(TMP);
print TMP $cyg;
close TMP;
PrtStat($file);
system("gvim.exe $file");

sub PrtStat {
       my ($file) = @_;
       my $sb = stat($file);
       if ($sb) {
               printf
"%s:size=%s:perm=%04o:uid=%d:guid=%d:mtime=%s:atime=%s:ctime=%s\n",
                               $file, $sb->size, $sb->mode & 07777,
                               $sb->uid, $sb->gid,
                               scalar localtime $sb->mtime,
                               scalar localtime $sb->atime,
                               scalar localtime $sb->ctime;
       } else {
               printf "%s:not found\n", $file,
       }
}
-----------------------


> -----Original Message-----
> From: Thomas George [mailto:[email protected]]
> Sent: 2009-02-24 19:50
> To: [email protected]
> Subject: Re: PAR/pp with folders
>
> Still striking out on this... I thought I have a working solution,
however
> this dosn't work the way I thought it would.
>
> I need to keep a set of txt files, as well as CLI executibles in the
> executible created by pp, however the files in the folder 'txt' are
not
> accessible, nor is the CLI .exe I'd like to add to the executible I'm
> creating.
>
> This is what I'd like:
> pp file.pl command.exe -a txt -o file.exe
> .
> ..
> file.pl (PERL Script)
> command.exe (DOS CLI executible)
> txt (folder)
>    |
>    file1.txt (text file)
>    file2.txt (text file)
>    file3.txt (text file)
>    file4.txt (text file)
>
> Q: Is this a function that is currently supported by PAR/pp, and do I
just
> not knowhow to use it..?
>
> My thanks,
>
> Thomas
>
> On Wed, Feb 18, 2009 at 10:11 PM, Thomas George
> <[email protected]>wrote:
>
> > Nevermind, I got it..
> >
> >     pp file.pl -a folder -o file.exe
> >
> > Thomas
> >
> >   On Wed, Feb 18, 2009 at 5:04 PM, Thomas George <
> > [email protected]> wrote:
> >
> >> I'm not sure if this is just outside the functionality of PAR/pp,
but I've
> >> been able to find documentation on how to do this and would
appreciate some
> >> insight.
> >>
> >> What I would like to do is include one or more folders along with
various
> >> other files in a single executible.
> >>
> >> The error I am getting is:
> >> Cannot open txt: Permission denied at
C:/Perl/site/lib/Module/ScanDeps.pm
> >>
> >> Is there a switch I need to use to identify this 'txt' as a
folder..?
> >>
> >> Many thanks,
> >
> >
> >
 

Reply via email to