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

Hello,

I'm thinking about writing an installer for Cascade. I'm looking for prior art of application installers before I re-invent another wheel.

Anyone have a recommendation for modules that are useful to write installers with? I want to query the user with a few questions, including some path names and some yes/no questions. Then various files will be copied into those locations. I'm thinking of writing for the command line environment now, but I may want to write a web-based installer later.

In my brief poking around, I found the Template::Toolkit has the kind of functionality I want, in its Makefile.PL: http://search.cpan.org/src/ABW/Template-Toolkit-2.10/Makefile.PL

It seems like there should be a slicker way, though. I looked to see what Module::Build could do for me, but it seems very focused on installing perl modules and not made to copy around arbitrary collections of files, as I'd like to.

Mark

Replies are listed 'Best First'.
Re: toolkits for Perl project installers?
by tachyon (Chancellor) on Sep 18, 2003 at 04:08 UTC

    AFAIK what you seek does not exist. ExtUtils::MakeMaker and PerlMakefile.PL etc is about as good as it gets.

    Given you are interfacing with Apache and MySQL or Postgres you have issues with them just for a start. You will find a good discussion on dealing with module dependencies at Install modules thru a script

    The bottom line is that if you want a custom installer you are going to have to write it. You can have it standalone or perhaps more conveniently in Makefile.PL.

    It is far from a trivial task, and given Perl's glue like nature not one that can easily be standardised into an Application::Install module. I did start to write one but decided that the investment return was not going to be great enough. It also began to suffer with no fixed goal and a bad dose of you ain't gonna need it featuritis.

    If you can make a decision that you don't want platform independent you can save heaps of effort by shelling out for dir tree generation, file copy, etc. If you want platform independent you have to implement it all yourself in perl.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: toolkits for Perl project installers?
by barbie (Deacon) on Sep 18, 2003 at 10:31 UTC
    Have a look at PAR and it's associated scripts. Although you will have to write a script to ask the questions and act accordingly, you can do something similar to what I have done previously. I used pp to create an executable. The script inside the executable asks the basic installation instructions and expands a second zip file (could easily be a tar.gz file) to where it needs to go.

    If you do have to roll-your-own then PAR does a lot of the hardwork for you. For the question and answer bit look into Term::ReadLine

    --
    Barbie | Birmingham Perl Mongers | http://birmingham.pm.org/

Re: toolkits for Perl project installers?
by autarch (Hermit) on Sep 19, 2003 at 07:15 UTC
    Module::Build will at least help you do what you want. Check out how I use it in Alzabo for some examples. It certainly can be used to copy arbitrary files quite easily.

    Also take a look at David::Wheeler's App::Info distribution, which can be quite handy for an installer.