From ee6e6709a1d4613ae74ee5b8cf1098c8aba2db1e Mon Sep 17 00:00:00 2001 From: Gregory Schofield Date: Wed, 30 Nov 2022 16:49:32 -0500 Subject: [PATCH 1/2] Make zip name configurable for msi packages Signed-off-by: Gregory Schofield --- lib/omnibus/packagers/msi.rb | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/omnibus/packagers/msi.rb b/lib/omnibus/packagers/msi.rb index f6c51e0b4..c3dc0b477 100644 --- a/lib/omnibus/packagers/msi.rb +++ b/lib/omnibus/packagers/msi.rb @@ -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 # -------------------------------------------------- @@ -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 From a753f0b3874653760693af86fe76f0391493e1da Mon Sep 17 00:00:00 2001 From: Gregory Schofield Date: Wed, 30 Nov 2022 17:52:09 -0500 Subject: [PATCH 2/2] Change where zip_name is used Signed-off-by: Gregory Schofield --- lib/omnibus/packagers/msi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/omnibus/packagers/msi.rb b/lib/omnibus/packagers/msi.rb index c3dc0b477..c42b7f5a8 100644 --- a/lib/omnibus/packagers/msi.rb +++ b/lib/omnibus/packagers/msi.rb @@ -481,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