Re: General advice desperately needed
by GrandFather (Saint) on Aug 06, 2015 at 23:53 UTC
|
cpan Tk from a command prompt will fix the Tk issue.
The "standalone Windows .exe" bit is more of a problem. Perl is not a great fit for applications of that sort. There are tools like Cava Packager that wrap up a Perl script and whatever it needs into something that acts like a stand alone executable, but it can be a bit of work to get going nicely.
Asking here about specific issues is a good way to get back into the swing of Perl, and rfc's (request for comment) on modest chunks of code would be a good sanity check to see that you are on a good track (there is no one "right track" in Perl).
Premature optimization is the root of all job security
| [reply] [d/l] |
EXE from Script (Re: General advice desperately needed)
by soonix (Chancellor) on Aug 07, 2015 at 09:25 UTC
|
I have successfully produced .exe files with pp (Tk included):
The resulting .exe takes relatively long to startup because pp essentially makes a copy of perl's runtime system which has to be unpacked more or less on every run.
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…
Update: Still not optimal (argument setting for pp, error checking), but here you go: 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;
| [reply] [d/l] [select] |
|
|
| [reply] |
Re: General advice desperately needed
by BrowserUk (Patriarch) on Aug 07, 2015 at 01:15 UTC
|
For Tk, try AS perl. Pick a version, then point PPM at Bribes.org and install Tk from there.
For the (re)learning thing; I have two pieces of advice:
- Start.
The sooner you start, the sooner you'll be able to frame specific questions for us to help you with.
- Detail (for yourself as much as anyone), why does your application need to be an .exe?
It isn't hard to install AS perl -- not much more complicated than installing a Android App; and billions of non-tech users can do that.
And the second step of downloading your application should be simpler still -- if you do it right.
If it is "A rather complex application"; then the users will need to have a certain level of smarts in order to use it, no matter how simple you contrive to make the interface; so maligning those same users as idiots is disingenuous. Give them some credit.
If you can document downloading AS perl
click this link; click "run"; wait; click "next"; click "I accept ..."; click "next"; click "next"; click "install"; wait; click "finish". (That took all of 5 minutes.)
Then you can do the same for setting up PPM to use Bribes; and then installing Tk.
And the same again for downloading your application.
And, in the process you've weeded out 95% of those that would become maintenance and support nightmares if you delivered your application more simply; they just won't get far enough to bother you.
| [reply] |
|
|
Ah, I was not clear. These people are cowboys, literally, horses, cattle, that sort of thing. This application runs of a potpourri of laptops, few of them even manufactured in this century, and none, as in none, of them have any sort of on-line access. The only reason they even have these machines is to run this application. Literally. Hence the desire for an exe file.
The application exists and has done so for the last 16 or so years implemented as an Excel workbook (actually 3 Excel workbooks). It is inarguably complex, pretty much pushing Excel to its limits, and the people who use it are fine human beings but when it comes to all things digital, they are woefully lacking in anything resembling comprehension of just what might be going on.
Excel was first chosen lo those many years ago because the thing started out a a simple list of entrants for team penning and ranch sorting events. Of couse nothing of this nature ever remains simply this or that. It has evolved over the years into a comprehensive package for singing up entrants, drawing teams both for draw pot events and order of go, maintaining rating information for any and all entrants, creating multiple incentive events within single events, handling any number of separate events concurrently, providing sound playback, a reasonable sophisticated event time, large screen arena display driver, jackpot and event accounting, and a host of other things. All the while being configurable such that virtually any penning or sorting format (there are well over 10^7 possible ways to conduct one of these things)
Excel's reach has exceeded its grasp. It's a nightmare trying to keep one version of this thing (there's only me) alive and operating over a ragtag collection of windows and Excel versions. I have reached a tipping point. While I'm fully appreciative of Excel's list handling abilities, and VBA and all of that, it's just grown out of the realm of one simple set of files for everyone. Excel is rebelling, inexplicably running here, not running there, and I tire of it.
I've always liked Perl but Visual Basic is also a possibility, it has a bit more sophisticated Windows capability but it's data handling is sometimes less than what I want. More importantly, I don't enjoy VB, I do Perl.
That being the case, I'm willing to deal with creating a decent GUI with Tk, primitive though it might be, and go with Perl.
| [reply] |
|
|
... and you said that you had retired? .... (wink!) ...
| [reply] |
Re: General advice desperately needed
by Discipulus (Canon) on Aug 07, 2015 at 08:05 UTC
|
| [reply] [d/l] |
Re: General advice desperately needed
by Anonymous Monk on Aug 07, 2015 at 00:26 UTC
|
Start with Modern Perl a loose description of how experienced and effective Perl 5 programmers work....You can learn this too.
For more tutorials that are also quality see Perl Tutorial Hub
Tk tips :) perl Tk help, RFC: Learning Perl/Tk, Perl/Tk: For Beginners, Re^3: Tkx Search for dialog box for text input , Re: TclTk interface with Perl code, is it possible? , Re^2: GUI toolkit+designer for the perl newbie , Re: Easier GUI, Re: Should I use Perl/TK?, Re^2: need a popup gui stdin, Tk Tree Tutorial ( http://www.rtapo.com/tutorials/tk_tree.html ), some Tkx tutorial links, Tutorial http://theoryx5.uwinnipeg.ca/perltk/ and http://www.perl.com/pub/1999/10/perltk/, http://perltk.org/, http://web.archive.org/web/20100310202528/http://theoryx5.uwinnipeg.ca/perltk/, How to RTFM Tk Tutorials
| [reply] |
Re: General advice desperately needed
by BillKSmith (Monsignor) on Aug 07, 2015 at 02:36 UTC
|
Are you sure that you need an .exe file? Few of your 'idiots' would know the difference if you create a windows shortcut that runs the perl interpreter and your script. With a Tk, you probably will want to use wperl.exe interpreter rather than perl.exe.
| [reply] |
|
|
Now here’s a couple of ideas ...
(1) They will definitely want an installer. Okay, I still use (and I still like) InnoSetup. Make the process of installing the thing painless. Inno has a lot of Pascal-esque... script capability, including the ability to call DLLs (including “temporary” ones that are never permanently installed). I think that you will be able to set up the Perl runtime environment completely, using what it has to offer.
(I’ve used several 16- and 32-bit installers over the years with my “still(!!) bread-and-butter” database-repair product, and Inno is the first – and therefore, last – product that I have been truly happy with ...)
(2) Maybe think in terms of having “the installed icon” actually run a launcher, which silently sets-up the Perl environment, spawns a copy of the Perl interpreter as a child process, then goes to sleep waiting for it to finish ... all without ever drawing attention to the fact that it even exists. Cobbling such a thing in the dot-Net world, using VB (I don't think you'd need to travel next-door to C#-land for any of this ...), would be a very easy thing to do, and the end-user would never know nor care. From their point-of-view, double-clicking the icon would launch “your program.”
(3) Thus, you have actually side-stepped the apparent “requirement” of bundling Perl into “the executable that is launched by the double-click.” This requirement would no longer exist. Inno can set-up “a fairly complicated file/directory structure” without calling attention to the fact that it has done so, and the launcher-EXE can set-up and launch (even) “a fairly complicated Perl runtime environment” without calling attention to the fact that it has done so. Between the two, I daresay that you will have a practical solution to your problem.
| |
Re: General advice desperately needed
by Your Mother (Archbishop) on Aug 06, 2015 at 23:59 UTC
|
I think you probably want Citrus instead of Strawberry. Caveat: I rarely develop on Windows and it's been years. If I'm off-base a WinMonk will call it out. :P
| [reply] |
|
|
Citrus Perl is only at version 5.16.3 (presently mainstream Perl is at 5.22) and development seems to have stalled since April 2013.Strawberry Perl is up to date and can easily install Tk through the cpan utility. For GUI development, there is also wxWidgets which cpan can install as Alien::wxWidgets.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James My blog: Imperial Deltronics
| [reply] |