"DE-LOS-SANTOS,ORIOL (HP-Spain,ex1)" <[EMAIL PROTECTED]> writes:

> Is there a way to easily add additional questions in the initial
> phase of the Unattended installation in order to provide extra
> parameters that could be then be available during the execution of
> the application installation scripts?

Yes, but you will need to learn a little Perl.

Start by reading <http://unattended.sourceforge.net/advanced.html>,
especially the later sections.

Then look at the simpler settings in Z:\dosbin\install.pl for ideas...

By way of example, you could create a Z:\site\config.pl like this:

    use warnings;
    use strict;

    $u->{'_hp'}->{'ExtraInfo1'} =
        sub {
            my $ret;
            while (!defined $ret) {
                $ret = simple_q ("Enter HP ExtraInfo1:\n");
            }
            return $ret;
        };

This creates a new section [_hp] and a new setting ExtraInfo1 in the
answer file.  It causes install.pl to stop and ask the user a question
to obtain the value.  If the user provides no answer, it will ask
again until it gets one.

Suppose the user answers "hi there".  Then this section will appear in
C:\netinst\unattend.txt:

    [_hp]
        ExtraInfo1 = "hi there"

Now you just need a way to read this information when it is time to
install your application.  The easiest way is to use the
Unattend::IniFile module from the distribution.  This means writing
your installation script in Perl and doing something like this:

    use Unattend::Inifile;
    my $u = new Unattend::Inifile ('C:\\netinst\\unattend.txt');
    my $extra_info_1 = $u->{'_hp'}->{'ExtraInfo1'};
    ... (do what you want with $extra_info_1) ...

I realize this is a little skeletal.  But what you are asking is
complex enough that it requires using some kind of scripting language,
and Perl is as good a choice as any...

 - Pat


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
unattended-info mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unattended-info

Reply via email to