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

> I was wandering wether it is possible to setup different
> unattended.txt files that will be used depending on the operating
> system being intalled with unattended.
> 
> Is this possible?

We strive to make all things possible :-).

Try putting this in Z:\site\config.pl:

    my $media_obj = Unattend::WinMedia->new ($u->{'_meta'}->{'OS_media'});
    my $os_name = $media_obj->name ();
    if ($os_name =~ /Windows 2000/) {
        $u->read (dos_to_host ('z:\\site\\win2k-un.txt'));
    }
    elsif ($os_name =~ /Windows XP/) {
        $u->read (dos_to_host ('z:\\site\\winxp-un.txt'));
    }
    else {
        die "Unrecognized OS name: $os_name";
    }

    1;

Then put your respective unattend.txt files in z:\site\win2k-un.txt
and ...\winxp-un.txt.

Note the call to "dos_to_host".  It allows this code to work unaltered
with both the DOS-based and the Linux-based boot disk.

And you might want to use the Linux-based boot disk for this.  Since
this code depends on the OS, it will ask you what OS to install before
you even select how to partition the drive.  (This is actually correct
behavior, since you might have partitioning commands in those
OS-dependent unattend.txt files.)  This is really only annoying if the
drive partitioning requires a reboot, which only happens with DOS.

The other way to "fix" this is to take each value you want to compute
(e.g., product key) and write code to generate it based on the OS.
The examples at <http://unattended.sourceforge.net/advanced.html> show
you how to do this.

But this is a good example, too, so I think I will add it.

 - Pat


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
unattended-info mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unattended-info

Reply via email to