Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I am writing GUI programs for users throughout our company. The users all have Windows workstations (mostly XP). I would like to package up these programs as individual, independent, Windows .exe files.

Now before a bunch of people jump all over me, let me make two points: 1) I am not trying to hide my source code from anyone—most of my users don’t know or care about Perl or programming, and although the programs are proprietary, I’m not real worried about theft by internal users. 2) I am under no illusions that this will make my programs in any way faster. All I ask is that it doesn’t slow them down significantly.

The reason I want to package each program is for simplicity of distribution to (and use by) the users. I’d like to copy the .exe file onto the network, or onto a USB drive, and just have the users use it from there, or copy it to their workstation. These people don’t have Perl installed on their workstations, and why should they?

I used to use ActiveState’s perlapp, from their Perl Dev Kit. But they want $150 for a license, and I have grown to dislike AS Perl over the past few years. Installing modules is a pain. I vastly prefer Strawberry Perl, and I mostly use that nowadays.

Then I tried Cava Packager. Nice slick interface, and everything builds smooth as ice cream. However, it does not package everything up into one nice bundle. It makes a nice, neat, small .EXE file (124k!), but requires that a 'lib' directory be installed in the same location. I took a look inside that 'lib' directory, and it was stunning. 860 encrypted library files, eight megabytes. Good God, what a mess. And if you try to install two Cava-packaged programs to the same location, their 'lib' files stomp on each other.

I have been playing with pp lately. It too is apparently a pile of crap. If you use the --gui option and your program dies for any reason, you get zero error indication, it just stops. It also does not know about "use lib" when scanning for dependencies. How insane is that? Here is a simple WxPerl program:

#!perl use Modern::Perl; use lib 'h:\\dev\\lib'; use lib 'h:\\dev\\MyAppDir\\wx'; use MyApp; my $app = MyApp->new(); $app->MainLoop;

It’s short and simple, the boilerplate that most Wx apps follow. When I compile it:

pp --gui -o test.exe

pp sits and churns for a while, then creates a 4 meg .exe file. When I run this program, it sits and does nothing for about fifteen seconds, then returns to the prompt. Nothing, nada. So I removed the --gui option, re-compiled, and re-ran:

Can't locate threads/ in @INC (@INC contains: h:\dev\MyAppDir +\wx h:\dev\lib CODE(0x2c1108c) C:\Users\myname\AppData\Local\Temp\par +-myname\cache-c9e35a29c4569611f1a6576209856baa502c3ab1\inc\lib C:\Use +rs\myname\AppData\Local\Temp\par-myname\cache-c9e35a29c4569611f1a6576 +209856baa502c3ab1\inc CODE(0x29950cc) CODE(0x29953f4)) at h:\dev\MyAp +pDir\wx/ line 11. BEGIN failed--compilation aborted at h:\dev\MyAppDir\wx/ line +11. Compilation failed in require at script/ line 8. BEGIN failed--compilation aborted at script/ line 8.

Can’t locate threads/ What is this? It’s the first thing in! So I ran PAR’s scandeps on my little test program:

>scandeps 'Math::BigInt::GMP' => '1.24', 'Modern::Perl' => '1.03',

Yep, it does not follow "use lib" directives. I couldn’t believe it, so I even delved into the source code of Module::ScanDeps to confirm. Incredible.

So now I add the libraries to the pp command line:

pp -I H:\dev\lib -I H:\dev\MyAppDir\Wx -o test.exe

It then grinds away for half an hour, using 80% of my CPU the whole time. What the HELL is it doing? I haven’t seen compile times like that since I used a mainframe. When it finally did stop (yes, 35 minutes later), I ran the program (7.5 megabytes). It sat for twenty seconds, then popped up a dialog box that said,

The program can't start because wxbase28u_gcc_custom.dll is missing from your computer. Try reinstalling the program to fix this problem.

Yeah, that's helpful.

Are there any sane packagers for Perl?

In reply to Packaging Perl Programs (is) Painful by Sue D. Nymme

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (6)
    As of 2018-05-23 23:12 GMT
    Find Nodes?
      Voting Booth?