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
- :
- Script doesn't work properly on Server 2008 when run from install
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
Feb 02, 2011
08:50 AM
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
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
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Feb 02, 2011
03:10 PM
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?
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?