[Win32utils-devel] Interest in win32-installer

Berger, Daniel Daniel.Berger at qwest.com
Wed May 28 15:35:52 EDT 2008


> -----Original Message-----
> From: win32utils-devel-bounces at rubyforge.org 
> [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of 
> Paul Nasrat
> Sent: Monday, May 26, 2008 10:37 AM
> To: win32utils-devel at rubyforge.org
> Subject: [Win32utils-devel] Interest in win32-installer
> I was wondering if people would be interested in wrapping 
> msi.dll functionality,
> I've started writing a small library to enable enumeration of 
> products installed via Windows Installer using win32api (I 
> know I can also query via win32ole to win32_product but I 
> don't seem to get all the properties that are in msi.h).

I'm curious which properties you don't get. I did notice that there are
actually a few product related WMI classes.
> It's a little messy, and I've not got far as I'm pretty new 
> at ruby and win32 programming coming from mostly a 
> python/*nix background, so I thought I'd try to get some 
> early feedback. It's inspired by psmsi
> (http://www.codeplex.com/psmsi/) but I want to be able to get 
> installer information (and eventually information from an 
> msi) in ruby as it'd help towards getting a windows installer 
> puppet package provider.

If you want to use the Windows API directly, you could wrap the MSI
functions you need and call them. For example:

# Warning: untested code
require 'win32/api'
include Win32

MsiGetProductInfo = API.new('MsiGetProductInfo', 'PPPP', 'I', 'msi)

buf = 0.chr * 512 # Or whatever you need, depending on the property
buf_val = [buf.size].pack('L')

MsiGetProductInfo.call(some_product, some_property, buf, buf_val)

> I'm trying to think how best to test the code - based upon 
> looking at the tests in psmsi I was wondering if there is a 
> ruby library that would allow me to set up temporary keys in 
> the registry so I can actually set expectations/assertions on 
> known values for installed software - this should be possible 
> by abusing RegOverridePredefKey.

Ruby comes with a win32-registry library. I think you could use that.



This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.

More information about the win32utils-devel mailing list