Updating Registry Information

After the queue has successfully committed, you will need to update registry information for the product you are installing. It is reccommended that you wait until all necessary file copy operations have been successfully completed before altering registry information.

One way to update the registry is to call SetupInstallFromInfSection with the SPINST_INIFILES, SPINST_REGISTRY, or SPINST_INI2REG flags specified. These flags can be combined in one call to SetupInstallFromInfSection.

The following example uses SPINST_ALL^SPINST_FILES to indicate that the function should process all of the listed operations except file operations. Since only INI, registry, and file operations are listed in the Install section, this is a shorthand method of specifying the function should process all INI and registry operations.

The following example shows how to install registry information using the SetupInstallFromINFSection function.

Test = SetupInstallFromINFSection (
     NULL,                     \\Window to own any dialog boxes
                               \\  created 
     MyInf,                    \\INF file containing the section 
     MySection,                \\the section to install
     SPINST_ALL ^ SPINST_FILES,\\which installation operations 
                               \\  to process
     NULL,                     \\the relative root key
     "A:\",                    \\the source root path
     0,                        \\copy style
     NULL,                     \\Message handler routine
     NULL,                     \\Context
     NULL,                     \\Device info set
     NULL                      \\device info data
);
 

In the example, OwnerWindow is NULL because only file operations generate dialog boxes, and thus a parent window is not needed. MyInf is the INF file containing the section to process. The parameter, MySection, specifies the section to be installed. The combined flags, SPINST_ALL ^ SPINST_FILES, specify which installation operations to process, in this case, all operations except file operations. The source root path is specified as "A:\".

Since no copy operations are being processed, the CopyFlags, MsgHandler, Context, DeviceInfoSet, and DeviceInfoData parameters are not specified.