cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
RayKode
Level 6

How to trap an automation error

Afternoon everyone,

Here's the deal:

We use IS automation to build our merger modules and .msi's.
We make this happen via a VB script.
IE: MakeInstall,vbs
And it is absently wonderful.

From time to time however, errors occur when adding new components to our merge modules.
"ISWiProject.AddComponent".

One issue I'm working on:
If for any reason when adding a new component to a MM, a failure occurs, IS2K9 displays the "Invalid Identifier was supplied" dialog and sits there until someone clicks on the "OK" button.

Then of course when the "OK" button is clicked our script falls through to the next step which is to build the MM (sans the component that failed during the attempt to add it.)

Is there some way to NOT have the "Invalid Identifier was supplied" dialog (or any other dialog for that matter) appear if an error occurs during the mm update ?
(ISWiProject.AddComponent)

And then, would there be a way to check for a status which would allow my VB script to branch appropriately ?

Thanks in advance for any response.

Ray in Wisconsin




I would like to learn of a way to trap anything other than a sucessfull "Add of a component" so that I might END the automated procedure at that point.

I tried some basic error trapping:
IE:
if err.number <> 0 then Display some sort of message.
But this error checking occurs AFTER the ISWiProject.AddCoponent is executed.






I would like to know id there is a way to monitor when the iswi.AddComponent fails so that I may end out automated procedure at that point.

Currently, if the merge module update procedure fails, our scripts just contiues on with the next step.

WHich is to build the merge modules.
Labels (1)
0 Kudos
(2) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

I haven't looked into this recently, and I'm very much not a VBS expert, but I think this is a limitation of VBS. Using full VB you can set flags like "On Error Goto Handler", or in VB.NET or at last C# you can use try/catch blocks, and in either case do any error handling you prefer. In VBS I believe it catches all exceptions for you, and displays them as a message box.
0 Kudos
Christopher_Pai
Level 16

vbscript only supports 'on error resume next'

Eitherway, seriously, don't use vbscript for your build automation. Break out VB.NET or C# and write your build automation using MSBuild tasks. If you don't have/can't afford visual studio, get a copy of Sharp Develop.

If you don't know .NET yet, it's time to learn it. 🙂
0 Kudos