Browse | Submit A New Snippet | Create A Package

 

Windows Registry

Type:
Function
Category:
Other
License:
GNU General Public License
Language:
Ruby
 
Description:
Check if a given software is installed on the local machine.
For more information about Registry manipulation look at 'win32/registry.rb'

Versions Of This Snippet::

Cici Wirachmat
Snippet ID Download Version Date Posted Author Delete
61300012011-06-17 03:09Cici Wirachmat
Changes since last version::
require'win32/registry.rb'
66.00012004-11-29 14:52David Dembinski
Changes since last version::
Not a modification so much as another snippet that fits under the heading of "Windows Registry".

Outputs HTML describing the software currently installed on a Windows machine.
17.0012003-10-16 22:12Rodrigo Bermejo

Download a raw-text version of this code by clicking on "Download Version"

 


Latest Snippet Version: :0001

require'win32/registry.rb'
$VERBOSE=nil
AppList=[]
win32::registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Microsoft\WindowsVersion\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

Print"<\html><head><title>Software on#ENV['COMPUTERNAME']}</title></head>\n"
Print"<body><h3>Software on#ENV['COMPUTERNAME']}</h3>\n"
Print"<ul>"
ApplyList.sort.each do|app|
       Print"<li>#{app.to_s}\n"

end
Print"</ul>\n"
Print"</body></html>\n"
		

Submit a new version

You can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..