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!
=== PAR::Package, App::PP::Autolink, and WX::Perl::Packager === ==== Step 1 - Install PAR::Package, App::PP::Autolink, and Wx::Perl::Packager ==== <code><big>C:\> cpanm --verbose PAR::Package App::PP::Autolink Wx::Perl::Packager</big></code> '''Note''': <code>pp_autolink</code>, provided by <code>App::PP::Autolink</code> has proven to be absolutely critical to finding the required DLLs that need to be added manually to the <code>wxpar</code> command below via the <code>--link</code> flag. ==== 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; 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. ==== Special Cases ==== ===== <code>Makefile</code> for an Application uses HTTP::Tiny and calls out to SSL-enabled sites ===== Example - [https://github.com/StormSurgeLive/nhc-advisory-gui/blob/master/asgs-storm-bug.pl https://github.com/StormSurgeLive/nhc-advisory-gui/l] (copied from the [https://github.com/StormSurgeLive/nhc-advisory-gui/blob/master/Makefile Makefile]) - Note, mentions using [https://metacpan.org/pod/App::PP::Autolink App::PP::Autolink] to sus out required DLLs (provides <code>pp_autolink</code>, which helped!) all: wxpar --verbose -o ./dist/nhc-explorer.exe -l c:/strawberry/c/bin/libcrypto-3-x64__.dll -l c:/strawberry/c/bin/zlib1__.dll -l c:/strawberry/c/bin/libssl-3-x64__.dll ./asgs-storm-bug.pl --gui wxpar --verbose -o ./dist/DEBUG-nhc-explorer.exe -l c:/strawberry/c/bin/libcrypto-3-x64__.dll -l c:/strawberry/c/bin/zlib1__.dll -l c:/strawberry/c/bin/libssl-3-x64__.dll ./asgs-storm-bug.pl # It was an adventure finding all the dependencies related to the wxpar command, # particularly those around what was needed, the basic process entailed: # 1. use wxpar, which generates an options files with all the Wx DLLs # 2. installed, App::PP::Autolink, which provides the utility "pp_autolink"; this # utility scans the .pl file you're packing (in this case, "asgs-storm-bug.pl,") # for DLLs - lo' and behold, it found the ones I needed; in particular the critical # one that was not getting picked up by pp or wxpar, "libcrypto-3-x64___.dll!" # 3. ran the "wxpar" command above # 4. tested in a non-Strawberry Perl window (MSYS2 terminal) using the command, # # PERL_DL_DEBUG=5 dist/nhc-explorer.exe # # I learned about this command while searching, here: # # https://stackoverflow.com/questions/423330/why-cant-dynaloader-pm-load-ssleay-dll-for-netssleay-and-cryptssleay # ==== Important Note About Finding all DLLs ==== It is worth repeating that <code>pp_autolink</code>, provided by <code>App::PP::Autolink</code> has proven to be absolutely ''critical'' to finding the required DLLs that need to be added manually to the <code>wxpar</code> command below via the <code>--link</code> flag. If you are having problems finding all the DLLs (some which may not be obvious until the EXE generated is tried on a different machine,) you need to give <code>pp_autolink</code> a shot.
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