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

GetObject("winmgmts:")


2 replies to this topic

dbareis

dbareis
  • Full Members
  • 85 posts

Posted 24 March 2002 - 23:56

Hi,

I have tried about a million different ways, most of which work from the command line (as Administrator), it will fail as MSI CA (but not trap) when I try to use the collection it will say that the object is not a collection.

Note I write my CAs where possible to work from command line for testing where possible.

Thanks for any help,
Dennis
---
Dennis Bareis (dbareis@No.Spam.gmail.com)
Free MSI update/creation tool (MAKEMSI):
http://users.cyberon...eis/makemsi.htm

SNEJ

SNEJ
  • Members
  • 2 posts

Posted 26 March 2002 - 09:34

Hi,

I just ran a quick test that retrieves a few information about the system using WMI in a Custom Action Type 6:

 Dim Systemset
 Dim System
 Dim sRet
 
 Set Systemset = GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem")
 For Each System In Systemset
   sRet = System.Caption & chr(13)
   sRet = sRet & System.Manufacturer & chr(13)
   sRet = sRet & "Version: " + System.Version & chr(13)
   sRet = sRet & "Locale: " + System.Locale & chr(13)
   sRet = sRet & "Windows Directory: " + System.WindowsDirectory & chr(13)
   sRet = sRet & "Total memory: " + System.TotalVisibleMemorySize + " bytes" & chr(13)
   sRet = sRet & "Serial Number: " + System.SerialNumber & chr(13)
 Next

 msgbox sRet


I put it at the end of the sequence table and it has been executed without any problems. What code do you try to run?

regards,
- Jens -

dbareis

dbareis
  • Full Members
  • 85 posts

Posted 26 March 2002 - 22:05

Hi,

I have pretty much tried what you have, I've decided that it is likely to be a security issue (if only it just told me that I don't know what MS has against informative error messages...).

I think the MSI might be executing under the system account? If so it may not be allowed to get the WMI objects...

I am doing this on my hand built workstation as there are no test machines available for now, I will retry when they become available.

Thanks for confirming that it does work (at least somewhere).

Bye
Dennis
---
Dennis Bareis (dbareis@No.Spam.gmail.com)
Free MSI update/creation tool (MAKEMSI):
http://users.cyberon...eis/makemsi.htm