dragonchild has asked for the wisdom of the Perl Monks concerning the following question:

I may have need to write a rather simple script to run on Win32. However, it's not politically feasible to require the users to install Perl. So, I'd like to have my installer also install Strawberry Perl (and the deps we would need) under the guise of installing our "program". Is this feasible? I don't do Win32 on a regular (or even irregular) basis, so my testing this would require time I haven't gotten permission for.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Strawberry Perl, installers, and simple scripts

Replies are listed 'Best First'.
Re: Strawberry Perl, installers, and simple scripts
by bart (Canon) on Sep 15, 2008 at 19:17 UTC
    If you don't expect people to install more than this one Perl script, I wouldn't install a full Perl, as it easily takes up more than 100MB of disk space. That's plain ridiculous. Instead, I'd look at Perl script packers, a la PAR, to create an executable comprising of the script, the Perl binary, and the modules.

    About a year ago I had a good look at a few of the freely available options; you can see my findings in a blog post.

    Personally, I liked crazyinsomniac/PodMaster's solution, PerlBin, and Cava Packager, best. I haven't looked at it since then, but I expect that the latter likely has evolved a little; I don't think so, about the former. That unfortunately means that it will most likely not work for the more recent perl 5.10.x.

      Thanks Bart for the link to the Cava Packager.
      I spent several days banging my head against the wall with PAR and pp, but never got a working standalone exe.
      The Cava Packager worked right out of the box!
      Thanks again.

Re: Strawberry Perl, installers, and simple scripts
by TGI (Parson) on Sep 15, 2008 at 22:49 UTC

    I agree with the people suggesting using some kind of packaging tool.

    I've had good luck with PAR in the past, (back before PAR and PAR::Packer split). I don't know how well it works these days, I haven't used it in a while.

    After a lot of testing of PAR, perl2exe and Perlapp, I wound up using ActiveState's perlapp to create executables. It works well, and I've been very happy with it. It costs a couple hundred dollars, but with the cost of time it's saved me, it's been a very good buy.

    I can't comment on Cava Packager. I haven't tried it.


    TGI says moo

Re: Strawberry Perl, installers, and simple scripts
by jprice (Novice) on Sep 15, 2008 at 18:40 UTC
    I'm trying to do pretty much what your doing by using PAR Packer:
    http://search.cpan.org/~smueller/PAR-Packer-0.982/lib/pp.pm

    Unfortunately I not having complete success yet. I can build the self-extracting exe file, and it runs fine on the local system, but unfortunately I hit some "missing module" errors on the remote systems that don't have perl installed. If you happen to get pp working successfully I'd love to hear how you did it.
    I believe there's some ways you could manually use PAR (without pp) to create the complete perl archive file that you would need.
    But I'm still a noob at this, so don't ask me how...
      It's a pain, but in many packers Require'ing ALL of the modules that you use any functions from will cause them to be packed as well.

      Spacewarp

      DISCLAIMER:
      Use of this advanced computing technology does not imply an endorsement
      of Western industrial civilization.
Re: Strawberry Perl, installers, and simple scripts
by GrandFather (Saint) on Sep 15, 2008 at 20:50 UTC

    I had a sorta similar situation where I wanted to get a Perl script to someone on a dial up connection (yes, they still exist) and it wasn't feasible for him to download a Perl installer. I used Win32::MSI::HighLevel to create an .msi installer that installs (in my case ActiveState) Perl to a pre-determined location and installs the script too. That resulted in a 40 MB installer that I put on a CD and mailed to him. It doesn't need to be a .msi installer of course. You could do the same thing with a .zip file and just a little more hand holding on the user's end.

    The nice thing is, now that he has the environment installed I can email small updates to the script for maintenance purposes and all he need do is drop the updated file into a specified folder.


    Perl reduces RSI - it saves typing