Editing
Developing and Distributing wxPerl Applications on Windows
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Creating Windows EXEs == This section is more of a work in progress since a reliable method of distributing single file executables (or developing installation packages for Windows) is still an open question, there is hope that this will end up being a relatively smooth process. Needless to say, it is critical for Perl developer to be able to distribute Perl based GUI applications as single file (.exe) or via installation on Windows. The client should NOT need to be running through any of the instructions above to run a program that you would like to sell them for actual money. Below are the initial instructions for generating an EXE file. There are also many ways that wxPerl developers go about doing, based on their use case and experience. === PAR::Package and WX::Perl::Packager === ==== Step 1 - Install PAR::Package and Wx::Perl::Packager ==== <code><big>C:\> cpanm --verbose PAR::Package Wx::Perl::Packager</big></code> ==== Step 2 - Generate the EXE ==== Assuming you have a Perl script generated either via wxGlade (see above) or one you have created/updated by hand, the command is as follows: <code><big>C:\> wxpar YOURPROGRAM.pl -o YOURPROGRAM.exe</big></code> ===== Important Notes About wxGlade Generated Code ===== # earlier versions of wxGlade introduced an improper idiom at the bottom of the generated Perl script that caused a problem when running via a PAR::Packed packed executable. TLDR; remove the "unless(caller)" block and just run the Wx event loop unfettered. For more information, please read the [https://metacpan.org/dist/PAR/view/lib/PAR/FAQ.pod#If-I-try-to-compile-my-wxGlade-generated-script%2C-it-doesn%27t-run.-What%27s-wrong%3F PAR::FAQ.] # earlier versions of wxGlade also used a non-Exporter import tage that wxpar could not properly follow; see the code "before" and "after" below: use Wx qw[:allclasses]; use strict; ... package main; unless(caller){ my $local = Wx::Locale->new("English", "en", "en"); # replace with ?? $local->AddCatalog("app"); # replace with the appropriate catalog name my $app = MyApp->new(); $app->MainLoop(); } Should be modified to look like the following: use Wx qw; use strict; ... package main; my $local = Wx::Locale->new("English", "en", "en"); # replace with ?? $local->AddCatalog("app"); # replace with the appropriate catalog name my $app = MyApp->new(); $app->MainLoop(); See [https://github.com/wxGlade/wxGlade/issues/568 this Github issue] for wxGlade, where both were fixed. At the time of this writing, the changes. have not been put out in an official release; but they are applied in the master branch. === PPL (portable Perl loader) === ... to fill in
Summary:
Please note that all contributions to Perl Guilds - Getting Medieval with Perl may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Perl Guilds - Getting Medieval with Perl:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information