[I'm looking at both Eric's and your message as I write this.
On Fri, 20 Mar 2009 16:08 -0700, "Michael G Schwern" <[email protected]>
wrote:
> Curtis Jewell wrote:
> > As in between "perl Build.PL" and "Build test"?
> >
> > I assume there's not a sub ACTION_ to override!
>
> ACTION_build, strangely enough, which depends on ACTION_code and
> ACTION_docs.
OK.
> > Here's what I need to do: I'm writing an Alien:: module that needs to
> > check the Windows registry to see if the software I'm trying to
> > installed is already installed. I have a configure_requires on
> > Win32API::Registry 0.30 for the systems that support configure_requires,
> > but for those that don't, I want to delay checking for my software until
> > after prerequisites are checked and Win32API::Registry installed.
> >
> > (Of course, the first thing I do after all the use statements is "die
> > 'OS unsupported' if ('MSWin32' ne $OSNAME);" so that's not a worry.)
> >
> > 1) Can I do it late in my Build PL (i.e. after or during
> > "$builder->create_build_script();") [which I assume is what I'm supposed
> > to do if I can]
> > or do I have to override the "Build" stage somehow?
>
> I'd just do it in the Build.PL. If the system supports
> configure_requires it
> will already have it installed. If it doesn't, then it will fail.
>
> I don't think OS Unsupported is the correct response. The OS isn't
> unsupported, the user is just missing a prereq. I'd do something like
> this:
The later checks just die. It's only the initial comparison to check
for a Win32 system that dies with 'OS unsupported', which is accurate,
because the only supported OS is Win32.
> eval { require Win32API::Registry }
> or die "Can't build without Win32API::Registry";
> I don't think there's a standard way to say "you're missing a module I
> need in
> the configure stage" other than configure_requires.
Thanks. I'll do that. Such is life. And since W32API::Registry isn't a
pure perl module, I can't do the inc\ thing with it.
> > 2) Based on that answer, what do I override?
>
> Is Win32API::Registry really necessary to run Build.PL?
Yes, it is. I don't want to ask the question about installing the .NET
framework or of WiX if it's already on the system. Seems a little
embarassing to me and it would likely be confusing to users of the
module. That's what's requiring Win32API::Registry - I need to check
the registry to find out if the correct versions of both are installed.
> Is it only necessary as part of the build process? Do you need it at run
> time?
"Yes and no" to both of those. I say it that way because it's actually
Win32::TieRegistry that's needed at run time (cleaner interface), but it
uses Win32API::Registry as a prerequisite, so I guess the answers are No
and Yes, respectively.
Summary:
It sounds like the course of action I should take is to detect whether
the external software is installed and ask the questions in the Perl
Build.PL stage, dieing with 'I can't check whether WiX is installed
without Win32API::Registry' if I don't have it at the detection point,
and saving the answers, and then do whatever installation is required in
the Build stage (in ACTION_code), then. Thank, everybody!
--
Curtis Jewell
[email protected]
%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears
[I use PC-Alpine, which deliberately does not display colors and
pictures in HTML mail]
--
Curtis Jewell
[email protected]
%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears
[I use PC-Alpine, which deliberately does not display colors and pictures in
HTML mail]