Nicolas, It is possible. Have a look at this recent write up I did - http://puppetlabs.com/blog/how-avoid-common-windows-gotchas-puppet (it even has a code example to do EXACTLY what you are asking).
On Thu, Jun 5, 2014 at 10:07 AM, nicolas boquet <[email protected]> wrote: > Hello, > > I've a problem with the module "facter/util/registry"... > > i want to read key / value from registry. On windows x86, it's OK but in > on windows x64, i've this error: > ERROR: The system was unable to find the specified registry key or value. > > > i 've create a fact to know the version of ocs inventory and the version > of fusioninventory-agent: > this line work > Facter::Util::Registry.hklm_read('SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\OCS > Inventory Agent', 'DisplayVersion') > but this line doesn't work > Facter::Util::Registry.hklm_read('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent', > 'DisplayVersion') > > > > for exemple, in cmd.exe, i can do: > C:\Windows\System32\reg.exe export > "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent" > "C:\Uninstall.reg" > => it's ok, i've my file uninstall.reg with my key FusionInventory-Agent > > [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent] > "DisplayName"="FusionInventory Agent 2.3.6 (x64 edition)" > "DisplayVersion"="2.3.6" > ........ > > but with facter: > Facter::Util::Resolution.exec('C:\Windows\System32\reg.exe export > "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent" > "C:\Uninstall.reg"') > ERROR: The system was unable to find the specified registry key or value. > > In fact, i want to know if it's possible with facter to read a 64 bit > registry from facter... > > Thank you and sorry for my english... > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/ae7676cb-94df-46d3-8c5e-e8e800abb940%40googlegroups.com > <https://groups.google.com/d/msgid/puppet-users/ae7676cb-94df-46d3-8c5e-e8e800abb940%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Rob Reynolds Developer, Puppet Labs *Join us at **PuppetConf 2014 <http://puppetconf.com>**, September 20-24 in San Francisco* *Register by June 5th to take advantage of the Early Adopter discount <http://links.puppetlabs.com/puppetconf-early-adopter> **--**save $349!* -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAMJiBK4LEB8SJx2VaBQ-avA1SQkBpBouf25Z-xEpozQPc9pbyw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
