As regulars here may know, my scripts generally have a test for the Session object to dtermine if they're running in a Custom Action or not. That allows me to have one script which I can test outside of an MSI and punch straight into a Custom Action once I'm happy that it works.

Well, I have an incredibly simple MSI (8 files, 1 reg entry) with a copy of my generic SetACL script. Damn thing keeps insisting it's not running in a CA. The code goes:

[font="courier new"]Dim [font="courier new"]blnIsCustomAction
[font="courier new"]blnIsCustomAction = False

On Error Resume Next
If IsObject(Session) Then
'// We may have arrived here because error-trapping is off
If Err.Number = 0 Then
blnIsCustomAction = True
End If
End If
On Error Goto 0

I've moved the CA all over the place but it refuses to return True for the Session object. Any clues?
0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


Stand easy...this particular script was using ExecuteGlobal as a kludge to get behaviour like ASP's INCLUDE. In the INCLUDEd file was a 'Dim Session' statement. Ah, th eperils of shared files....if I find who was responsible for that, I won't be answerable for my actions.
Answered 09/13/2007 by: VBScab
Red Belt

Please log in to comment