Subject: | PP prepends temp directory to system PATH |
Date: | Fri, 27 Sep 2013 19:22:10 +0000 |
To: | "bug-PAR [...] rt.cpan.org" <bug-PAR [...] rt.cpan.org> |
From: | Warren Hulme <whulme [...] cognivue.com> |
Windows XP SP3
Cygwin 2013-07-22
Strawberry PERL, 5.16.3
PP Packager, version 1.014 (PAR version 1.007)
When running a windows .EXE created by PP, the $PATH environment variable does not accurately reflect the system path which was present at the time the EXE was invoked. Specifically PP/PERL prepend a temp path, containing libraries such as libstdc++-6.dll contained in the PP-generated .EXE.
This can potentially cause problems, if the PERL script packaged in the EXE by PP invokes tools or utilities from the system which rely on different versions of runtime libraries or packages that are contained in the packaged EXE.
This problem can be worked around by running the following, at the start of any PERL code packaged by PP that relies on the correct system path contents:
use Env;
my @path = split(/$Config::Config{path_sep}/, $PATH);
shift @path;
my $fixedPath = join ($Config::Config{path_sep}, @path);
$PATH = $fixedPath;
Warren Hulme