Allan Stones wrote:
Stefan Schlesinger wrote:
Hello folks,
i'm using the code above to automatically lookup the product-keys,
but actually it looks like it never passes the key to the unattended.txt.
here is the code from site.pl: [code] maybe someone could tell me whats wrong?
regards, stefan.
Hi stefan, here is the code that i use :)
#################################### # Enterkey based on OS type chosen # ####################################
$u->{'UserData'}->{'ProductKey'} =
sub {
my $media_obj = Unattend::WinMedia->new ($u->{'_meta'}->{'OS_media'});
my $os_name = $media_obj->name ();
if ($os_name =~ /Windows XP/) {
return 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX';
}
return undef;
};
$u->{'UserData'}->{'ProductID'} =
sub {
my $media_obj = Unattend::WinMedia->new ($u->{'_meta'}->{'OS_media'});
my $os_name = $media_obj->name ();
if ($os_name =~ /Windows 2000/) {
return 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX';
}
elsif (defined $u->{'UserData'}->{'ProductKey'}) {
# It is OK for us to return undef as long as there is a
# ProductKey.
return undef;
}
die "No ProductKey nor ProductID!";
};
This method works fine for me. i play it in the 'config.pl'. My unattended.txt
in \lib also has 'productid' in there but it is commented out :)
Hello Allan, first of all, thanks for your reply.
Hmm..actually not exactly what i want. I think it's pretty annoying if you have to change the code each time you change a product key or even want to add one.
greetings, stefan.
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ unattended-info mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/unattended-info
