Subject: | DLL loading directories |
Date: | Wed, 27 Nov 2019 10:26:23 +0000 |
To: | "bug-Perl-Dist-Strawberry [...] rt.cpan.org" <bug-Perl-Dist-Strawberry [...] rt.cpan.org> |
From: | Jose Luis Martínez Torres <joseluis.martinez [...] capside.com> |
Hi,
We're starting to use the portable version of Strawberry Perl to distribute an application (instead of depending on Strawberry Perl being preinstalled on the system). Since the app depends on IO::Socket::SSL, OpenSSL gets compiled. When invoking our scripts, IO::Socket::SSL errors out saying it can't find a DLL. We're invoking wperl.exe directly (so we don't get DOS windows opened). The problem is basically that when invoking wperl.exe directly (or perl.exe also), the PATH is not set to STRAWBERRY_PATH\c\bin\, where the appropiate DLLs are (this is what is done by portableperl.bat, but we don't want to invoke portableperl.bat, since we get a DOS window opened). We've found that we can work around this issue by adding in out scripts the path to "\c\bin" in $ENV{PATH} before any DLL loading ocurrs.
I'm wondering if there is a way to compile stuff with portable perl so that the PATH doesn't have to be set beforehand to "\c\bin". Can the destination of the compiled C libraries be controlled? (since I'd try to put them in a place where Windows searches by default). Maybe Portable Perl can do something to facilitate finding these DLLs in "\c\bin"? Windows does have a way to influence the places where DLLs are searched https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order.
Can we make this situation easier for users of Portable Perl?
Best Regards,
JLMARTIN