This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Err.Description returns null
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 21, 2010
11:19 PM
Err.Description returns null
Hi Karthic here.
I am doing Install script MSI project, ofcourse it uses event driven install script code.
In OnBegin() event I am doing a registry read. If the registry read fails then the I am throwing an error message to the user as below
if (RegDBGetKeyValueEx("SOFTWARE\\MICROSOFT",svKey, nvType, svValue, nvNum) < 0) then
MessageBox(Err.Number + " - Number", INFORMATION);
MessageBox(Err.Description + "- Description", INFORMATION);
MessageBox(Err.Source + "- Source", INFORMATION);
MessageBox(Err.HelpFile + "- HelpFile", INFORMATION);
MessageBox(Err.HelpContext + "- HelpContext", INFORMATION);
MessageBox(Err.LastDllError + "- LastDllError", INFORMATION);
endif;
->Please note that on purpose i am reading a key which is not present and the RegDBSetDefaultRoot is not used.
No message box has a valid information about the occured error.
Can anyone provide any information on this
Thanks in advance
Cheers
Karthic
further on surfing i got info that try catch need to be used to do with Err object. In install script is it such a way that Err object is used only with try catch?
any error occured outside try catch assue a registry read is done which fails will update the Err number.
Do i Need to #include or set some option in the rul file to use it?
Please put forward your views... i dont understand how it works!!
I am doing Install script MSI project, ofcourse it uses event driven install script code.
In OnBegin() event I am doing a registry read. If the registry read fails then the I am throwing an error message to the user as below
if (RegDBGetKeyValueEx("SOFTWARE\\MICROSOFT",svKey, nvType, svValue, nvNum) < 0) then
MessageBox(Err.Number + " - Number", INFORMATION);
MessageBox(Err.Description + "- Description", INFORMATION);
MessageBox(Err.Source + "- Source", INFORMATION);
MessageBox(Err.HelpFile + "- HelpFile", INFORMATION);
MessageBox(Err.HelpContext + "- HelpContext", INFORMATION);
MessageBox(Err.LastDllError + "- LastDllError", INFORMATION);
endif;
->Please note that on purpose i am reading a key which is not present and the RegDBSetDefaultRoot is not used.
No message box has a valid information about the occured error.
Can anyone provide any information on this
Thanks in advance
Cheers
Karthic
further on surfing i got info that try catch need to be used to do with Err object. In install script is it such a way that Err object is used only with try catch?
any error occured outside try catch assue a registry read is done which fails will update the Err number.
Do i Need to #include or set some option in the rul file to use it?
Please put forward your views... i dont understand how it works!!
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 22, 2010
05:16 PM
Most of the fields in the Err object are only populated when an exception occurs during execution of the setup script. Typically this would occur when attempting to call a method or property on a COM object threw an exception, in which case the fields in the Err object are populated with the COM exception information. When using a try/catch block to catch any exceptions, the Err object will be populated with as much information that is available regarding the exception.
The LastDllError field is populated whenever an external DLL function call is made, such as to a Win32 API in kernel32.dll. This provides the last Win32 error typically obtained through GetLastError in a Windows application.
If you are trying to obtain a text description of an error returned by an InstallScript function, you can pass the error code to the InstallScript FormatMessage function, which will return a string with the error description if one is available.
The LastDllError field is populated whenever an external DLL function call is made, such as to a Win32 API in kernel32.dll. This provides the last Win32 error typically obtained through GetLastError in a Windows application.
If you are trying to obtain a text description of an error returned by an InstallScript function, you can pass the error code to the InstallScript FormatMessage function, which will return a string with the error description if one is available.
