From 51fe1be4f7b4be1771692160c8b8f31b0dd4b63e Mon Sep 17 00:00:00 2001 From: shatty Date: Mon, 22 Dec 2003 22:17:38 +0000 Subject: [PATCH] tracker-friendly install script git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5732 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- Jamrules | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Jamrules b/Jamrules index 3f4ceeebdd..baa0962611 100644 --- a/Jamrules +++ b/Jamrules @@ -2099,9 +2099,28 @@ rule PackageInstallScript actions together PackageInstallScript { - - echo "#!/bin/sh" > $(1) ; - echo "unzip -d / install.zip" >> $(1) ; +echo '#!/bin/sh +base=`dirname "$0"` +cd $base +if [ -n "$TTY" ] +then + unzip -d / install.zip +else + response=`alert "Would you like to automatically overwrite existing files, or receive a prompt?" "Overwrite" "Prompt"` + if [ $response == "Overwrite" ] + then + unzip -od / install.zip + alert "Finished installing" "Thanks" + else + if [ -e /boot/beos/apps/Terminal ] + then + terminal=/boot/beos/apps/Terminal + else + terminal=`query Terminal | head -1` + fi + $terminal -t "installer" /bin/sh $0 + fi +fi' > $(1) ; chmod 755 $(1) ; }