Milestone XProtect Smart Client: mancata installazione con errore ‘Cannot load Counter Name data because an invalid index’

L’installazione del Milestone XProtect Smart Client (l’applicazione desktop per la gestione e la visualizzazione del video dalle telecamere connesse al sistema VMS XProtect di Milestone) può fallire per diversi motivi.

Nel caso si stia installando il Milestone XProtect Smart Client in modalità silente, come indicato in Install XProtect Smart Client silently (how-to), l’analisi del motivo della mancata installazione può essere difficile da determinare in quanto l’unica indicazione sono i seguenti eventi di errore 1026 e 1000 nel registro Applicazione:

Nome registro: Application
Origine: .NET Runtime
ID evento: 1026
Categoria attività:Nessuna
Livello: Errore
Descrizione:
Application: VideoOS.Installer.Bootstrapper.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
at System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window)
at VideoOS.Installer.Common.MessageHelper.ShowInstallerMessageBox(System.String, System.String, VideoOS.Installer.Common.InstallerMessageBoxIcon, VideoOS.Installer.Common.InstallerMessageBoxButtons)
at VideoOS.Installer.Bootstrapper.Program.Main(System.String[])

Nome registro: Application
Origine: Application Error
ID evento: 1000
Categoria attività:(100)
Livello: Errore
Parole chiave: Classico
Descrizione:
Nome dell’applicazione che ha generato l’errore: VideoOS.Installer.Bootstrapper.exe, versione: 23.3.41.1, timestamp: 0x654e5068
Nome del modulo che ha generato l’errore: KERNELBASE.dll, versione: 10.0.19041.3996, timestamp: 0xb756c9ff
Codice eccezione: 0xe0434352
Offset errore 0x000000000002cf19
ID processo che ha generato l’errore: 0x1668
Ora di avvio dell’applicazione che ha generato l’errore: 0x01da7c4db4aa9b52
Percorso dell’applicazione che ha generato l’errore: C:\Program Files (x86)\Common Files\VideoOS\cfyAfzZlmK\VideoOS.Installer.Bootstrapper.exe
Percorso del modulo che ha generato l’errore: C:\Windows\System32\KERNELBASE.dll
ID segnalazione: 65f5095e-58ab-4c8e-9722-92e7cc2399f6
Nome completo pacchetto che ha generato l’errore:
ID applicazione relativo al pacchetto che ha generato l’errore:

Un primo tentativo di risolvere il problema può essere quello di provare a scaricare nuovamente il pacchetto d’installazione o provare a rimuovere la directory C:\Program Files (x86)\Common Files\VideoOS.

Se però, come è probabile, queste operazioni non sono risolutive conviene provare ad installare il Milestone XProtect Smart Client in modalità normale ovvero visualizzando il wizard d’installazione per poter visualizzare eventuali dialog di errore.

Nel caso che ho avuto modo di analizzare durante l’installazione veniva visualizzata una dialog di errore che riportava il messaggio “Cannot load Counter Name data because an invalid index”.

Come indicato in XProtect installer may fail with the error “Category does not exist” or “Cannot load Counter Name data because an invalid index” (milestonesys.com) il problema è dovuto a performance counters corrotti o disabilitati:

Symptoms
When running the XProtect installer, it may fail with one of the following error messages:
“Cannot load Counter Name data because an invalid index was read from the registry.”“Category does not exist.”
Additionally, if you attempt to open Microsoft Performance Monitor on the affected system, you will receive the message: “Unable to add these counters: …”

Cause
During a new installation, you may see the error messages at the beginning of the installation process.
This error refers to missing, disabled or corrupt performance counters in the Microsoft Performance Monitor.

Per risolvere il problema è possibile provare ad eseguire una rebuilt dei performance counters e a riabilitare quelli eventualmente disabilitati.

Open an elevated Command Prompt:

  • click Start, type cmd, right-click Command Prompt, and select “Run as administrator.”
  • navigate to windows\system32 by running the command:
    cd c:\windows\system32\
  • Next, type:
    lodctr /r
    and press Enter

This will rebuild the performance counters in the event they become corrupt or missing.
After lodctr /r command is executed, it is possible that some counters will be disabled. You can check their status by running the following command:
lodctr /q — if you see (Disabled) next to a counter, you can enable it with:
lodctr /e: [counter name]this command.

Per dettagli sul rebuild dei Performace Counters si veda Rebuild performance counter library values – Windows Server | Microsoft Learn.

Nel caso l’esecuzione del comando lodctr /r fallisca riportando l’errore “Unable to rebuid performance counter settings from system backup store, error code is 2” si provi ad eseguire i comando con la R maiuscola: lodctr /R.

A riguardo si veda anche la documentazione del comando lodctr.