GetLastError Method
InstallShield 2020
After calling the Ether object’s Play method, call the GetLastError method to find out the result of the installation. GetLastError tells you if an error occurred, if the installation finished successfully, or if the installation was canceled.
Syntax
ether.GetLastError( );
Example
It is best to poll GetLastError as in the following example:
var intervalID = 0;
function startInstall() {
if (ether)
{
ether.Play();
if (intervalID == 0)
intervalID = window.setInterval("IsSetupFinished()", 3000);
}
}
function IsSetupFinished()
{
var nResult = ether.GetLastError();
if (nResult != 0)
{
if (nResult == SETUP_FINISHED) // setup has completed successfully
/* to do */ ;
if (nResult == SETUP_ERR_CANCELLED) // setup was cancelled
/* to do */ ;
clearInterval(intervalID);
intervalID = 0;
}
}
Parameters
None.
Return Values
A complete list of GetLastError return values is in Disk1\_graphics\Utilities.js under the release’s Disk Images folder, and is given below.
• | SETUP_RUNNING |
• | SETUP_FINISHED |
• | SETUP_ERR_GENERAL |
• | SETUP_ERR_LOADMEDIA |
• | SETUP_ERR_INSTALLKERNEL |
• | SETUP_ERR_STARTKERNEL |
• | SETUP_ERR_OPENCAB |
• | SETUP_ERR_INSTALLSUPPORT |
• | SETUP_ERR_SETTEXTSUB |
• | SETUP_ERR_INITINFO |
• | SETUP_ERR_GETSETUPDRIVER |
• | SETUP_ERR_INITPROPERTIES |
• | SETUP_ERR_RUNINSTALL |
• | SETUP_ERR_UNINSTALLSUPPORT |
• | SETUP_ERR_EXTRACTBOOT |
• | SETUP_ERR_DOWNLOADFILE |
• | SETUP_ERR_CANCELLED |