but would like to query the registry from ruby. Just thinking outloud
here, haven't found a tutorial invovling the registry and ruby which I
find useful yet
C:\msi>
C:\msi>
C:\msi>dir
Volume in drive C has no label.
Volume Serial Number is 0491-510F
but would like to query the registry from ruby. Just thinking outloud
here, haven't found a tutorial invovling the registry and ruby which I
find useful yet
The following is what I was able to figure out from the standard
library API docs at http://www.ruby-doc.org/stdlib/\. It's pretty
Rubyish once you get going.
\Microsoft\Windows\Installer').each_value do |subkey, type, data|
irb* puts "#{subkey} (#{type}): #{data}"
end
The only problem I see with this is that you get the constant value
for type (4 in this case) rather than the constant name (REG_DWORD).
Is that what you were wanting to do?
I don't have this key on my machine. Only HKEY_CURRENT_USER\Software
\Policies\Microsoft\SystemCertificates which has subkeys, but no
values, but all keys should be similar to the above.
···
On Dec 7, 7:15 pm, Thufir <hawat.thu...@gmail.com> wrote:
# File Win32API/lib/win32/registry.rb, line 624
def each_value
index = 0
while true
begin
subkey = API.EnumValue(@hkey, index)
rescue Error
break
end
begin
type, data = read(subkey)
rescue Error
next
end
yield subkey, type, data
index += 1
end
index
end