Class: ReservedNames::Win32::Version
- Includes:
- Chef::ReservedNames::Win32::API::Macros, Chef::ReservedNames::Win32::API::System
- Defined in:
- lib/chef/win32/version.rb
Constant Summary collapse
- WIN_VERSIONS =
{ "Windows 7" => {:major => 6, :minor => 1, :callable => lambda{ @product_type == VER_NT_WORKSTATION }}, "Windows Server 2008 R2" => {:major => 6, :minor => 1, :callable => lambda{ @product_type != VER_NT_WORKSTATION }}, "Windows Server 2008" => {:major => 6, :minor => 0, :callable => lambda{ @product_type != VER_NT_WORKSTATION }}, "Windows Vista" => {:major => 6, :minor => 0, :callable => lambda{ @product_type == VER_NT_WORKSTATION }}, "Windows Server 2003 R2" => {:major => 5, :minor => 2, :callable => lambda{ get_system_metrics(SM_SERVERR2) != 0 }}, "Windows Home Server" => {:major => 5, :minor => 2, :callable => lambda{ (@suite_mask & VER_SUITE_WH_SERVER) == VER_SUITE_WH_SERVER }}, "Windows Server 2003" => {:major => 5, :minor => 2, :callable => lambda{ get_system_metrics(SM_SERVERR2) == 0 }}, "Windows XP" => {:major => 5, :minor => 1}, "Windows 2000" => {:major => 5, :minor => 0} }
Constants included from Chef::ReservedNames::Win32::API::System
Chef::ReservedNames::Win32::API::System::PRODUCT_BUSINESS, Chef::ReservedNames::Win32::API::System::PRODUCT_BUSINESS_N, Chef::ReservedNames::Win32::API::System::PRODUCT_CLUSTER_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_DATACENTER_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_DATACENTER_SERVER_CORE, Chef::ReservedNames::Win32::API::System::PRODUCT_DATACENTER_SERVER_CORE_V, Chef::ReservedNames::Win32::API::System::PRODUCT_DATACENTER_SERVER_V, Chef::ReservedNames::Win32::API::System::PRODUCT_ENTERPRISE, Chef::ReservedNames::Win32::API::System::PRODUCT_ENTERPRISE_E, Chef::ReservedNames::Win32::API::System::PRODUCT_ENTERPRISE_N, Chef::ReservedNames::Win32::API::System::PRODUCT_ENTERPRISE_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_ENTERPRISE_SERVER_CORE, Chef::ReservedNames::Win32::API::System::PRODUCT_ENTERPRISE_SERVER_CORE_V, Chef::ReservedNames::Win32::API::System::PRODUCT_ENTERPRISE_SERVER_IA64, Chef::ReservedNames::Win32::API::System::PRODUCT_ENTERPRISE_SERVER_V, Chef::ReservedNames::Win32::API::System::PRODUCT_HOME_BASIC, Chef::ReservedNames::Win32::API::System::PRODUCT_HOME_BASIC_E, Chef::ReservedNames::Win32::API::System::PRODUCT_HOME_BASIC_N, Chef::ReservedNames::Win32::API::System::PRODUCT_HOME_PREMIUM, Chef::ReservedNames::Win32::API::System::PRODUCT_HOME_PREMIUM_E, Chef::ReservedNames::Win32::API::System::PRODUCT_HOME_PREMIUM_N, Chef::ReservedNames::Win32::API::System::PRODUCT_HOME_PREMIUM_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_HOME_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_HYPERV, Chef::ReservedNames::Win32::API::System::PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT, Chef::ReservedNames::Win32::API::System::PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING, Chef::ReservedNames::Win32::API::System::PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY, Chef::ReservedNames::Win32::API::System::PRODUCT_PROFESSIONAL, Chef::ReservedNames::Win32::API::System::PRODUCT_PROFESSIONAL_E, Chef::ReservedNames::Win32::API::System::PRODUCT_PROFESSIONAL_N, Chef::ReservedNames::Win32::API::System::PRODUCT_SB_SOLUTION_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_SERVER_FOR_SMALLBUSINESS, Chef::ReservedNames::Win32::API::System::PRODUCT_SERVER_FOR_SMALLBUSINESS_V, Chef::ReservedNames::Win32::API::System::PRODUCT_SERVER_FOUNDATION, Chef::ReservedNames::Win32::API::System::PRODUCT_SMALLBUSINESS_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_SOLUTION_EMBEDDEDSERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_STANDARD_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_STANDARD_SERVER_CORE, Chef::ReservedNames::Win32::API::System::PRODUCT_STANDARD_SERVER_CORE_V, Chef::ReservedNames::Win32::API::System::PRODUCT_STANDARD_SERVER_V, Chef::ReservedNames::Win32::API::System::PRODUCT_STARTER, Chef::ReservedNames::Win32::API::System::PRODUCT_STARTER_E, Chef::ReservedNames::Win32::API::System::PRODUCT_STARTER_N, Chef::ReservedNames::Win32::API::System::PRODUCT_STORAGE_ENTERPRISE_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_STORAGE_EXPRESS_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_STORAGE_STANDARD_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_STORAGE_WORKGROUP_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_ULTIMATE, Chef::ReservedNames::Win32::API::System::PRODUCT_ULTIMATE_E, Chef::ReservedNames::Win32::API::System::PRODUCT_ULTIMATE_N, Chef::ReservedNames::Win32::API::System::PRODUCT_UNDEFINED, Chef::ReservedNames::Win32::API::System::PRODUCT_WEB_SERVER, Chef::ReservedNames::Win32::API::System::PRODUCT_WEB_SERVER_CORE, Chef::ReservedNames::Win32::API::System::SM_SERVERR2, Chef::ReservedNames::Win32::API::System::VER_NT_DOMAIN_CONTROLLER, Chef::ReservedNames::Win32::API::System::VER_NT_SERVER, Chef::ReservedNames::Win32::API::System::VER_NT_WORKSTATION, Chef::ReservedNames::Win32::API::System::VER_SUITE_BACKOFFICE, Chef::ReservedNames::Win32::API::System::VER_SUITE_BLADE, Chef::ReservedNames::Win32::API::System::VER_SUITE_COMPUTE_SERVER, Chef::ReservedNames::Win32::API::System::VER_SUITE_DATACENTER, Chef::ReservedNames::Win32::API::System::VER_SUITE_EMBEDDEDNT, Chef::ReservedNames::Win32::API::System::VER_SUITE_ENTERPRISE, Chef::ReservedNames::Win32::API::System::VER_SUITE_PERSONAL, Chef::ReservedNames::Win32::API::System::VER_SUITE_SINGLEUSERTS, Chef::ReservedNames::Win32::API::System::VER_SUITE_SMALLBUSINESS, Chef::ReservedNames::Win32::API::System::VER_SUITE_SMALLBUSINESS_RESTRICTED, Chef::ReservedNames::Win32::API::System::VER_SUITE_STORAGE_SERVER, Chef::ReservedNames::Win32::API::System::VER_SUITE_TERMINAL, Chef::ReservedNames::Win32::API::System::VER_SUITE_WH_SERVER
Instance Method Summary collapse
-
#initialize ⇒ Version
constructor
A new instance of Version.
Constructor Details
#initialize ⇒ Version
Returns a new instance of Version.
44 45 46 47 48 49 50 51 52 |
# File 'lib/chef/win32/version.rb', line 44 def initialize @major_version, @minor_version, @build_number = get_version ver_info = get_version_ex @product_type = ver_info[:w_product_type] @suite_mask = ver_info[:w_suite_mask] @sp_major_version = ver_info[:w_service_pack_major] @sp_minor_version = ver_info[:w_service_pack_minor] @sku = get_product_info(@major_version, @minor_version, @sp_major_version, @sp_minor_version) end |