Skip to content

Instantly share code, notes, and snippets.

Created May 4, 2015 19:37
Show Gist options
  • Save anonymous/63077bb53ca15d06294e to your computer and use it in GitHub Desktop.
Save anonymous/63077bb53ca15d06294e to your computer and use it in GitHub Desktop.
Facter.add(:notepadpp) do
# restricts module to windows
confine :kernel => :windows
setcode do
require 'facter/util/registry'
notepadpp = nil
regvalue = Facter::Util::Registry.hklm_read('SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++', 'DisplayVersion')
if regvalue and not regvalue.empty?
notepadpp = regvalue.to_s
else
notepadpp
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment