Session object test failing
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?
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"]
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
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
anonymous_9363
16 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.