Skip to content

Commit

Permalink
Merge pull request #1096 from chef/gcs-devel/customize-zip-command
Browse files Browse the repository at this point in the history
Gcs devel/customize zip command
  • Loading branch information
poorndm authored Dec 14, 2022
2 parents 2c058e1 + a1f6649 commit 8314373
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions lib/omnibus/packagers/msi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,30 @@ def gem_path(glob = NULL)
end
expose :gem_path

#
# Provide a custom zip name
#
# @example
# zip_name 'chef'
#
# @param [TrueClass, FalseClass] value
# whether we're building a zip-based MSI or not
#
# @return [TrueClass, FalseClass]
# whether we're building a zip-based MSI or not
def zip_name(val = NULL)
if null?(val)
@zip_name || project.name
else
unless val.is_a?(String)
raise InvalidValue.new(:zip_name, "be an String")
end

@zip_name = val
end
end
expose :zip_name

#
# @!endgroup
# --------------------------------------------------
Expand Down Expand Up @@ -443,7 +467,7 @@ def write_bundle_file
def zip_command
<<-EOH.split.join(" ").squeeze(" ").strip
7z a -r
#{windows_safe_path(staging_dir)}\\#{project.name}.zip
#{windows_safe_path(staging_dir)}\\#{zip_name}.zip
#{windows_safe_path(project.install_dir)}\\*
EOH
end
Expand All @@ -457,7 +481,7 @@ def zip_command
def heat_command
if fast_msi
<<-EOH.split.join(" ").squeeze(" ").strip
heat.exe file "#{project.name}.zip"
heat.exe file "#{zip_name}.zip"
-cg ProjectDir
-dr INSTALLLOCATION
-nologo -sfrag -srd -sreg -gg
Expand Down

0 comments on commit 8314373

Please sign in to comment.