in reply to General advice desperately needed
I have successfully produced .exe files with pp (Tk included):
- I used the "portable" version of Strawberry
- installed Tk from CPAN
- installed PAR::Packer from CPAN (which contains pp)
- for changing the application Icon (for double-clicking), I installed Win32::Exe from CPAN
- for the title bar logo, I grabbed and adapted Tk::ToplevelIcon from Re: Perl TK changing the logo
- then created the .exe like this: cmd /c pp -v -g -o xxxxx.exe xxxxx.pl perl -e "use Win32::Exe; $exe = Win32::Exe->new('xxxxx.exe'); $exe->se +t_single_group_icon('xxxxx.ico'); $exe->write;"
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…
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 |
In Section
Seekers of Perl Wisdom