# class Chef::Provider::Package::Windows

### Public Instance Methods

install_package(name, version) click to toggle source

Chef::Provider::Package action_install + action_remove call #install_package + #remove_package Pass those calls to the correct sub-provider

    # File lib/chef/provider/package/windows.rb, line 70
    def install_package(name, version)
      package_provider.install_package(name, version)
    end

installer_type() click to toggle source

    # File lib/chef/provider/package/windows.rb, line 52
    def installer_type
      @installer_type ||= begin
        if @new_resource.installer_type
          @new_resource.installer_type
        else
          file_extension = ::File.basename(@new_resource.source).split(".").last.downcase

          if file_extension == "msi"
            :msi
          else
            raise ArgumentError, "Installer type for Windows Package '#{@new_resource.name}' not specified and cannot be determined from file extension '#{file_extension}'"
          end
        end
      end
    end

load_current_resource() click to toggle source

#load_current_resource is run in Chef::Provider#run_action when not in whyrun_mode?

    # File lib/chef/provider/package/windows.rb, line 34
    def load_current_resource
      @current_resource = Chef::Resource::WindowsPackage.new(@new_resource.name)
      @current_resource.version(package_provider.installed_version)
      @new_resource.version(package_provider.package_version)
      @current_resource
    end

package_provider() click to toggle source

    # File lib/chef/provider/package/windows.rb, line 41
    def package_provider
      @package_provider ||= begin
        case installer_type
        when :msi
          Chef::Provider::Package::Windows::MSI.new(@new_resource)
        else
          raise "Unable to find a Chef::Provider::Package::Windows provider for installer_type '#{installer_type}'"
        end
      end
    end

remove_package(name, version) click to toggle source

    # File lib/chef/provider/package/windows.rb, line 74
    def remove_package(name, version)
      package_provider.remove_package(name, version)
    end