From 4febe680b65347e496323e9505a8c6f13cca661e Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 18 Dec 2010 03:22:55 -0500 Subject: [PATCH] Updated Braid installer for 32/64-bit installs. --- examples/braid/make.sh | 4 +-- examples/braid/scripts/config.lua | 59 +++++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/examples/braid/make.sh b/examples/braid/make.sh index d7cc634..4af3fad 100755 --- a/examples/braid/make.sh +++ b/examples/braid/make.sh @@ -13,8 +13,8 @@ if [ "$1" = "--debug" ]; then DEBUG=1 fi -if [ ! -f data/data/package0.zip ]; then - echo "We don't see data/data/package0.zip ..." +if [ ! -f data/gamedata/data/package0.zip ]; then + echo "We don't see data/gamedata/data/package0.zip ..." echo " Either you're in the wrong directory, or you didn't copy the" echo " install data into here (it's unreasonably big to store it in" echo " revision control for no good reason)." diff --git a/examples/braid/scripts/config.lua b/examples/braid/scripts/config.lua index 49f4b9d..1500f8a 100644 --- a/examples/braid/scripts/config.lua +++ b/examples/braid/scripts/config.lua @@ -1,7 +1,16 @@ -local GAME_INSTALL_SIZE = 158514678; +local GAME_INSTALL_SIZE = 144119222 +local X86_INSTALL_SIZE = 14440962 +local AMD64_INSTALL_SIZE = 20224358 local _ = MojoSetup.translate +-- grumble. +local is32bit = + MojoSetup.info.machine == "x86" or + MojoSetup.info.machine == "i386" or + MojoSetup.info.machine == "i586" or + MojoSetup.info.machine == "i686" + Setup.Package { vendor = "number-none.com", @@ -22,20 +31,64 @@ Setup.Package Setup.Readme { description = _("Braid README"), - source = _("README-linux.txt") + source = _("gamedata/README-linux.txt") }, Setup.Option { + -- !!! FIXME: All this filter nonsense is because + -- !!! FIXME: source = "base:///some_dir_in_basepath/" + -- !!! FIXME: doesn't work, since it wants a file when drilling + -- !!! FIXME: for the final archive, not a directory. Fixing this + -- !!! FIXME: properly is a little awkward, though. + value = true, required = true, disabled = false, bytes = GAME_INSTALL_SIZE, description = "Braid", + Setup.OptionGroup + { + description = _("CPU Architecture"), + Setup.Option + { + value = is32bit, + required = is32bit, + disabled = false, + bytes = X86_INSTALL_SIZE, + description = "x86", + Setup.File + { + wildcards = "x86/*"; + filter = function(fn) + return string.gsub(fn, "^x86/", "", 1), nil + end + }, + }, + Setup.Option + { + value = not is32bit, + required = false, + disabled = is32bit, + bytes = AMD64_INSTALL_SIZE, + description = "amd64", + Setup.File + { + wildcards = "amd64/*"; + filter = function(fn) + return string.gsub(fn, "^amd64/", "", 1), nil + end + }, + }, + }, + Setup.File { - -- Just install everything we see... + wildcards = "gamedata/*"; + filter = function(fn) + return string.gsub(fn, "^gamedata/", "", 1), nil + end }, Setup.DesktopMenuItem