cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
angusmf
Level 3

Script doesn't work properly on Server 2008 when run from install

I have a custom action written in vbscript that removes COM+ components. It works fine on 2003. I can take the exact same script and run it from the desktop with no problems. When running it from the install, the script executes the function to save the COM+ changes, and it just hangs forever.

I've been attacking it as if it were a permissions issue, but it doesn't seem to be, and I'm not getting a permission denied exception. I've tried it as an immediate action, a deferred action, and a deferred action in system context. I've ported it to Installscript. I've launched the wscript process as the built-in administrative account, and tried running the code in Installscript from the custom action while impersonating the admin. When I run it as a "standard user" it fails almost immediately with a permission denied exception.

I'm really stumped as to why running from the install would cause this behavior. The vbs code is below. If someone helps me figure this out, I'll be their BFF.

Function RemoveCOMPlusApplications(sAppToRemove)
Dim objCat
Dim objApps
Dim objApp
Dim i
dim sAppName
dim count
Dim sMsg
Dim nReturn

Set objCat = CreateObject("COMAdmin.COMAdminCatalog")
Set objApps = objCat.GetCollection("Applications")

objApps.Populate

i = 0
count = objApps.Count - 1
For i = 0 to count
Set objApp = objApps.Item(count - i)
sAppName = objApp.Value("Name")
If InStr(sAppName, sAppToRemove) Then
sMsg = "Shutting down COM+ App " & sAppName
MsgBox sMsg
nReturn = objCat.ShutdownApplication(sAppName)
If nReturn = 0 then
sMsg = "Removing COM+ App " & sAppName
MsgBox sMsg
objApps.Remove(count - i)
MsgBox "saving " & sAppName
objApps.SaveChanges
'HANGS RIGHT HERE
End If
End If
Next

Set objCat = Nothing
Set objApps = Nothing
Set objApps = nothing

End Function
Labels (1)
0 Kudos
(1) Reply
angusmf
Level 3

More information:

The script behaves as expected if run as an immediate action in the UI sequence before ExecuteAction. It doesn't work anywhere in the Execute sequence. What could possibly be different during the execute sequence?
0 Kudos