I see.

But you give up the niceness of having a single binary to distribute.

-- Johan

On Fri, 20 Jan 2017 18:15:06 +0100, "bubnikv ." <bubn...@gmail.com> wrote:

> you may instruct the PAR packer to create a PAR archive. Just rename it to
> zip and open it to view the files it collected.
> Or run PAR packer with the -v parameter to let it print out the
> dependencies.
> 
> Then you just need to collect the perl.exe, perl.dll, all the referenced
> perl modules and their binary dll counterparts into a similar structure to
> the perl installation. As the strawberry perl is relocatable, it will
> search for the perl modules and dlls relatively to its installation path.
> 
> In regard to the exe you want to create, you need to compile a following c
> file to produce the exe:
> 
> #include <EXTERN.h> // from the Perl distribution
> #include <perl.h> // from the Perl distribution
> 
>     // Perl win32 specific includes, found in perl\\lib\\CORE\\win32.h
>     // Defines the windows specific convenience RunPerl() function,
>     // which is not available on other operating systems.
>     #include <win32.h>
>     // the standard Windows. include
>     #include <Windows.h>
> 
>     int main(int argc, char **argv, char **env)
>     {
>         char exe_path[MAX_PATH] = {0};
>         char drive[_MAX_DRIVE];
>         char dir[_MAX_DIR];
>         char fname[_MAX_FNAME];
>         char ext[_MAX_EXT];
>         char script_path[MAX_PATH];
>         char** command_line = (char**)malloc(sizeof(char*) * ((++ argc) +
> 1));
>         GetModuleFileNameA(NULL, exe_path, MAX_PATH-1);
>         _splitpath(exe_path, drive, dir, fname, ext);
> _makepath(script_path, drive, dir, NULL, NULL);
> SetDllDirectoryA(script_path);
>         _makepath(script_path, drive, dir, "your_main_perl_script", "pl");
>         command_line[0] = exe_path;
>         command_line[1] = script_path;
>         memcpy(command_line + 2, argv + 1, sizeof(char*) * (argc - 2));
>         command_line[argc] = NULL;
>         RunPerl(argc, command_line, NULL);
>         free(command_line);
>     }
> 
> 
> On Fri, Jan 20, 2017 at 5:02 PM, Johan Vromans <jvrom...@squirrel.nl>
> wrote:
> 
> > On Fri, 20 Jan 2017 16:42:20 +0100, "bubnikv ." <bubn...@gmail.com>
> > wrote:
> >
> > > The way I chose is to completely skip the PAR archive, collect the
> > > files manually (maybe use the PAR packer just to discover the
> > > dependencies) and then to compile an exe wrapper over perl.dll.
> >
> > Would you be so kind to explain this approach in a bit more detail?
> >



-- 
----------------------------------------------------------------------------
Johan Vromans                                           jvrom...@squirrel.nl
Squirrel Consultancy                                  Exloo, the Netherlands
http://www.squirrel.nl                              http://johan.vromans.org
PGP Key 1024D/1298C2B4                  http://johan.vromans.org/pgpkey.html
----------------------- "Arms are made for hugging" ------------------------

Reply via email to