Am using Net::SSH2 module in my Perl script and trying to make an executable (.exe for windows) using Par::Packer. The script need to ssh to a linux box from a windows box using public keys and don't want to input password.
Am facing the below error while running the .exe
Can't load 'C:\Users...\AppData\Local\Temp\par-73656172756d7567616d\cache-a6d57d5a234829aae84d08c4a78a09ad307ea8d3\a9057da2.xs.dll' for module Net::SSH2: load_file:The specified module could not be found at C:/Strawberry/perl/lib/DynaLoader.pm line 193. at C:/Strawberry/perl/vendor/lib/PAR/Heavy.pm line 123.
Tried to workaround with the below methods but none of them worked
- Tried to pack from a portable version of Strawberry Perl
- Tried to link a9057da2.xs.dll while packing using Par::Packer
Is there any workaround or fix for packing the perl scrip to .exe with Net:SSH2. Or are there alternatives to Net::SSH2 for ssh from windows to Linux using public keys (not passing passwords)?
Probably you are not packing the
libssh2andopensslDLLs inside the executable.Par::Packerdoes not detect DLL dependencies automatically, you need to tell it explicitly which ones your program needs (a simple way to discover which DLLs your program needs is to use Process Monitor, an utility which allows one to monitor process activity).Another option is to use my module Win32::Packer to pack the application which does find DLL dependencies automatically.