If your application is to present data to administrators on custom property pages, its setup program should install this functionality. This means installing the Admin-Extension object in the directory and copying the Administrator extension DLL and any other necessary files to specific disk locations. For information about copying files, see Copying Files Onto Disk.
For each Admin-Extension object to be installed, perform the following steps.
If the Admin-Extension object does exist, check its version. This is a multistep procedure that uses calls to the HrGetFileVersionInfo, VerQueryValue, HrAdminExtensionExists, and HrGetAdminExtensionVersion functions. If no Admin-Extension object by this name exists in the directory, skip to step 4.
If the installed Admin-Extension object is newer than the one to be installed, use a dialog box to require the administrator to choose whether to overwrite the installed Admin-Extension object with the older one on the distribution medium. If the user answers No, end the installation of this Admin-Extension object; if other Admin-Extension objects are to be installed, begin their installation at step 1.
Call the Win32 CoCreateGuid function to create a GUID. Convert this GUID into a string, and then use that string as a unique extension name for the Admin-Extension object. This is accomplished in the following sample code:
If an Admin-Extension object with the same name as the one you are installing already exists, remove the installed object by calling the HrRemoveAdminExtension function, and passing the extension name of the Admin-Extension object.
Create the new Admin-Extension object in the directory with the BatchImport or DAPIWrite function. Use the GUID created in step 4 for the extension name of the object.