Hello and welcome to our forums,
There is a problem with your script. I have tested the vbscript outside the Advanced Installer and it does not work.
The error you're encountering seems to be related to the use of the Contains method. The error message "Object doesn't support this property or method: 'OSName.Contains'" suggests that the Contains method is not supported on the object type you're using.
To achieve the desired functionality, you might need to modify your script. Here's a revised version that uses the InStr function to check if the string "Win" is contained within the Name property:
Code: Select all
prop = Session.Property("TEST")
propNew = Session.Property("TEST")
If prop = "false" Then
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set OSName = objWMIService.ExecQuery ("Select Name from Win32_OperatingSystem")
For Each os In OSName
If InStr(os.Name, "Win") > 0 Then
propNew = "true"
Exit For
End If
Next
End If
Session.Property("TEST") = propNew

- vbscript.png (165.93 KiB) Viewed 4025 times
In this version, the InStr function is used to check if the string "Win" is present in the Name property of each operating system instance.
Replace the TEST property name with your property name.
Please give this modified script a try and see if it resolves the error you're encountering.
Best regards,
Liviu