http://www.perlmonks.org?node_id=1137816


in reply to General advice desperately needed

I have successfully produced .exe files with pp (Tk included): The resulting .exe takes relatively long to startup because pp essentially makes a copy of perl's runtime system which has to be unpacked more or less on every run.

As I'm the Admin anyway, I found it better to copy the perl folder and the folder containing script + additional needed files to the target and create a .lnk with target "{perl folder}\perl\bin\wperl.exe" xxxxx.pl {additional parameters}, and execute in the folder that contains the script.

P.S. the "cmd /c" is there because actually, I put it into a .cmd batch, and pp is also a .cmd a .bat file. Now that I think of it, I should have made a perl script and calling pp from there…

Update: Still not optimal (argument setting for pp, error checking), but here you go:
use 5.011; # implies strict + feature 'say' use warnings; use pp; use Win32::Exe; my $name = shift; my ( $script, $exefile, $icon ) = map { "$name.$_" } qw(pl exe ico); say "creating $exefile from $script"; @ARGV = qw(-g -o); push @ARGV, $exefile, $script; pp->go(); say "setting icon from $icon"; my $exe = Win32::Exe->new($exefile); $exe->set_single_group_icon($icon); $exe->write;

Replies are listed 'Best First'.
Re: EXE from Script (Re: General advice desperately needed)
by Anonymous Monk on Aug 08, 2015 at 00:14 UTC