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
- :
- Problem solved!
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
‎Jan 26, 2011
03:09 AM
Bug: try catch endcatch in InstallScript and Basic MSI projects behave differently
Hi,
I have been working on 2 different projects.
I have noticed that try catch endcatch in the InstallScript project is unable to catch unhandled exception in the COM object's method.
The same code in a Basic MSI project (called from an InstallScript custom action scheduled for Deferred Execution) allows to catch the exception.
Regards
I have been working on 2 different projects.
- ProjectA is InstallScript.
- ProjectB is Basic MSI.
I have noticed that try catch endcatch in the InstallScript project is unable to catch unhandled exception in the COM object's method.
function DoIt()
OBJECT comObject;
STRING errMsg;
begin
set comObject = CoCreateObject("MyProgID");
if (!IsObject(comObject)) then
errMsg = "comObject could not be created";
MessageBox(errMsg, SEVERE);
else
try
comObject.DoSomething();
catch
errMsg = "comObject.DoSomething(): exception thrown";
MessageBox(errMsg, SEVERE);
endcatch;
endif;
set comObject = NOTHING;
end;
The same code in a Basic MSI project (called from an InstallScript custom action scheduled for Deferred Execution) allows to catch the exception.
- Is this different behaviour expected? Or is it a bug? :eek:
- Is there any workaround? 😄
- I have tried both IS 2010 and 2011 and faced exactly the same problem.
Regards
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 27, 2011
02:01 PM
Does any InstallShield developper have an idea about this issue?
I do think that being unable to catch exceptions thrown by COM objects in InstallScript project is a serious issue.
Regards
I do think that being unable to catch exceptions thrown by COM objects in InstallScript project is a serious issue.
Regards