Can't get example to work....

B

Brad

Hello,

I must be doing something wrong but I don't know what. I'm trying to
use this example to learn more about the Win32API::Registry library.

require 'win32/registry.rb'

$VERBOSE = nil

appList = []

Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Microsoft\Windows
\CurrentVersion\Uninstall') do |root|

root.each_key do |k|
Win32::Registry::HKEY_LOCAL_MACHINE.open(root.keyname + "\\#{k[0]}")
do |key|
key.each do |i|
if i[0] == "DisplayName"
appList.push(i[2])
end
end
end
end

When I run it I get: uninitialized constant Win32>

How do I fix this?

Thank you.

Brad
 
L

lrlebron

Hello,

I must be doing something wrong but I don't know what. I'm trying to
use this example to learn more about the Win32API::Registry library.

require 'win32/registry.rb'

$VERBOSE = nil

appList = []

Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Microsoft\Windows
\CurrentVersion\Uninstall') do |root|

root.each_key do |k|
Win32::Registry::HKEY_LOCAL_MACHINE.open(root.keyname + "\\#{k[0]}")
do |key|
key.each do |i|
if i[0] == "DisplayName"
appList.push(i[2])
end
end
end
end

When I run it I get: uninitialized constant Win32>

How do I fix this?

Thank you.

Brad

I've used the same exact script and it works on my pc.

Did you check to make sure the Win32 libraries are installed. On my pc
they're in
C:\ruby\lib\ruby\1.8\win32


Luis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,342
Members
48,018
Latest member
DelilahDen

Latest Threads

Top