fusioninventory / fusioninventory-agent

FusionInventory Agent
http://fusioninventory.org/
GNU General Public License v2.0
252 stars 125 forks source link

Windows Vista clients doesn't inventory 32-bit software #901

Open eduardomozart opened 3 years ago

eduardomozart commented 3 years ago

GLPI: 9.5.4 FusionInventory for GLPI: 9.5.0+2.0 FusionInventory Agent (Vista machine): 2.6 (x64 edition)

Windows Vista (SP2) x64 isn't inventoring 32-bit software. Into the screenshot below, Mozilla Firefox is being shown into "Add/Remove Programs" list from Windows:

firefox-add-remove-programs

But, as can be seen into the agent log with the config debug set to 2, it isn't being detected during the inventory task:

fusioninventory-agent.log

It also affects other sofware, like Office. Into this case, it's a virtual machine that I didn't installed Office into it, but other machines with Windows Vista isn't reporting the Office 2010 installed and also it doesn't detect it's serial number during the WMI query to SoftwareLicensingProduct.

After executing the inventory task, the following message is also thown into Command prompt:

C:\Program Files\FusionInventory-Agent>fusioninventory-agent.bat --force --debug
 --debug
Wide character in print at C:\Program Files\FusionInventory-Agent/perl/agent/Fus
ionInventory/Agent/Logger/File.pm line 58.

It happens right after the XML file is printed into XML file, but I'm not sure if it's related to this issue.

Here's the machine inventory exported from FusionInventory for GLPI (no problem sharing it - I created a virtual machine with Vista with no serial attached into it, so we can use it to debug the issue):

41.xml.txt

No error is being thrown into Apache errors.log and access.log, neither <GLPI_ROOT>\files\_log\php-errors.log file.

Here's my full GLPI information:

[code]

GLPI 9.5.4 ( => /var/www/clients/client0/web1/web)
Installation mode: TARBALL

Server

