Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Embedding extra DLLs into .exe *and finding* them again

by tarmes (Initiate)
on Jul 30, 2009 at 14:02 UTC ( [id://784618]=note: print w/replies, xml ) Need Help??


in reply to Re: Embedding extra DLLs into .exe *and finding* them again
in thread Embedding extra DLLs into .exe *and finding* them again

Hi,

Thank you for responding.

The failure is at run time. If the DLLs are in the same folder as the exe then it works perfectly. If they're not, then the application fails with an error message stating that it can't find the DLLs (even though they're embedded in the exe).

The original exe didn't have this issue. The embedded DLLs were extracted somewhere then located by Windows when needed.

Would setting the PATH variable from within the application work? I did try playing with this idea, but I got the impression that the exe tried to locate the DLLs before the code got started, and that setting PATH was happening too late. Maybe I was doing something wrong?

The source code doesn't currently modify PATH so I assume that this wasn't necessary for the original "compile"?

I'm actually new to Perl as a language. If there's an example somewhere of setting the PATH variable to point to the location of the extracted exes when using either PAR or Perl2exe then I'd be grateful.

Tim

  • Comment on Re^2: Embedding extra DLLs into .exe *and finding* them again

Replies are listed 'Best First'.
Re^3: Embedding extra DLLs into .exe *and finding* them again
by Anonymous Monk on Jul 30, 2009 at 16:32 UTC
    You might start by reading your perl compiler docs they should tell you where files are extracted to and how to access them. I ASSUME that you're using the DLLs due to a requirement by a module you're using. If so you could place a BEGIN{} block at the top of the script to ensure your PATH changes are done before the modules are used. Modifying the path variable should be as easy as $ENV{'PATH'} .= ';C:\Path\to\directory'; Note I'm including the preceding semi-colon in my path string - and the .= appends my string to the end of the existing PATH value. But I'm just flying from the seat of my pants here. Check the wonderfully useful perldoc website and search for %ENV for how to access/modify environment variables.
Re^3: Embedding extra DLLs into .exe *and finding* them again
by Marshall (Canon) on Jul 30, 2009 at 16:47 UTC
    Sorry, but I am doubting this DLLs (even though they're embedded in the exe) part. How did you determine that this embedding occurred correctly?

    On ActiveState, I manually installed this SSL stuff and wound up putting the .DLL's into a bunch of places so that PerlApp could find them. C:\Perl\bin, Windows, \Windows\system. I remember this being a mess. I have libeay32.dll in C:\Perl\bin and both of these DLL's in the normal Windows places for the other DLL's.

    Sounds like you don't have these DLL's in the .exe otherwise they would be found and used even to the exclusion of any .DLL's in the .exe directory.

    by definition any "standalone .exe" will run without any .DLL's on the target machine at all!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://784618]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-23 15:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found