Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

A smart installer or setup assistant

by gwhite (Friar)
on May 13, 2008 at 18:49 UTC ( #686345=perlquestion: print w/replies, xml ) Need Help??
gwhite has asked for the wisdom of the Perl Monks concerning the following question:

I am a one man software shop and have a comprehensive set of CGI programs that I have been installing on various systems for several years. The software is modular not in the CPAN sense but in that clients can get ala carte what they need. Some take everything, some take one part some take 2 or 3 parts. I am regularly building new functionality in so files change or new templates or added etc so I am not working with an always static set of files. What I need is a simpler way to manage my Makefile.PL and the Manifest(s) that are required to setup my program.

Currently, I have my source saved as if the client were getting the whole nine yards. But if they only want a couple of parts I copy everything over to a working directory and strip out all the stuff they aren't buying(3-25 files per component), recreate my manifest, tweak the if it needs it. Usually, I end up leaving something in they didn't pay for and everyone once in a while I take out something I shouldn't have. Which means the install doesn't go well and that is not a good thing. A good part of my clients are at least Perl savvy, so I don't want to give them everything and just change the install program to only install parts.

Does anyone have any clever ideas on how I might set something up that would be much simpler? I am thinking an installer creator, with some sort of config file that would indicate the parts that make up each component, and platform specific files, the program would copy those over to the working directory, and create the Manifest then set some variables so Makefile.PL knows what parts are going to be installed and thus skip installation parts of the other components. On updates all I would need to do is put the new/changed files in the directory structure and update the config file. Or is there something already out there that I haven't heard of that can do this for me?


Replies are listed 'Best First'.
Re: A smart installer or setup assistant
by dragonchild (Archbishop) on May 13, 2008 at 23:50 UTC
    The various installers (ExtUtils::MakeMaker, Module::Build, and Module::Install) all have a 'dist' command. That is the command that goes about making the distribution as if it was going up on CPAN. In all three, you can override that dist command to do an interactive set of yes/no questions and to take the name of the distro. I'd recommend Module::Install, but Module::Build would work nicely. EUMM, btw, sucks.

    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?
Re: A smart installer or setup assistant
by Your Mother (Chancellor) on May 13, 2008 at 21:01 UTC

    If it were my stuff I might write a Template for the Makefile.PL and use a prompt module (or something handrolled) to ask, "include this? (y/n)" etc and take the results of the prompts to write the final Makefile.PL. I think Module::Install might even let you do a lot of that inline if you just wanted a big single one. Makefiles are just Perl scripts after all. The script (or I'd just as soon do most in the template in a case like this with THROW and such) would keep the logic for interdependencies, etc.

    Come to think of it, TT is probably a poor choice because it might not be installed on the target machine; but you would probably be generating dists on your box... anyway, you get the idea.

    Then you'd also need to use the information to decide which tests to run on the given installation. You're running all the wonderful tests you've spent the years amassing, right? :)

Re: A smart installer or setup assistant
by Khen1950fx (Canon) on May 13, 2008 at 20:40 UTC
Re: A smart installer or setup assistant
by GrandFather (Sage) on May 13, 2008 at 20:59 UTC

    If the components are represented by individual modules (that may pull in other stuff as required), then you could use a configuration file (or GUI front end) to select the components for a distribution, create a dummy script that uses each of the required components' modules and aim a dependency walker at that to get your manifest.

    Once you have a manifest you can either build the, or you could use the manifest and a script to create the directory structure containing the files for distribution. Creating a distribution set of files probably allows easier testing and management of each deployment, although you probably don't want to perform maintenance work on the distribution image.

    Perl is environmentally friendly - it saves trees

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://686345]
Approved by pc88mxer
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2017-01-24 01:43 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (200 votes). Check out past polls.