Module: Bnicovideo::WindowsDetector
- Defined in:
- lib/bnicovideo/windows_detector.rb
Class Method Summary collapse
Class Method Details
.check ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bnicovideo/windows_detector.rb', line 8 def self.check gvex = Win32API.new('kernel32','GetVersionEx','P','I') buf = [148,0,0,0,0,"\0"*128].pack("LLLLLa128") gvex.call(buf) arr = buf[0,20].unpack("LLLLL") osv = arr[1].to_s if osv == '6' return 'winvista' elsif osv == '5' return 'winxp' else return 'win95' end end |