From 12a77ec34aa00b5b20a47c678abc26013d4a8c79 Mon Sep 17 00:00:00 2001 From: Alejandro Exojo Date: Tue, 8 Dec 2015 16:15:02 +0100 Subject: [PATCH] Optionally include the updater in the package For simplicity, one application could ship the updater next to it, and when upgrading, copy it outside the normal application directory to upgrade. Then upgrading the application upgrades the updater too, but for that including the updater in the package is needed. --- tools/create-packages.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/create-packages.rb b/tools/create-packages.rb index 583dce6..380fee6 100755 --- a/tools/create-packages.rb +++ b/tools/create-packages.rb @@ -272,6 +272,7 @@ def package_for_file(file) target_version = nil target_platform = nil zip_flags = nil +include_updater = nil OptionParser.new do |parser| parser.banner = "#{$0} [options] " @@ -287,6 +288,9 @@ def package_for_file(file) parser.on(nil,"--bzip2","Use bzip2 compression (requires that 'zip' supports the -Z bz2 argument)") do zip_flags = "-Z bzip2" end + parser.on(nil,"--include-updater","Don't skip the updater executable file when creating packages") do + include_updater = true + end end.parse! raise "Platform not specified (use -p option)" if !target_platform @@ -335,13 +339,13 @@ def package_for_file(file) quoted_files = [] files.each do |file| - # do not package the updater binary into a zip file - - # it must be downloaded uncompressed if package_config.is_updater(file) if (!updater_binary_input_path) updater_binary_input_path = file end - next + # Unless told otherwise, do not package the updater binary into the + # zip file - to be be downloaded uncompressed in a separate package. + next unless include_updater end quoted_files << "\"#{strip_prefix(file,input_dir)}\"" end