diff --git a/lib/FusionInventory/Agent/Task/Inventory/Input/Win32/License.pm b/lib/FusionInventory/Agent/Task/Inventory/Input/Win32/License.pm index 1691d4f1f1..9176588cb3 100644 --- a/lib/FusionInventory/Agent/Task/Inventory/Input/Win32/License.pm +++ b/lib/FusionInventory/Agent/Task/Inventory/Input/Win32/License.pm @@ -10,13 +10,33 @@ use Win32::TieRegistry ( qw/KEY_READ/ ); - use FusionInventory::Agent::Tools::Win32; sub isEnabled { return 1; } +sub doInventory { + my (%params) = @_; + + # TODO: 64/32 bit support + my $machKey = $Registry->Open('LMachine', { + Access => KEY_READ ## no critic (ProhibitBitwise) + }) or $params{logger}->error("Can't open HKEY_LOCAL_MACHINE key: $EXTENDED_OS_ERROR"); + + my $office = + $machKey->{"SOFTWARE/Microsoft/Office"}; + + my @found; + + _scanOffice($office, \@found); + + foreach my $license (@found) { + $params{inventory}->addEntry(section => 'LICENSEINFOS', entry => $license); + } + +} + sub _scanOffice { my ($currentKey, $found) = @_; @@ -68,25 +88,4 @@ sub _scanOffice { } -sub doInventory { - my (%params) = @_; - - # TODO: 64/32 bit support - my $machKey = $Registry->Open('LMachine', { - Access => KEY_READ ## no critic (ProhibitBitwise) - }) or $params{logger}->error("Can't open HKEY_LOCAL_MACHINE key: $EXTENDED_OS_ERROR"); - - my $office = - $machKey->{"SOFTWARE/Microsoft/Office"}; - - my @found; - - _scanOffice($office, \@found); - - foreach my $license (@found) { - $params{inventory}->addEntry(section => 'LICENSEINFOS', entry => $license); - } - -} - 1;