DIFxDriverPackageUninstall

InstallShield 2016 » InstallScript Language Reference

Project • This function applies to InstallScript projects only. This function is not required in InstallScript MSI projects since DIFx can be called by the Windows Installer in those projects.

The DIFxDriverPackageUninstall function uninstalls the specified driver package from the system and removes the driver package from the driver store.

It is not necessary to call this function explicitly for drivers installed with DIFxDriverPackageInstall or DIFxDriverPackagePreinstall while uninstall logging is enabled as these drivers are automatically removed by the OnUninstallingDIFxDriverFile event.

Note • This function calls the DIFxAPI function DriverPackageUninstall. See the DIFxAPI documentation for additional details regarding this function and its parameters and return values.

Syntax

DIFxDriverPackageUninstall( byval string szDriverPackageInfPath, byval number nFlags, byval number nISFlags );

Parameters

DIFxDriverPackageUninstall Parameters

Parameter

Description

szDriverPackageInfPath

String that supplies the fully qualified path to the driver package .inf file of the driver package to pre-install.

nFlags

One or more flags that control the installation operation. In most cases, specify 0 to have the installer automatically add the appropriate flags.

The following additional flags can be specified manually:

Note • These flags are defined by and passed directly to the Flags parameter of the DIFxAPI function DriverPackageUninstall. See the DIFxAPI documentation for additional information regarding these flags.

DRIVER_PACKAGE_FORCE—(Applies only to PnP function drivers) By default, installs a new driver for device only if the new driver is a better match for the device than the driver currently installed for the device. If you specify this flag, the function preinstalls and installs the specified driver package even if the driver package currently installed for a device is a better match for the device than the specified driver package.
DRIVER_PACKAGE_SILENT—Suppresses the display of user dialogs. If a user interaction is required to continue the installation, for example, in response to a driver signing dialog, the installation operation fails without displaying a user message. The function returns an error code that indicates the cause of the failure.
DRIVER_PACKAGE_DELETE_FILES—Removes the binary files from a system that were copied to the system when the driver package was installed. The function removes a binary file from the system only if the binary file is identical to the corresponding binary file in the driver store.

Caution • Use this flag with caution. Only use this flag if you can verify that a binary file in the system is not required by any other driver package or application.

nISFlags

Specifies InstallScript-specific flags. The following flags are available:

0—Default behavior
ISDIFX_OPTION_DONT_ASSOCIATE—By default, the function associates the installed driver with the application being installed. If this flag is specified, the driver is not associated with any application.
ISDIFX_OPTION_DONT_RESOLVE_TEXTSUBS—By default, the function resolves any text substitutions found in szDriverPackageInfPath. If this flag is specified, text substitutions are not resolved.

Return Values

DIFxDriverPackageUninstall Return Values

Return Value

Description

ISERR_SUCCESS

The function was successful.

< ISERR_SUCCESS

The function failed.

If the return value from DriverPackageUninstall is a Win32 error (a positive return value), ISERR_WIN_BASE is added to the error to ensure that it is < ISERR_SUCCESS.

You can use the following code to get the original Win32 error, if desired:

if( nResult & ISERR_WIN_BASE ) then

nResult = nResult - ISERR_WIN_BASE;

endif;

For a list of specific errors, see DIFxAPI Errors (InstallScript Projects).

Additional Information

For more information on DIFx and DIFxAPI, see the MSDN Library.
When a driver is installed by DIFxDriverPackageInstall or uninstalled by DIFxDriverPackageUninstall, the driver is associated with the application being installed by the installation by default. This association can be disabled by specifying ISDIFX_OPTION_DONT_ASSOCIATE. These functions use the following script variables to determine the application to associate:
ISDIFXAPPID
IFX_PRODUCT_DISPLAY_NAME
IFX_PRODUCT_NAME
IFX_COMPANY_NAME