NAME
Wx::Perl::Packager
VERSION
Version 0.16
SYNOPSIS
For All Packagers:
At the start of your script ...
#!c:/path/to/perl.exe
use Wx::Perl::Packager;
.....
or if you use threads with your application
#!c:/path/to/perl.exe
use threads;
use threads::shared;
use Wx::Perl::Packager;
Wx::Perl::Packager must be loaded before any part of Wx so should appear at the
top of your main script. If you load any part of Wx in a BEGIN block, then you
must load Wx::Perl::Packager before it in your first BEGIN block. This may cause
you problems if you use threads within your Wx application. The threads
documentation advises against loading threads in a BEGIN block - so don't do it.
For PerlApp
To start perlapp gui run 'wxpdk' without any arguments.
To use perlapp from the command line you can use wxpdk to create argument file
wxpdk -A argfile.args
then: e.g.
perlapp @argfile.args--norunlib --gui --exe foo.exe foo.pl
To create a full .perlapp file without loading GUI
wxpdk -S foo.pl -P foo.parlapp
All options to wxpdk are
-S scriptname to package
-P perlapp file to write
-A args file to write with wxPerl dependencies
-H print these options
Wx::Perl::Packager does not support the --dyndll option for PerlApp.
Wx::Perl::Packager does not support the --clean option for PerlApp
Wx::Perl::Packager works with PerlApp by moving the following bound or included
wxWidgets files to a separate temp directory:
base
core
adv
mingwm10.dll if present
gdiplus.dll if needed by OS.
The name of the directory is created using the logged in username, wxWidgets versions
and the file sizes of the wxWidgets DLLs. This ensures that your application gets the
correct Wx dlls whilst also ensuring that only one permanent temp directory is ever
created for a unique set of wxWidgets DLLs
All the wxWidgets dlls and mingwm10.dll should be bound as 'dllname.dll'.
(i.e. not in subdirectories)
The wxpdk utility takes care of this for you for PDK versions less than 8.x
For PDK versions 8 and above, wxpdk should not be used.
For PAR
run 'wxpar' exactly as you would run pp.
e.g. wxpar --gui --icon=myicon.ico -o myprog.exe myscript.pl
NOTE: For PAR::Packer, if you are distributing wxWidgets libs with
GDI+ support (wxGraphicsContext) and you don't use wxpar, you must
distribute gdiplus.dll separately for those Windows operating systems
that require it.
For Perl2Exe
At the start of your script ...
#!c:/path/to/perl.exe
BEGIN { use Wx::Perl::Packager; }
use Wx::Perl::Packager;
Note that for Perl2Exe if you load Wx::Perl::Packager within a BEGIN block, you
must also 'use' it outside the BEGIN block. The version of Perl2Exe that I
tested does not seem to parse BEGIN blocks.
within your script include markers for each of the
wxWidgets DLLs
e.g
#perl2exe_bundle C:/Perl/site/lib/Alien/wxWidgets/msw_2_8_7_uni_gcc_3_4/lib/wxmsw28u_core_gcc_wxperl.dll
#perl2exe_bundle C:/Perl/site/lib/Alien/wxWidgets/msw_2_8_7_uni_gcc_3_4/lib/wxbase28u_gcc_wxperl.dll
DESCRIPTION
This module assists in packaging wxPerl applications using PerlApp, PAR and Perl2Exe.
Usage is simple: use Wx::Perl::Packager;
The module also provides methods, some of which are probably only useful during
the packaging process.
Also provided are:
wxpdk (PerlApp version 7.x and below )
wxpar
which assist in packaging the wxWidgets DLLs.
GDI+
Recent versions of wxWidgets may require access to GDI+.
This is part of the operating system for MS Windows XP and later. For earlier
versions of Windows, a redistributable of gdiplus.dll is required and
available from MS.
You should bind this to your executable as
gdilib/gdiplus.dll
For PDK/PerlApp - do not automatically extract at runtime.
For PAR, add using --addfile option.
If you do this, Wx::Perl::Packager will determine the operating system version
at runtime and extract gdiplus.dll to the path if the host OS requires
it.
Methods
- Wx::Perl::Packager::runtime()
-
returns PERLAPP, PARLEXE, PERL2EXE or PERL to indicate how the script was executed. (Under PerlApp, pp packaged PAR, Perl2Exe or as a Perl script. my $env = Wx::Perl::Packager::runtime();
- Wx::Perl::Packager::packaged()
-
returns 1 or 0 (for true / false ) to indicate if script is running packaged or as a Perl script. my $packaged = Wx::Perl::Packager::packaged();
- Wx::Perl::Packager::get_wxpath()
-
returns the path to the directory where wxWidgets library modules are stored. Only useful when packaging a script. my $wxpath = Wx::Perl::Packager::get_wxpath();
- Wx::Perl::Packager::get_wxboundfiles()
-
returns a list of hashrefs where the key value pairs are: boundfile => the relative name of the file when bound (e.g mydir/myfile.dll) file => the source file on disc autoextract => 0/1 should the file be extracted on startup Only useful when packaging a script. If called within a packaged script, returns an empty list. In addition to the wxWidgets dlls, this function will also return the external and required bound location of the gdiplus.dll if present in Alien::wxWidgets. If bound to the packaged executable at the required location, Wx::Perl::Packager will ensure that gdiplus.dll is on the path if your packaged executable is run on an operating system that requires it. my %wxlibs = Wx::Perl::Packager::get_wxboundfiles();
- Wx::Perl::Packager::get_wxlibraries()
-
This function is deprecated. Use get_wxboundfiles() instead. returns a list of the full path names of all wxWidgets library modules. Only useful when packaging a script. If called within a packaged script, returns an empty list. Use Wx::Perl::Packager::get_wxlibraries(); my @wxlibs = Wx::Perl::Packager::get_wxlibraries();
AUTHOR
Mark Dootson, <mdootson at cpan.org>
DOCUMENTATION
You can find documentation for this module with the perldoc command.
perldoc Wx::Perl::Packager
ACKNOWLEDGEMENTS
Mattia Barbon for wxPerl.
COPYRIGHT & LICENSE
Copyright 2006 - 2010 Mark Dootson, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 464:
'=item' outside of any '=over'
- Around line 515:
You forgot a '=back' before '=head1'