Most of my perl is written under Windows using ActiveState and I've written my share of installation scripts with it.
The first thing I would suggest is that you download all of the modules that you need and package them up with your installation script (do this on a CD if you have to), but that way you are sure you can install them if necessary.
Here's some psuedocode that I would use when trying to address the problem that you're describing:
1. get the list of packages currently installed:
@packages = split /\n/,`ppm query -a`;
2. loop through your list of required packages and grep for the package name in the list @packages:
foreach $package (@required){ if( ! grep $package, @packages )
3. if the package you need is not in the list, then install it:
system("ppm install $package");
4. once through the list of required packages, go on about the rest of your installation steps.
Not sure if this is any help, but maybe something to think about. Good luck!
~CubicSpline
"No one tosses a Dwarf!"
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, details, 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, summary, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.