Created
May 4, 2015 19:37
-
-
Save anonymous/63077bb53ca15d06294e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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