Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

VBScript error in Custom action


2 replies to this topic

uMan26

uMan26
  • Members
  • 1 posts

Posted 08 November 2002 - 19:47

I have some vbscript inserted directly into the custom action like this:

dim servicelist, service

Set servicelist= GetObject("winmgmts:").InstancesOf("Win32_Service")

for each service in servicelist
   if service.name = "MSSQL$THEDATABASE"  then
       Property("MSSQLTHEDATABASE_SERVICE_PRESENT")="1"
   end if
next
   
The install containing this custom action has been run on many different test machines without incident, but when it runs on a certain machine, I get this error:

Custom action IsMSSQLTHEDATABASEPresent script error -2146827837, Microsoft VBScript runtime error: Object not a collection Line 5, Column 1,
MSI © (8C:30): Product: Component Run-Time Conditioning -- Error 1720.There is a problem with this Windows Installer package. A script required for this install to complete could not be run.

The machine in question is running Windows 2000 Professional with service Pack 3.  However, other machines that are running the same environment do not run into this error, and even other machines running Service Pack 2 do not experience this problem.  Other machines with Service Pack 3 also do not experience this problem.  The prerequisites for installing this product are SQL 2000 MSDE and MSMQ.  

This error only persists when the script is running within the install.  When the script is run outside of the install on its own, the error "Object not a collection Line 5, Column 1" does not appear.  The custom action is set to immediate execution, always execute.

I have tried running this custom action with the code stored directly in the custom action as well as having it stored in the binary table, but the resulting error persists.  I have also tried shortening the property name from MSSQLTHEDATABASE_SERVICE_PRESENT to something significantly shorter, but that did not seem to work either.  I've pretty much run out of ideas. :(

hambone

hambone
  • Members
  • 206 posts

Posted 12 November 2002 - 13:33

is it possible that this is related to the declaration of the object ?

there is a kb article 129871 that describes a similiar behaviour...

dbareis

dbareis
  • Full Members
  • 85 posts

Posted 13 November 2002 - 04:07

I'm no expert but it would seem to me that if "GetObject" failed (perhaps WMI not installed) that you would expect something similar.  For debugging I'd split lines like these...
---
Dennis Bareis (dbareis@No.Spam.gmail.com)
Free MSI update/creation tool (MAKEMSI):
http://users.cyberon...eis/makemsi.htm