Usage Counting
When a component is first installed, the installer DLL creates a subkey for it
and sets the data for the UsageCount value in that subkey to 1. When the
component is installed again, the installer DLL increments the usage count. When the
component is removed, the installer DLL decrements the usage count. If the
usage count falls to 0, the installer DLL removes the subkey for the component.
Caution An application should not physically remove Driver Manager files when the
component usage count and the file usage count reach zero.
File usage counts help determine when a file must actually be copied or
deleted as opposed to incrementing or decrementing the usage count. This is important
because ODBC components
Note File usage counts are optional in Windows NT and Windows 95.
File usage counts are maintained by the setup program after it calls SQLInstallDriverManager, SQLInstallDriverEx, SQLInstallTranslatorEx, SQLRemoveDriverManager, SQLRemoveDriver, or SQLRemoveTranslator.
When a component is first installed, the setup program or installer DLL
creates a value under the following key for each file in that component that is not
already on the system:
HKEY_LOCAL_MACHINE
It sets the data for those values to 1 and copies the file to the system. When
the component is installed again, the setup program or installer DLL
increments the usage counts. When the component is removed, the setup program or
installer DLL decrements the usage counts. If any usage count falls to 0, the setup
program or installer DLL removes the value for the file, and if the component is
a driver or a translator, deletes the file. Driver Manager files should not be
deleted.
The format of the file usage count value is:
SOFTWARE
Microsoft
Windows
CurrentVersion
SharedDlls
Name
| Data type
| Data
|
full-path | REG_DWORD
| count
|
C:\WINDOWS\SYSTEM32\INFRMX32.DLL : REG_DWORD : 0x2
C:\WINDOWS\SYSTEM32\INFRMX32.HLP : REG_DWORD : 0x2