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.
