LaunchINFSectionEx function
Launches a section of an information (INF) file.
Syntax
HRESULT WINAPI LaunchINFSectionEx(
HWND hwnd,
HINSTANCE hInst,
PSTR pszParams,
INT nShow
);
Parameters
hwnd
HWND that specifies the owner window on which to display error messages. This parameter is typically NULL, which causes the Desktop to be the owner window.hInst
Handle to the instance of the program. This parameter is typically NULL.pszParams
Comma-delimited string that specifies (1) the INF file, (2) the section of the INF file to launch, (3) the fully qualified path of the cabinet file (CAB) that contains the INF file, and (4) a flag value that specifies the installation mode, in that order.If you do not specify the fully qualified path of the INF file, the INF file is extracted from the specified CAB file. If you do not specify a section, that is, if the section portion of the pszParams string is an empty string or is set to NULL, then the DefaultInstall section of the INF file is launched.
The following values define the installation mode. Add the values together to specify multiple flags.
4 Quiet mode, no UI 8 Don't run GrpConv 16 Force self-updating on user's system 32 Backup data before install 64 Rollback to previous state 128 Validate the backup data 256 Complete rollback to previous state 512 Force delay of OCX registration An optional fifth field specifies whether to reboot upon completion. If not present, the installer will reboot only if necessary (smart reboot).
A Always reboot. I Default. Reboot if needed. N Never reboot. nShow
Unused. Set to zero.
Return value
Returns one of the following values.
Return code | Description |
---|---|
S_OK | The section launched successfully. |
E_FAIL | The section failed to launch. |
Remarks
You can call this function using Rundll32.exe from the command line.
Note Using an entry point function with Rundll32.exe does not resemble a normal function call. The function name and the name of the .dll file where it is stored are used only as command line parameters. The function definition shown in the Syntax section of this topic is only a standard prototype for all functions that you can call using Rundll32. The specific values for hwnd and hInst are not provided by the user, but are handled behind the scenes by Rundll32.
Examples
The following examples demonstrate how to call the LaunchINFSectionEx function using Rundll32.
This example demonstrates how to extract the myinf.infINF file from the c:\temp\mydata.cab CAB file in Quiet|Backup mode, and reboot if needed.
rundll32.exe advpack.dll,LaunchINFSectionEx myinf.inf,,c:\temp\mydata.cab,36
This example demonstrates how to roll back to the state before the myinf.infINF file was installed.
rundll32.exe advpack.dll,LaunchINFSectionEx c:\windows\inf\myinf.inf,,,256
Requirements
Minimum supported client |
Windows 2000 Professional |
Minimum supported server |
Windows 2000 Server |
Header |
N/A |
DLL |
Advpack.dll |
See also
Conceptual