SdFilesInUse

InstallShield 2014 » InstallScript Language Reference

Project: The InstallScript MSI project type support the SdFilesInUse function.

The SdFilesInUse dialog can also be called manually in InstallScript projects, in InstallScript MSI projects, and Basic MSI projects that have InstallScript custom actions; however, the installation must provide the list of applications that are locking files through the nvlistApps parameter, and it must handle the return value appropriately.

The SdFilesInUse function displays a dialog that includes a list box containing a list of the applications that are open and are locking files.

Typically, the OnFilesInUse event handler displays this dialog in an InstallScript MSI installation as a response to an INSTALLMESSAGE_FILESINUSE message sent by the Windows Installer. When this occurs, the Windows Installer provides to the installation the list of applications that are locking files. The list of applications are passed through the szMessage parameter to the OnFilesInUse event. The event passes this information to the SdFilesInUse function through the szMessage parameter. The event then passes the return value from the function as the return value of the event, which causes the Windows Installer to act appropriately.

Syntax

SdFilesInUse ( byval string szTitle, byval string szMsg, byval string szFilesInUse, byref LIST nvlistApps );

Parameters

SdFilesInUse Parameters

Parameter

Description

szTitle

Specifies the title of the dialog. To display the default title (Files in Use), pass a null string (“”) in this parameter.

szMsg

Specifies the message to display in the dialog. To display the default instructions for this dialog, pass a null string (“”) in this parameter.

szFilesInUse

When SdFilesInUse is called by the OnFilesInUse event handler in an InstallScript MSI installation, this parameter specifies the list of applications that the Windows Installer found to be locking files. The function parses this string in order to display the list of applications in the dialog's list box.

If you manually call SdFilesInUse, pass an empty string ("") in this parameter. Note that if nvlistApps is a valid string list, this parameter is ignored.

nvlistApps

When SdFilesInUse is called by the OnFilesInUse event handler in an InstallScript MSI installation, this parameter is specified as an uninitialized list variable—that is, a variable with a value of 0.

If you manually call SdFilesInUse, specify a string list of applications that are locking files and that should be displayed in the dialog. Each string in the list indicates one application. (Use the ListCreate function and associated list functions to create and initialize the string list.)

Note: You must provide a variable for this parameter; you cannot specify a literal value.

Return Values

SdFilesInUse Return Values

Return Value

Description

IDRETRY (4)

Indicates that the end user clicked the Retry button.

If you manually call SdFilesInUse, you should handle this return value by rechecking locked files and redisplaying the dialog as needed. When SdFilesInUse is called by the OnFilesInUse event handler, this value is returned by the event handler, and this is handled by the Windows Installer.

IDIGNORE (5)

Indicates that the end user clicked the Ignore button.

IDCANCEL

Indicates that the end user clicked the Exit button.

Note: Note that unlike other script dialogs, this dialog does not call the OnCanceling event handler when the user clicks the Exit button. Therefore, if you are calling this function manually, you must handle this return value manually in order to display the Cancel Setup dialog.

See Also