Operating system: Linux ispconfig.example.com 4.18.0-240.10.1.el8_3.x86_64 #1 SMP Mon Jan 18 17:05:51 UTC 2021 x86_64
PHP 7.2.34 fpm-fcgi (Core, PDO, PDO_ODBC, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apcu, bcmath, bz2, calendar, cgi-fcgi,
    ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, json, ldap, libxml, mbstring, mcrypt,
    mysql, mysqli, mysqlnd, odbc, openssl, pcre, pdo_mysql, pdo_sqlite, posix, session, shmop, snmp, soap, sockets, sodium, sqlite3,
    standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="600" memory_limit="128M" post_max_size="150 M" safe_mode="" session.save_handler="files"
    upload_max_filesize="150M" 
Software: Apache ()
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36
Server Software: MariaDB Server
    Server Version: 10.3.27-MariaDB
    Server SQL Mode: 
    Parameters: c0glpiuser@localhost/c0glpi
    Host info: Localhost via UNIX socket

PHP version is at least 7.2.0 - Perfect!PHP version is at least 7.2.0 - Perfect!
Sessions support is available - Perfect!Sessions support is available - Perfect!
Allocated memory > 64 Mio - Perfect!Allocated memory > 64 Mio - Perfect!
mysqli extension is installedmysqli extension is installed
ctype extension is installedctype extension is installed
fileinfo extension is installedfileinfo extension is installed
json extension is installedjson extension is installed
mbstring extension is installedmbstring extension is installed
iconv extension is installediconv extension is installed
zlib extension is installedzlib extension is installed
curl extension is installedcurl extension is installed
gd extension is installedgd extension is installed
simplexml extension is installedsimplexml extension is installed
intl extension is installedintl extension is installed
ldap extension is installedldap extension is installed
apcu extension is installedapcu extension is installed
Zend OPcache extension is installedZend OPcache extension is installed
xmlrpc extension is installedxmlrpc extension is installed
CAS extension is installedCAS extension is installed
exif extension is installedexif extension is installed
zip extension is installedzip extension is installed
bz2 extension is installedbz2 extension is installed
sodium extension is installedsodium extension is installed
Database version seems correct (10.3.27) - Perfect!Database version seems correct (10.3.27) - Perfect!
Timezones seems loaded in databaseTimezones seems loaded in database
The log file has been created successfully.The log file has been created successfully.
Write access to /var/www/clients/client0/web1/web/files/_cache has been validated.Write access to /var/www/clients/client0/web1/web/files/_cache has been validated.
Write access to /var/www/clients/client0/web1/web/config has been validated.Write access to /var/www/clients/client0/web1/web/config has been validated.
Write access to /var/www/clients/client0/web1/web/files/_cron has been validated.Write access to /var/www/clients/client0/web1/web/files/_cron has been validated.
Write access to /var/www/clients/client0/web1/web/files has been validated.Write access to /var/www/clients/client0/web1/web/files has been validated.
Write access to /var/www/clients/client0/web1/web/files/_dumps has been validated.Write access to /var/www/clients/client0/web1/web/files/_dumps has been validated.
Write access to /var/www/clients/client0/web1/web/files/_graphs has been validated.Write access to /var/www/clients/client0/web1/web/files/_graphs has been validated.
Write access to /var/www/clients/client0/web1/web/files/_lock has been validated.Write access to /var/www/clients/client0/web1/web/files/_lock has been validated.
Write access to /var/www/clients/client0/web1/web/files/_pictures has been validated.Write access to /var/www/clients/client0/web1/web/files/_pictures has been validated.
Write access to /var/www/clients/client0/web1/web/files/_plugins has been validated.Write access to /var/www/clients/client0/web1/web/files/_plugins has been validated.
Write access to /var/www/clients/client0/web1/web/files/_rss has been validated.Write access to /var/www/clients/client0/web1/web/files/_rss has been validated.
Write access to /var/www/clients/client0/web1/web/files/_sessions has been validated.Write access to /var/www/clients/client0/web1/web/files/_sessions has been validated.
Write access to /var/www/clients/client0/web1/web/files/_tmp has been validated.Write access to /var/www/clients/client0/web1/web/files/_tmp has been validated.
Write access to /var/www/clients/client0/web1/web/files/_uploads has been validated.Write access to /var/www/clients/client0/web1/web/files/_uploads has been validated.
Write access to /var/www/clients/client0/web1/web/marketplace has been validated.Write access to /var/www/clients/client0/web1/web/marketplace has been validated.
Web access to files directory is protectedWeb access to files directory is protected
For security reasons, SELinux mode should be Enforcing.For security reasons, SELinux mode should be Enforcing.

GLPI constants

GLPI_ROOT: /var/www/clients/client0/web1/web
GLPI_CONFIG_DIR: /var/www/clients/client0/web1/web/config
GLPI_VAR_DIR: /var/www/clients/client0/web1/web/files
GLPI_MARKETPLACE_DIR: /var/www/clients/client0/web1/web/marketplace
GLPI_USE_CSRF_CHECK: 1
GLPI_CSRF_EXPIRES: 7200
GLPI_CSRF_MAX_TOKENS: 100
GLPI_USE_IDOR_CHECK: 1
GLPI_IDOR_EXPIRES: 7200
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: 
GLPI_TELEMETRY_URI: https://telemetry.glpi-project.org
GLPI_INSTALL_MODE: TARBALL
GLPI_NETWORK_MAIL: glpi@teclib.com
GLPI_NETWORK_SERVICES: https://services.glpi-network.com
GLPI_MARKETPLACE_PRERELEASES: 
GLPI_USER_AGENT_EXTRA_COMMENTS: 
GLPI_AJAX_DASHBOARD: 1
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_DEMO_MODE: 0
GLPI_FORCE_EMPTY_SQL_MODE: 1
GLPI_DOC_DIR: /var/www/clients/client0/web1/web/files
GLPI_CACHE_DIR: /var/www/clients/client0/web1/web/files/_cache
GLPI_CRON_DIR: /var/www/clients/client0/web1/web/files/_cron
GLPI_DUMP_DIR: /var/www/clients/client0/web1/web/files/_dumps
GLPI_GRAPH_DIR: /var/www/clients/client0/web1/web/files/_graphs
GLPI_LOCAL_I18N_DIR: /var/www/clients/client0/web1/web/files/_locales
GLPI_LOCK_DIR: /var/www/clients/client0/web1/web/files/_lock
GLPI_LOG_DIR: /var/www/clients/client0/web1/web/files/_log
GLPI_PICTURE_DIR: /var/www/clients/client0/web1/web/files/_pictures
GLPI_PLUGIN_DOC_DIR: /var/www/clients/client0/web1/web/files/_plugins
GLPI_RSS_DIR: /var/www/clients/client0/web1/web/files/_rss
GLPI_SESSION_DIR: /var/www/clients/client0/web1/web/files/_sessions
GLPI_TMP_DIR: /var/www/clients/client0/web1/web/files/_tmp
GLPI_UPLOAD_DIR: /var/www/clients/client0/web1/web/files/_uploads
GLPI_NETWORK_REGISTRATION_API_URL: https://services.glpi-network.com/api/registration/
GLPI_MARKETPLACE_PLUGINS_API_URI: https://services.glpi-network.com/api/glpi-plugins/
GLPI_I18N_DIR: /var/www/clients/client0/web1/web/locales
GLPI_VERSION: 9.5.4
GLPI_SCHEMA_VERSION: 9.5.4
GLPI_MIN_PHP: 7.2.0
GLPI_YEAR: 2021

Libraries

htmlawed/htmlawed version 1.2.5 in (/var/www/clients/client0/web1/web/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.1.6 in (/var/www/clients/client0/web1/web/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.6 in (/var/www/clients/client0/web1/web/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.3.5 in (/var/www/clients/client0/web1/web/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/var/www/clients/client0/web1/web/vendor/michelf/php-markdown/Michelf)
true/punycode in (/var/www/clients/client0/web1/web/vendor/true/punycode/src)
iamcal/lib_autolink in (/var/www/clients/client0/web1/web/vendor/iamcal/lib_autolink)
sabre/dav in (/var/www/clients/client0/web1/web/vendor/sabre/dav/lib/DAV)
sabre/http in (/var/www/clients/client0/web1/web/vendor/sabre/http/lib)
sabre/uri in (/var/www/clients/client0/web1/web/vendor/sabre/uri/lib)
sabre/vobject in (/var/www/clients/client0/web1/web/vendor/sabre/vobject/lib)
laminas/laminas-cache in (/var/www/clients/client0/web1/web/vendor/laminas/laminas-cache/src)
laminas/laminas-i18n in (/var/www/clients/client0/web1/web/vendor/laminas/laminas-i18n/src)
laminas/laminas-serializer in (/var/www/clients/client0/web1/web/vendor/laminas/laminas-serializer/src)
monolog/monolog in (/var/www/clients/client0/web1/web/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/var/www/clients/client0/web1/web/vendor/sebastian/diff/src)
elvanto/litemoji in (/var/www/clients/client0/web1/web/vendor/elvanto/litemoji/src)
symfony/console in (/var/www/clients/client0/web1/web/vendor/symfony/console)
scssphp/scssphp in (/var/www/clients/client0/web1/web/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/var/www/clients/client0/web1/web/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/var/www/clients/client0/web1/web/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/var/www/clients/client0/web1/web/vendor/rlanvin/php-rrule/src)
blueimp/jquery-file-upload in (/var/www/clients/client0/web1/web/vendor/blueimp/jquery-file-upload/server/php)
ramsey/uuid in (/var/www/clients/client0/web1/web/vendor/ramsey/uuid/src)
psr/log in (/var/www/clients/client0/web1/web/vendor/psr/log/Psr/Log)
psr/simple-cache in (/var/www/clients/client0/web1/web/vendor/psr/simple-cache/src)
mexitek/phpcolors in (/var/www/clients/client0/web1/web/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/var/www/clients/client0/web1/web/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/var/www/clients/client0/web1/web/vendor/guzzlehttp/psr7/src)
wapmorgan/unified-archive in (/var/www/clients/client0/web1/web/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/var/www/clients/client0/web1/web/vendor/paragonie/sodium_compat/src)
phpCas version 1.3.8 in (/usr/share/pear)

LDAP directories

Server: 'ldaps://example.com', Port: '389', BaseDN: 'OU=example,DC=example,DC=com,DC=br', Connection filter:
        '(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(!(memberOf=CN=Contas de Serviço -
        Negar Logon Interativo,OU=Serviços,OU=TI,OU=São
        Leopoldo,OU=example,DC=example,DC=com,DC=br))(!(sAMAccountName=fabrica))(!(sAMAccountName=cq))(!(sAMAccountName=manutencao)))',
        RootDN: 'glpiaduser@example.com', Use TLS: none

SQL replicas

Not active

Notifications

Way of sending emails: SMTP+SSL (glpi@example.com@smtp.kinghost.net)

Mails receivers

Name: 'glpi@example.com' Active: Yes
    Server: '{smtp.kinghost.net:995/pop/ssl/validate-cert}' Login: 'glpi@example.com' Password: Yes

Plugins list

    fields               Name: Campos adicionais              Version: 1.12.2     State: Enabled
    behaviors            Name: Comportamentos                 Version: 2.4.1      State: Enabled
    accounts             Name: Contas                         Version: 2.6.0      State: Enabled
    archimap             Name: Diagrams                       Version: 2.2.1      State: Enabled
    fusioninventory      Name: FusionInventory                Version: 9.5+2.0  State: Enabled
    genericobject        Name: Gerenciamento de objetos       Version: 2.10.0     State: Installed / not activated
    manufacturersimports Name: Importação de fornecedores     Version: 2.3.1      State: Enabled
    pdf                  Name: Imprimir em PDF                Version: 1.7.0      State: Enabled
    mreporting           Name: Mais Relatórios                Version: 1.7.1      State: Enabled
    printercounters      Name: Printer counters               Version: 1.7.0      State: Enabled
    reports              Name: Relatórios                     Version: 1.14.0     State: Enabled
    taskdrop             Name: TaskDrop                       Version: 1.2.0      State: Enabled

[/code]
g-bougard commented 3 years ago

Hi @eduardomozart can you provide the following registry key export ? HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall

Also did you have the right inventory with older agent version ? Did you try the agent 32bits version ?

Also is it possible this old FF version is installed only in the user profile ? If this is the case, it won't appear in inventory as you have scan-profiles disabled. If this is the case, the software should be referenced in registry into HKEY_USERS/$profileName/SOFTWARE/Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall (with $profileName set to the profil name).

The Wide character in print is a warning not related and without consequence for the inventory.

About the Office licensing not detected, this is normal on Vista as I can read in MSDN Minimum supported client | Windows 7 for the SoftwareLicensingProduct WMI request. See https://docs.microsoft.com/en-us/previous-versions/windows/desktop/sppwmi/softwarelicensingproduct So you should upgrade the system to at least win7 on that computers.

eduardomozart commented 3 years ago

Hello @g-bougard, thank you for your answer!

I'm sending below the HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall key:

Wow6432Node-Uninstall.reg.txt

Firefox is being listed into this subkey, so I'm not sure what's happening, maybe the code is trying to access HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall instead (in other words, isn't redirecting to Wow6432Node)? Because I still have two Windows XP (32-bit) machines and they work just fine with the latest version of the agent. This is happening only in Windows Vista. The strange is that it's reports normally 32-bit software into Windows 7 x64 and Windows 10 x64 machines that we have in our asset.

About the Office, I have another issue open about it, and I would like to discuss about it's detection methods there.

I would like to upgrade these machines to a newer version of Windows and, believe me, I'm doing my best to do so. Sadly our IT budget is small and we have softwares that only runs into Windows, so I can't adopt Linux distros (it doesn't run even through Wine). Only last year I get to replace all our Windows XP machines with Windows 7, but licensing Microsoft software into my country is extremely expensive, it's more than the income of one labor worker for 1 entire month per license. I still have four Windows Vista machines into our environment that I pretend to replace it for Windows 7 machines soon, but it's still a problem because Windows 7 is already EOL, but it's better than Vista. I still have two Windows XP machines to replace.

g-bougard commented 3 years ago

Hello @eduardomozart indeed when the detects it is on a 64bits system, it will scan the 2 registry keys and should then detects 64bits and 32bits softwares. Btw if it thinks it is on a 32bits system, it will scan only the common registry key. So maybe the arch detection is failing on Vista.

Can you report the output of the following command ? wmic path win32_processor get /format: list This will help check what arch the agent detects. The win32_processor wmi api is supported since Vista but maybe it reports wrong values.

About the other issue about Office, I still wait for an answer to my questions.

eduardomozart commented 3 years ago

Hello @g-bougard!

The SoftwareLicensingProduct WMI class is available only into Windows 7 and higher, but the OfficeSoftwareProtectionProduct WMI class is available into Windows Vista/XP and allows you to get Office keys. The ROIScan (an official microsoft script toolkit) checks for Office subscriptions through SoftwareLicensingProduct WMI class if Windows > 7 and OfficeSoftwareProtectionProduct WMI class if Windows < 7, as can be seen here: https://gist.github.com/joerodgers/b1c6ec34801917d4ec4a700491f8ace3

OSPP.vbs that is embeded into Microsoft Office also uses a similar approach: https://stackoverflow.com/questions/55485073/how-to-programmatically-distinguish-excel-2019-from-2016?rq=1

I searched through the FusionInventory-Agent repository but couldn't find any reference to the OfficeSoftwareProtectionProduct WMI class, maybe it could be added into the source code next to SoftwareLicensingProduct WMI class. I can test this feature if it's added into FusionInventory Agent source code.

I still didn't replied the Office opened issue because I'm rewriting the OfficePack script from OCS Inventory NGS with my findings about Office edition and product key detection. It's a VBScript file, but I pretend to write a logic that can be easily ported to Perl so it can be integrated into FusionInventory-Agent into the future.

Here's the output for the wmic path win32_processor get /format: list command. The CPU model can be different from the inventory above because it's a VM and currently I'm running it into a different hardware (I have a Core i3 at home and a Core i5 at work). But it shouldn't change the detection logic from system architecture of FusionInventory Agent.

Microsoft Windows [versão 6.0.6003]
Copyright (c) 2006 Microsoft Corporation. Todos os direitos reservados.

C:\Windows\system32>wmic path win32_processor get /format: list

AddressWidth=64
Architecture=9
Availability=3
Caption=Intel64 Family 6 Model 158 Stepping 10
ConfigManagerErrorCode=
ConfigManagerUserConfig=
CpuStatus=0
CreationClassName=Win32_Processor
CurrentClockSpeed=3000
CurrentVoltage=
DataWidth=64
Description=Intel64 Family 6 Model 158 Stepping 10
DeviceID=CPU0
ErrorCleared=
ErrorDescription=
ExtClock=
Family=
InstallDate=
L2CacheSize=
L2CacheSpeed=
L3CacheSize=0
L3CacheSpeed=0
LastErrorCode=
Level=6
LoadPercentage=29
Manufacturer=GenuineIntel
MaxClockSpeed=3000
Name=Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
NumberOfCores=1
NumberOfLogicalProcessors=1
OtherFamilyDescription=
PNPDeviceID=
PowerManagementCapabilities=
PowerManagementSupported=FALSE
ProcessorId=
ProcessorType=
Revision=
Role=CPU
SocketDesignation=
Status=OK
StatusInfo=3
Stepping=10
SystemCreationClassName=Win32_ComputerSystem
SystemName=WINVISTAVM-PC
UniqueId=
UpgradeMethod=2
Version=Model 14, Stepping 10
VoltageCaps=
g-bougard commented 3 years ago

Hi @eduardomozart please don't talk about Office issue here but in your related #896 one or even create another issue to support Vista.

About your about, it shows the expected AddressWidth=64 output so the agent should have parsed 64bits softwares and 32 bits softwares.

Anyway if I check carefully your agent log, I can find some software with ARCH set to i586 so they were inventoried at the same place than where should have been FF. And this is really weird as this includes the agent itself but it seems to be the 64 bits release (Name is "FusionInventory Agent 2.6 (x64 edition)"). But can you double-check you really have Firefox 32bits installed the same way on that WINVISTAVM-PC-2021-02-13-13-38-57 PC ? I mean are you sure the log has been generated on the same computer that the one you reported registry key and wmi output ?

g-bougard commented 3 years ago

If you check the agent log you firstly joined, I can see 8 softwares with ARCH set to i586. These softwares must have been listed reading HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall if my read of the code is right. But none of them are listed in your registry export. So something seems wrong to me with your report. So can you triple-check or have you another explanation ? Thank you.

eduardomozart commented 3 years ago

Yes, I can confirm it is the same machine. I have four Windows Vista into my environment and ALL of them doesn't report 32-bit software (not only Firefox, other 32-bit software aren't being inventory neither). I see that there's some I586 software into the log, but they're being listed because they're located into "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall" key instead of "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall" (note the Wow6432Node).

I'm attaching the Process Monitor log for this machine. As you can see, the Perl executable is querying "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall" key, but doesn't "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall" (note the Wow6432Node).

Logfile.zip

The Firefox isn't being shown into the Process Monitor log, but it exists into "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall" key.

There's some code detection that is avoiding the agent from querying this key or the query isn't being executed at all. I have other Windows 7 and Windows 10 x64 machines and it doesn't happens.

g-bougard commented 3 years ago

You're saying:

I see that there's some I586 software into the log, but they're being listed because they're located into "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall" key instead of "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall" (note the Wow6432Node).

But the agent will set "i586" as ARCH only for software seen under "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall" (note the Wow6432Node). So something is wrong in what you're reporting. Maybe Vista is just lying as in your process LogFile we can see FusionInventory-Agent is read from "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall" (without Wow6432Node). Maybe Vista has some hidden binding to match Wow6432Node into the normal registry key, but in someway it fails to register FF using that bindings... And even if this is the case, why FusionInventory-Agent x64 is reported as 32 bits ? So or your first agent log is related to another computer, or Vista is definitively failing to register softwares in a safe way. If Vista is bugged, we won't try to understand how it is bugged to make the agent aware of no more supported software.

eduardomozart commented 3 years ago

Here's the Uninstall log from "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall" (without Wow6432Node):

Uninstall.reg.txt

You can compare this file with the Wow6432Node-Uninstall.reg.txt uploaded earlier and you can see that those "I586" software are into "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall" key (without Wow6432Node) instead of "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall" (note the Wow6432Node).

I'm not sure how FusionInventory-Agent are reporting them as "I586" software if it only considers softwares that are into "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall" (note the Wow6432Node) as being "I586", as it's clearly querying the "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall" key (without Wow6432Node) instead. Maybe it's another bug underneath?

g-bougard commented 3 years ago

Indeed now I see in your log the same list of softwares with x86_64 and i586 as ARCH. This means to me Vista is doing some bullshit when we request "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node".

After few readings, can you try the following patch ?

diff --git a/lib/FusionInventory/Agent/Tools/Win32.pm b/lib/FusionInventory/Agent/Tools/Win32.pm
index b59980324..245bcdada 100644
--- a/lib/FusionInventory/Agent/Tools/Win32.pm
+++ b/lib/FusionInventory/Agent/Tools/Win32.pm
@@ -381,8 +381,9 @@ sub _getRegistryRoot {
     my (%params) = @_;

     ## no critic (ProhibitBitwise)
+    my $WOW6432Flag = $params{keyName} =~ /Wow6432Node/ ? KEY_WOW64_32 : KEY_WOW64_64;
     my $rootKey = is64bit() ?
-        $Registry->Open($params{root}, { Access=> KEY_READ | KEY_WOW64_64 } ) :
+        $Registry->Open($params{root}, { Access=> KEY_READ | $WOW6432Flag } ) :
         $Registry->Open($params{root}, { Access=> KEY_READ } )                ;

     if (!$rootKey) {

If it works, can you also test it on all other platforms you're using ?

eduardomozart commented 3 years ago

Hello @g-bougard,

I applied your patch into Win32.pm file but the issue still persists. Debugging the perl.exe process through Process Monitor, it isn't enumerating the "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall" (note the Wow6432Node) and still log the same list of softwares with x86_64 and i586 as ARCH. The Process Monitor shows that the "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall" (without Wow6432Node) is being enumerated twice.

I created a zip file containing the FusionInventory for GLPI xml file, the FusionInventory Agent log file (debug = 2) and Process Monitor log:

FusionInventory-ProcessMonitor-Logs-09-Mar-2021.zip