Archive: How to access WMI from NSIS?


How to access WMI from NSIS?
I want to code some logic in NSIS that is currently being done with vbscript. (I think the NSIS interface is much more professional looking than popup message boxes from vbscript.)

The vbs uses a lot of WMI calls to query WIN32_SerialPort, (I think there are some other classes, but I left the code at the office). Can I do it with the SYSTEM:: plugin? Or do I just have to find the registry locations for each piece of data I'm interested in?

I also thought about calling the vbscript from NSIS, but I need to figure out how to handle the WMI responses (collections, etc) and get that back into the NSIS to be processed.

Don


WMI has a COM API which you can use with the System plug-in. However, using COM with System isn't that comfortable and best suited for small-sized scripts. You have to look for the ordinal of every method in the header files before you can call it.