Developing and Distributing wxPerl Applications on Windows: Difference between revisions
(Created page with "== Introduction == This article is about installing wxPerl under Strawberry Perl for application development and distribution as a Windows executable. == Installation == === Strawberry Perl === === Alien::wxWidgets === === Wx === === Wx::Demo === === wxGlade === == Development Workflow Notes == == Packaging and Distributing Windows Executables ==") |
No edit summary |
||
Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
This article is about installing wxPerl under Strawberry Perl for application development and distribution as a Windows executable. | This article is about installing wxPerl under Strawberry Perl for application development and distribution as a Windows executable. | ||
Instructions are provided with the versions detailed below. If there are newer versions of any of the modules, you may try it out (of course); but understand they have not been tried out and shown to work like version combinations below. | |||
== Installation == | == Installation == | ||
=== Strawberry Perl === | === Step 1 - Install Strawberry Perl === | ||
Install via following link, | |||
<big>https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54001_64bit_UCRT/strawberry-perl-5.40.0.1-64bit.msi</big> | |||
=== Step 2 - Install Alien::wxWidgets (v 0.70) === | |||
Once Perl is installed, look in the Start menu for the Perl "cmd" window or open up PowerShell | |||
* go to "'''Start menu'''" > ''Strawberry Perl'' > "'''Perl (command line)'''" | |||
* click the Start menu item, it'll open up a Windows CMD window (traditional black DOS prompt) | |||
Type the command at the "C:" prompt, | |||
<code><big>C:\> cpanm --verbose <nowiki>https://github.com/sciurius/wxPerl/releases/download/R3.004/Alien-wxWidgets-0.70.tar.gz</nowiki></big></code> | |||
=== Step 3 - Install Wx (v 3.005) === | |||
<big><code>C:\> cpanm --verbose <nowiki>https://github.com/sciurius/wxPerl/releases/download/R3.005/Wx-3.005.tar.gz</nowiki></code></big> | |||
== Verify Installation == | |||
=== Install Wx::Demo === | |||
Wx::Demo is nice demonstration application, highlight many (if not all) of the wxWidget features available via xPerl. | |||
<big><code>C:\> cpanm --verbose Wx::Demo</code></big> | |||
.. then once installed, run it with this command (which is available in the PATH already), | |||
<big><code>C:\> wxperl_demo.pl</code></big> | |||
=== | === Install wxGlade === | ||
[https://sourceforge.net/projects/wxglade/ wxGlade] is a GUI builder for wxWidgets applications. It is written in Python, but critically supports outputing Perl code. It is actively developed, the developer is very responsive on Github to bugs and feature requests. It is the closest thing we have in Perl to a RAD (rapid application development) environment (e.g., [https://www.lazarus-ide.org/ Lazarus] for FreePascal). | |||
=== wxGlade === | === Step 1 - Install Python 3.10 for Windows === | ||
Install via following link, | |||
https://www.python.org/ftp/python/3.12.8/python-3.12.8-amd64.exe ([https://www.python.org/downloads/windows/ linked here]) | |||
=== Step 2 - Download and unzip wxGlade === | |||
https://github.com/wxGlade/wxGlade/archive/refs/tags/v1.1.0.zip | |||
Via Windows CMD terminal, navigate to the unzip'd directory and run the command, | |||
<big><code>C:\> python wxglade.py</code></big> | |||
== Development Workflow Notes == | == Development Workflow Notes == | ||
== Packaging and Distributing Windows Executables == | == Packaging and Distributing Windows Executables == | ||
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. | |||
=== 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><!-- Note, that 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 PAR::FAQ. --> |
Revision as of 01:04, 24 January 2025
Introduction
This article is about installing wxPerl under Strawberry Perl for application development and distribution as a Windows executable.
Instructions are provided with the versions detailed below. If there are newer versions of any of the modules, you may try it out (of course); but understand they have not been tried out and shown to work like version combinations below.
Installation
Step 1 - Install Strawberry Perl
Install via following link,
Step 2 - Install Alien::wxWidgets (v 0.70)
Once Perl is installed, look in the Start menu for the Perl "cmd" window or open up PowerShell
- go to "Start menu" > Strawberry Perl > "Perl (command line)"
- click the Start menu item, it'll open up a Windows CMD window (traditional black DOS prompt)
Type the command at the "C:" prompt,
C:\> cpanm --verbose https://github.com/sciurius/wxPerl/releases/download/R3.004/Alien-wxWidgets-0.70.tar.gz
Step 3 - Install Wx (v 3.005)
C:\> cpanm --verbose https://github.com/sciurius/wxPerl/releases/download/R3.005/Wx-3.005.tar.gz
Verify Installation
Install Wx::Demo
Wx::Demo is nice demonstration application, highlight many (if not all) of the wxWidget features available via xPerl.
C:\> cpanm --verbose Wx::Demo
.. then once installed, run it with this command (which is available in the PATH already),
C:\> wxperl_demo.pl
Install wxGlade
wxGlade is a GUI builder for wxWidgets applications. It is written in Python, but critically supports outputing Perl code. It is actively developed, the developer is very responsive on Github to bugs and feature requests. It is the closest thing we have in Perl to a RAD (rapid application development) environment (e.g., Lazarus for FreePascal).
Step 1 - Install Python 3.10 for Windows
Install via following link,
https://www.python.org/ftp/python/3.12.8/python-3.12.8-amd64.exe (linked here)
Step 2 - Download and unzip wxGlade
https://github.com/wxGlade/wxGlade/archive/refs/tags/v1.1.0.zip
Via Windows CMD terminal, navigate to the unzip'd directory and run the command,
C:\> python wxglade.py
Development Workflow Notes
Packaging and Distributing Windows Executables
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.
Step 1 - Install PAR::Package and Wx::Perl::Packager
C:\> cpanm --verbose PAR::Package Wx::Perl::Packager
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:
C:\> wxpar YOURPROGRAM.pl -o YOURPROGRAM.exe