views:

28

answers:

0

I Know using wmi query "WIN32_product" one can read the list of installed applications but the list is different from add/remove program list under control panel. Another approach would be to read Software\Microsoft\Windows\CurrentVersion\Uninstall in windows registry?

I am using the following few lines of ruby code to do that but it is not working

For this example I am looking for a software by the name of Branding (it shows when I go thru regedit in my windows 7 PC)

Win32::Registry::HKEY_LOCAL_MACHINE.open('Software\Microsoft\Windows\CurrentVersion\Uninstall\Branding') do |reg| reg_typ, reg_val = reg.read('') return reg_val end

Error Message after running this piece of code

win32/registry.rb:528:in open': The system cannot find the file specified. (Win32::Registry::Error) from win32/registry.rb:608:inopen'

What is wrong with this piece of code???