summaryrefslogtreecommitdiff
path: root/lib/chef/resource/windows_package.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource/windows_package.rb')
-rw-r--r--lib/chef/resource/windows_package.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/resource/windows_package.rb b/lib/chef/resource/windows_package.rb
index 4965f3f117..7f70f876d0 100644
--- a/lib/chef/resource/windows_package.rb
+++ b/lib/chef/resource/windows_package.rb
@@ -32,16 +32,20 @@ class Chef
allowed_actions :install, :remove
+ def initialize(name, run_context=nil)
+ super
+ @source ||= source(@package_name) if @package_name.downcase.end_with?('.msi')
+ end
+
# Unique to this resource
property :installer_type, Symbol
property :timeout, [ String, Integer ], default: 600
# In the past we accepted return code 127 for an unknown reason and 42 because of a bug
property :returns, [ String, Integer, Array ], default: [ 0 ], desired_state: false
- property :source, String, name_property: true,
+ property :source, String,
coerce: proc { |s| uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false) }
property :checksum, String, desired_state: false
property :remote_file_attributes, Hash, desired_state: false
-
end
end
end