On Nov 28, 2007 6:39 PM, Scott Stanton <[EMAIL PROTECTED]> wrote:
> I'm trying to ship a self contained application to our customers. We
> are not allowed to dictate to the customer what versions of perl and
> installed packages they may have on their machine outside of our
> installation directory. They may not even have an installed perl. We
> certainly can't rely on them having compilers, etc. For us, the point
> of wrapping the apps is to provide a single self-contained binary for
> each tool that can be copied to any directory without external
> dependencies.
>
> We don't know what directory they will install our application into when
> we build the application, so a single fixed cache directory doesn't
> really work unless it's settable after the fact.
Now I think I understand what you really want:
(1) a mechanism to determine everything that's used by your application
(2) arrange all this stuff below some given directory
(3) have it work when started from there even when the given directory
has been moved around
The fact that pp produces a self-extracting executable is irrelevant
for this goal except that this achieves (1), (2) (with stuff being just the
executable) and (3) (if the cache directory could be changed after
building the executable). But you could instead simply ship a zip file
to your customers that they can unzip anywhere and then run
the application from there as is (if it could be made "self-relocatable")
or apply a separate relocation step as part of the installation procedure?
In fact, wouldn't the following work:
Assuming that you already have (1) and (2) with
- all Perl modules (including glue dlls) in blib-style layout under blib/
- all other needed dlls under lib/
- your perl scripts under scripts/
- the perl executable perl.exe copied into the toplevel directory
Now wrap every scripts/foo.pl with foo.bat that does the following:
- determine the directory it is run from (I think current Windows scripting
host will give you that), say $here
- execute
$here/perl.exe $here/prolog.pl $here $here/scripts/foo.pl
rest-of-original-arguments
And prolog.pl does:
my $here = shift @ARGV
my $script = shift @ARGV
set library search path to "$here/lib"
clear @INC
use blib "$here/blib" # but "by hand", don't actually use "use"
or "blib" or any other module
do $script;
Cheers, Roderich
-