Err Object

InstallShield 2015 » InstallScript Language Reference

The Err object is used for exception handling. It has the following properties and methods:

Properties

Err Object Properties

Property

Description

Number

A number that identifies the error.

Source

A string that identifies the source of the error.

Description

A string that describes the error.

HelpFile

A string that specifies the fully qualified file name of a help file containing additional information about the error.

HelpContext

A number that specifies the identifier of a help topic containing additional information about the error.

LastDllError

This property holds the return value of the Windows API function GetLastError.

Methods

Err Object Methods

Method

Description

Clear

Clears the values of the Err object's properties.

Raise

If executed after the try keyword, script processing passes to the next exception handler (that is, code inside a catch/endcatch block); otherwise processing passes to the setup engine's built-in exception handler. Also resets the values of Err object properties as follows:

Err.Raise( );—Does not reset any Err object property values.
Err.Raise( nNumber );—Resets the value of Err.Number to nNumber.
Err.Raise( nNumber, szSource );—Resets the value of Err.Number to nNumber and Err.Source to szSource.
Err.Raise( nNumber, szSource, szDesc );—Resets the value of Err.Number to nNumber, Err.Source to szSource, and Err.Description to szDesc.
Err.Raise( nNumber, szSource, szDesc, szHelpFile );—Resets the value of Err.Number to nNumber, Err.Source to szSource, Err.Description to szDesc, and Err.HelpFile to szHelpFile.
Err.Raise( nNumber, szSource, szDesc, szHelpFile, nHelpContext );—Resets the value of Err.Number to nNumber, Err.Source to szSource, Err.Description to szDesc, Err.HelpFile to szHelpFile, and Err.HelpContext to nHelpContext.