Export (0) Print
Expand All
Expand Minimize

SetupDiInstallClassEx function

The SetupDiInstallClassEx function installs a class installer or an interface class.

Syntax


BOOL SetupDiInstallClassEx(
  _In_opt_         HWND     hwndParent,
  _In_opt_         PCTSTR   InfFileName,
  _In_             DWORD    Flags,
  _In_opt_         HSPFILEQ FileQueue,
  _In_opt_   const GUID     *InterfaceClassGuid,
  _Reserved_       PVOID    Reserved1,
  _Reserved_       PVOID    Reserved2
);

Parameters

hwndParent [in, optional]

The handle to the parent window for any user interface that is used to install this class. This parameter is optional and can be NULL.

InfFileName [in, optional]

A pointer to a NULL-terminated string that contains the name of an INF file. This parameter is optional and can be NULL. If this function is being used to install a class installer, the INF file contains an INF ClassInstall32 section and this parameter must not be NULL.

If this function is being used to install an interface class, the INF file contains an INF InterfaceInstall32 section.

Flags [in]

A value of type DWORD that controls the installation process. Flags can be zero or a bitwise OR of the following values:

DI_NOVCP

Set this flag if FileQueue is supplied.

DI_NOVCP instructs the SetupInstallFromInfSection function not to create a queue of its own and to use the caller-supplied queue instead.

If this flag is set, files are not copied just queued.

For more information about the SetupInstallFromInfSection function, see the Microsoft Windows SDK documentation.

DI_NOBROWSE

Set this flag to disable browsing if a copy operation cannot find a specified file. If the caller supplies a file queue, this flag is ignored.

DI_FORCECOPY

Set this flag to always copy files, even if they are already present on the user's computer. If the caller supplies a file queue, this flag is ignored.

DI_QUIETINSTALL

Set this flag to suppress the user interface unless absolutely necessary. For example, do not display the progress dialog. If the caller supplies a file queue, this flag is ignored.

FileQueue [in, optional]

If the DI_NOVCP flag is set, this parameter supplies a handle to a file queue where file operations should be queued but not committed.

InterfaceClassGuid [in, optional]

A pointer to a GUID that identifies the interface class to be installed. This parameter is optional and can be NULL. If this parameter is specified, this function is being used to install the interface class represented by the GUID. If this parameter is NULL, this function is being used to install a class installer.

Reserved1

Reserved. Must be zero.

Reserved2

Reserved. Must be zero.

Return value

SetupDiInstallClassEx returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved with a call to GetLastError.

Remarks

The caller of this function must be a member of the Administrators group.

SetupDiInstallClassEx is typically called by a class installer to install a new device setup class or a new device interface class.

Note  An interface class can also be installed automatically by calling SetupDiInstallDeviceInterfaces to install the device interfaces for a device.

Requirements

Target platform

Desktop

Version

Available in Microsoft Windows 2000 and later versions of Windows.

Header

Setupapi.h (include Setupapi.h)

Library

Setupapi.lib

See also

SetupDiCallClassInstaller
SetupDiInstallDeviceInterfaces

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft