You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

makeInstallerLinux.sh 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. #!/bin/sh
  2. #
  3. # This script generates a .run file that will install DMDirc
  4. #
  5. # DMDirc - Open Source IRC Client
  6. # Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
  7. #
  8. # Permission is hereby granted, free of charge, to any person obtaining a copy
  9. # of this software and associated documentation files (the "Software"), to deal
  10. # in the Software without restriction, including without limitation the rights
  11. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. # copies of the Software, and to permit persons to whom the Software is
  13. # furnished to do so, subject to the following conditions:
  14. #
  15. # The above copyright notice and this permission notice shall be included in
  16. # all copies or substantial portions of the Software.
  17. #
  18. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  24. # SOFTWARE.
  25. # Final Name of the installer (without file extention)
  26. INSTALLERNAME=DMDirc-Setup
  27. # Location of .run stub start
  28. STARTLINE=`grep -n "^###START INCLUDE###$" $0`
  29. STARTLINE=$((${STARTLINE%%:*} + 1))
  30. # full name of the file to output to
  31. RUNNAME="${PWD}/${INSTALLERNAME}.run"
  32. # Compress stuff!
  33. compress() {
  34. tar cvfh - $@ | gzip - 2>/dev/null >>${RUNNAME} || {
  35. echo "Compression failed."
  36. kill -15 $$;
  37. };
  38. }
  39. # Go!
  40. echo "-----------"
  41. if [ -e "${RUNNAME}" ]; then
  42. echo "Removing existing .run file"
  43. rm -Rf ./*.run
  44. fi
  45. showHelp() {
  46. echo "This will generate a DMDirc installer for a unix based system."
  47. echo "The following command line arguments are known:"
  48. echo "---------------------"
  49. echo "-h, --help Help information"
  50. echo "-r, --release <version> Generate a file based on an svn tag (or branch with -b aswell)"
  51. echo "-b, --branch Release in -r is a branch "
  52. echo "-p, --plugins <plugins> What plugins to add to the jar file"
  53. echo "-c, --compile Recompile the .jar file"
  54. echo " --jre Include the JRE in this installer"
  55. echo " --jre64 Include the 64-Bit JRE in this installer"
  56. echo " --jar <file> use <file> as DMDirc.jar"
  57. echo " --current Use the current folder as the base for the build"
  58. echo "-t, --tag <tag> Tag to add to final exe name to distinguish this build from a standard build"
  59. echo "-k, --keep Keep the existing source tree when compiling"
  60. echo " (don't svn update beforehand)"
  61. echo "---------------------"
  62. exit 0;
  63. }
  64. # Check for some CLI params
  65. compileJar="false"
  66. updateSVN="true"
  67. isRelease=""
  68. finalTag=""
  69. BRANCH="0"
  70. plugins=""
  71. location="../../../"
  72. jarfile=""
  73. current=""
  74. jre=""
  75. jrename="jre" # Filename for JRE without the .bin
  76. while test -n "$1"; do
  77. case "$1" in
  78. --plugins|-p)
  79. shift
  80. plugins=${1}
  81. ;;
  82. --jar)
  83. shift
  84. jarfile=${1}
  85. ;;
  86. --jre)
  87. jre="http://www.dmdirc.com/getjava/linux/i686"
  88. ;;
  89. --jre64)
  90. jre="http://www.dmdirc.com/getjava/linux/x86_64"
  91. jrename="jre64"
  92. ;;
  93. --current)
  94. location="../../"
  95. current="1"
  96. ;;
  97. --compile|-c)
  98. compileJar="true"
  99. ;;
  100. --release|-r)
  101. shift
  102. isRelease=${1}
  103. ;;
  104. --tag|-t)
  105. shift
  106. finalTag=${1}
  107. RUNNAME="${PWD}/${INSTALLERNAME}-${1}.run"
  108. ;;
  109. --keep|-k)
  110. updateSVN="false"
  111. ;;
  112. --help|-h)
  113. showHelp;
  114. ;;
  115. --branch|-b)
  116. BRANCH="1"
  117. ;;
  118. esac
  119. shift
  120. done
  121. if [ "" = "${current}" ]; then
  122. jarPath="${location}trunk"
  123. else
  124. jarPath="${location}"
  125. fi
  126. if [ "${isRelease}" != "" ]; then
  127. if [ "${BRANCH}" != "0" ]; then
  128. if [ -e "${location}/${isRelease}" ]; then
  129. jarPath="${location}/${isRelease}"
  130. else
  131. echo "Branch "${isRelease}" not found."
  132. exit 1;
  133. fi
  134. else
  135. if [ -e "${location}/${isRelease}" ]; then
  136. jarPath="${location}/${isRelease}"
  137. else
  138. echo "Tag "${isRelease}" not found."
  139. exit 1;
  140. fi
  141. fi
  142. fi
  143. if [ "" = "${jarfile}" ]; then
  144. jarfile=${jarPath}"/dist/DMDirc.jar"
  145. if [ ! -e ${jarPath}"/dist/DMDirc.jar" -o "${compileJar}" = "true" ]; then
  146. echo "Creating jar.."
  147. OLDPWD=${PWD}
  148. cd ${jarPath}
  149. if [ "${updateSVN}" = "true" ]; then
  150. svn update
  151. fi
  152. rm -Rf build dist
  153. ant jar
  154. if [ ! -e "dist/DMDirc.jar" ]; then
  155. echo "There was an error creating the .jar file. Aborting."
  156. exit 1;
  157. fi;
  158. cd ${OLDPWD}
  159. fi;
  160. elif [ ! -e "${jarfile}" ]; then
  161. echo "Requested Jar file (${jarfile}) does not exist."
  162. exit 1;
  163. fi;
  164. if [ "" = "${plugins}" ]; then
  165. echo "Linking jar (${jarfile}).."
  166. ln -sf ${jarfile} "./DMDirc.jar"
  167. else
  168. echo "Copying jar (${jarfile}).."
  169. cp ${jarfile} "./DMDirc.jar"
  170. echo "Adding plugins to jar"
  171. ln -sf ${jarPath}"/plugins"
  172. pluginList=""
  173. for plugin in ${plugins}; do
  174. pluginList=${pluginList}" plugins/${plugin}"
  175. done
  176. jar -uvf "DMDirc.jar" ${pluginList}
  177. rm -Rf plugins;
  178. fi
  179. echo "Creating .run file"
  180. echo "Adding stub.."
  181. tail -n +${STARTLINE} $0 > ${RUNNAME}
  182. # Add release info.
  183. awk '{gsub(/###ADDITIONAL_STUFF###/,"isRelease=\"'${isRelease}'\"");print}' ${RUNNAME} > ${RUNNAME}.tmp
  184. mv ${RUNNAME}.tmp ${RUNNAME}
  185. FILES="DMDirc.jar";
  186. echo "Compressing files.."
  187. for FILE in "getjre.sh" "installjre.sh" "progressbar.sh"; do
  188. if [ -e "${FILE}" ]; then
  189. FILES="${FILES} ${FILE}"
  190. fi
  191. done;
  192. if [ "" != "${jre}" ]; then
  193. if [ ! -e "../common/${jrename}.bin" ]; then
  194. echo "Downloading JRE to include in installer"
  195. wget ${jre} -O ../common/${jrename}.bin
  196. fi
  197. ln -sf ../common/${jrename}.bin jre.bin
  198. FILES="${FILES} jre.bin"
  199. fi;
  200. if [ -e "setup.sh" ]; then
  201. FILES="${FILES} setup.sh"
  202. else
  203. echo "[WARNING] Creating setup-less archive. This will just extract and immediately delete the .jar file unless the -e flag is used"
  204. fi
  205. #if [ -e "../common/installer.jar" ]; then
  206. # ln -sf ../common/installer.jar ./installer.jar
  207. # FILES="${FILES} installer.jar"
  208. #else
  209. # echo "[WARNING] Creating installer-less archive - relying on setup.sh"
  210. #fi
  211. if [ -e ${jarPath}"/src/com/dmdirc/res/source/logo.svg" ]; then
  212. ln -sf ${jarPath}"/src/com/dmdirc/res/source/logo.svg" ./icon.svg
  213. FILES="${FILES} icon.svg"
  214. fi
  215. if [ "${isRelease}" != "" ]; then
  216. DOCSDIR=${jarPath}
  217. else
  218. DOCSDIR="../common"
  219. fi
  220. if [ -e "${DOCSDIR}/README.TXT" ]; then
  221. ln -sf "${DOCSDIR}/README.TXT" .
  222. FILES="${FILES} README.TXT"
  223. fi
  224. if [ -e "${DOCSDIR}/CHANGES.TXT" ]; then
  225. ln -sf "${DOCSDIR}/CHANGES.TXT" .
  226. FILES="${FILES} CHANGES.TXT"
  227. elif [ -e "${DOCSDIR}/CHANGELOG.TXT" ]; then
  228. ln -sf "${DOCSDIR}/CHANGELOG.TXT" .
  229. FILES="${FILES} CHANGELOG.TXT"
  230. fi
  231. if [ -e "${jarPath}/launcher/linux" ]; then
  232. ln -sf ${jarPath}/launcher/linux/DMDirc.sh .
  233. FILES="${FILES} DMDirc.sh"
  234. fi
  235. compress $FILES
  236. MD5BIN=`which md5sum`
  237. AWK=`which awk`
  238. getMD5() {
  239. echo "test" | ${MD5BIN} -
  240. if [ $? -eq 0 ]; then
  241. getMD5Linux $@
  242. else
  243. getMD5OSX $@
  244. fi;
  245. }
  246. getMD5Linux() {
  247. # Everything below the MD5SUM Line
  248. MD5LINE=`grep -na "^MD5=\".*\"$" ${1}`
  249. MD5LINE=$((${MD5LINE%%:*} + 1))
  250. MD5SUM=`tail -n +${MD5LINE} "${1}" | ${MD5BIN} - | ${AWK} '{print $1}'`
  251. return;
  252. }
  253. getMD5OSX() {
  254. # Everything below the MD5SUM Line
  255. MD5LINE=`grep -na "^MD5=\".*\"$" ${1}`
  256. MD5LINE=$((${MD5LINE%%:*} + 1))
  257. MD5SUM=`tail -n +${MD5LINE} "${1}" | ${MD5BIN} | ${AWK} '{print $1}'`
  258. return;
  259. }
  260. if [ "${MD5BIN}" != "" -a "${AWK}" != "" ]; then
  261. echo "Adding MD5.."
  262. MD5SUM=""
  263. getMD5 ${RUNNAME} ${MD5SUM}
  264. echo "SUM obtained is: ${MD5SUM}"
  265. LINENUM=`grep -na "^MD5=\"\"$" ${RUNNAME}`
  266. LINENUM=${LINENUM%%:*}
  267. head -n $((${LINENUM} -1)) ${RUNNAME} > ${RUNNAME}.tmp
  268. echo 'MD5="'${MD5SUM}'"' >> ${RUNNAME}.tmp
  269. tail -n +$((${LINENUM} +1)) ${RUNNAME} >> ${RUNNAME}.tmp
  270. mv ${RUNNAME}.tmp ${RUNNAME}
  271. else
  272. echo "Not Adding MD5.."
  273. fi;
  274. echo "Chmodding"
  275. chmod a+x ${RUNNAME}
  276. if [ "${isRelease}" != "" ]; then
  277. if [ "${BRANCH}" = "1" ]; then
  278. isRelease=branch-${isRelease}
  279. fi;
  280. if [ "" != "${finalTag}" ]; then
  281. finalTag="-${finalTag}"
  282. fi;
  283. finalname=DMDirc-${isRelease}-Setup${finalTag}.run
  284. else
  285. finalname=${RUNNAME##*/}
  286. fi;
  287. if [ "" != "${jre}" ]; then
  288. finalname=`echo ${finalname} | sed "s/.run$/.${jrename}.run/"`
  289. fi;
  290. mv ${RUNNAME} ../output/${finalname}
  291. mv setup.sh setup.sh.tmp
  292. mv getjre.sh getjre.sh.tmp
  293. mv installjre.sh installjre.sh.tmp
  294. mv progressbar.sh progressbar.sh.tmp
  295. rm -f ${FILES}
  296. mv setup.sh.tmp setup.sh
  297. mv getjre.sh.tmp getjre.sh
  298. mv installjre.sh.tmp installjre.sh
  299. mv progressbar.sh.tmp progressbar.sh
  300. echo "-----------"
  301. echo "Done."
  302. echo "-----------"
  303. # and Done \o
  304. exit 0;
  305. ### Everything below here is part of the .run stub.
  306. ###START INCLUDE###
  307. #!/bin/sh
  308. #
  309. # This script installs dmdirc
  310. #
  311. # DMDirc - Open Source IRC Client
  312. # Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
  313. #
  314. # Permission is hereby granted, free of charge, to any person obtaining a copy
  315. # of this software and associated documentation files (the "Software"), to deal
  316. # in the Software without restriction, including without limitation the rights
  317. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  318. # copies of the Software, and to permit persons to whom the Software is
  319. # furnished to do so, subject to the following conditions:
  320. #
  321. # The above copyright notice and this permission notice shall be included in
  322. # all copies or substantial portions of the Software.
  323. #
  324. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  325. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  326. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  327. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  328. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  329. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  330. # SOFTWARE.
  331. MD5=""
  332. # Check the which command exists
  333. WHICH=`which`
  334. if [ "" != "${WHICH}" ]; then
  335. echo "which command not found. Aborting.";
  336. exit 0;
  337. fi
  338. ###ADDITIONAL_STUFF###
  339. errordialog() {
  340. # Send message to console.
  341. echo ""
  342. echo "-----------------------------------------------------------------------"
  343. echo "Error: ${1}"
  344. echo "-----------------------------------------------------------------------"
  345. echo "${2}"
  346. echo "-----------------------------------------------------------------------"
  347. # Now try to use the GUI Dialogs.
  348. ISKDE=`pidof -x -s kdeinit`
  349. KDIALOG=`which kdialog`
  350. ISGNOME=`pidof -x -s gnome-panel`
  351. ZENITY=`which zenity`
  352. if [ "" != "${ISKDE}" -a "" != "${KDIALOG}" -a "" != "${DISPLAY}" ]; then
  353. echo "Dialog on Display: ${DISPLAY}"
  354. ${KDIALOG} --title "DMDirc: ${1}" --error "${1}\n\n${2}"
  355. elif [ "" != "${ISGNOME}" -a "" != "${ZENITY}" -a "" != "${DISPLAY}" ]; then
  356. echo "Dialog on Display: ${DISPLAY}"
  357. ${ZENITY} --error --title "DMDirc: ${1}" --text "${1}\n\n${2}"
  358. fi
  359. }
  360. # Location of .run stub end
  361. ENDLINE=`grep -na "^###END INCLUDE###$" $0`
  362. ENDLINE=$((${ENDLINE%%:*} + 1))
  363. if [ "" = "${ENDLINE}" ]; then
  364. errordialog "DMDirc Setup" "End of stub not found. Aborting.";
  365. exit 0;
  366. fi
  367. # Attempt to get a name for a random dir in /tmp
  368. random() {
  369. # First off, lets try mktemp.
  370. MKTEMP=`which mktemp`
  371. if [ "" != "${MKTEMP}" ]; then
  372. # mktemp exists \o
  373. DIR=`${MKTEMP} -d /tmp/DMDirc.XXXXXX`
  374. eval "$1=${DIR}"
  375. return;
  376. fi
  377. TMPDIR=${TMPDIR:=/tmp}
  378. BASEDIR=${TMPDIR}dmdirc_`whoami`_
  379. DIR=${PWD}
  380. while [ -d "${DIR}" ]; do
  381. if [ "" != "${RANDOM}" ]; then
  382. # Bash has a psuedo random number generator that can be accessed
  383. # using ${RANDOM}
  384. RND=${RANDOM}${RANDOM}${RANDOM}
  385. else
  386. # Dash (the ubuntu default sh) however does not.
  387. # od and awk however usually exist, and we can get a random number
  388. # from /dev/urandom or /dev/random
  389. OD=`which od`
  390. AWK=`which awk`
  391. RND=""
  392. if [ "" != "$OD" -a "" != "$AWK" ]; then
  393. # Try /dev/urandom first
  394. RAND=/dev/urandom
  395. # If it doesn't exist try /dev/random
  396. if [ ! -e "${RAND}" ]; then
  397. RAND=/dev/urandom;
  398. fi
  399. # This makes sure we only try to read if one exists
  400. if [ ! -e "${RAND}" ]; then
  401. RND=$(head -1 ${RAND} | od -N 3 -t u | awk '{ print $2 }')
  402. fi;
  403. fi;
  404. # No random number was generated, getting to here means that
  405. # ${RANDOM} doesn't exist, /dev/random doesn't exist, /dev/urandom doesn't exist
  406. # or that od/awk don't exist. Annoying.
  407. # Try using this processes PID instead!
  408. if [ "${RND}" = "" ]; then
  409. RND=$$
  410. DIR=${BASEDIR}${RND}
  411. if [ -e "${DIR}" ]; then
  412. # Lets hope this never happens.
  413. errordialog "DMDirc Setup" "Unable to create random directory";
  414. exit 0;
  415. fi;
  416. fi;
  417. fi;
  418. DIR=${BASEDIR}${RND}
  419. done
  420. mkdir ${DIR}
  421. eval "$1=${DIR}"
  422. }
  423. uncompress() {
  424. tail -n +${ENDLINE} "${OLDPWD}/$0" | gzip -cd | tar -xvf - 2>/dev/null || {
  425. echo "Decompression failed."
  426. kill -15 $$;
  427. };
  428. }
  429. showHelp() {
  430. echo "This will install DMDirc on a unix based system."
  431. echo "The following command line arguments are known:"
  432. echo "---------------------"
  433. echo "-h, --help Help information"
  434. echo "-e, --extract Extract .run file only, do not run setup.sh"
  435. # echo "-s, --script Don't use installer.jar (not implemented yet)"
  436. echo "---------------------"
  437. exit 0;
  438. }
  439. # Defaults
  440. extractOnly="false"
  441. setupParams=""
  442. skipMD5="false"
  443. # Begin
  444. echo "---------------------"
  445. echo "DMDirc Unix Setup"
  446. if [ "${isRelease}" != "" ]; then
  447. echo "Version: "${isRelease};
  448. setupParams="${setupParams} --release "${isRelease}
  449. fi;
  450. echo "---------------------"
  451. # Check for cmdline args
  452. while test -n "$1"; do
  453. case "$1" in
  454. --help|-h)
  455. showHelp
  456. ;;
  457. --extract|-e)
  458. extractOnly="true"
  459. ;;
  460. --script|-s)
  461. setupParams="${setupParams} --script"
  462. ;;
  463. --nomd5)
  464. skipMD5="true"
  465. ;;
  466. esac
  467. shift
  468. done
  469. MD5BIN=`which md5sum`
  470. AWK=`which awk`
  471. getMD5() {
  472. # Everything below the MD5SUM Line
  473. MD5LINE=`grep -na "^MD5=\".*\"$" ${1}`
  474. MD5LINE=$((${MD5LINE%%:*} + 1))
  475. MD5SUM=`tail -n +${MD5LINE} "${1}" | ${MD5BIN} - | ${AWK} '{print $1}'`
  476. return;
  477. }
  478. if [ "${MD5BIN}" != "" ]; then
  479. if [ ${skipMD5} != "true" ]; then
  480. #if [ -e "${0}.md5" ]; then
  481. # echo "Checking MD5 using ${0}.md5.."
  482. # ${MD5BIN} --check --status ${0}.md5
  483. # if [ $? = 0 ]; then
  484. # echo "MD5 Check Passed!"
  485. # else
  486. # ERROR="This copy of the DMDirc installer appears to be damaged and will now exit.";
  487. # ERROR=${ERROR}"\nYou may choose to skip this check and run it anyway by passing the --nomd5 parameter";
  488. # errordialog "DMDirc Setup: MD5 Check Failed!" "${ERROR}";
  489. # exit 1;
  490. # fi
  491. #elif [ "${MD5}" != "" ]; then
  492. if [ "${MD5}" != "" ]; then
  493. echo "Checking MD5 using built in hash.."
  494. if [ "${AWK}" != "" ]; then
  495. MD5SUM=""
  496. getMD5 ${0} ${MD5SUM}
  497. echo "SUM obtained is: ${MD5SUM}"
  498. echo "SUM expected is: ${MD5}"
  499. if [ "${MD5SUM}" = "${MD5}" ]; then
  500. echo "MD5 Check Passed!"
  501. else
  502. ERROR="This copy of the DMDirc installer appears to be damaged and will now exit.";
  503. ERROR=${ERROR}"\nYou may choose to skip this check and run it anyway by passing the --nomd5 parameter";
  504. errordialog "DMDirc Setup: MD5 Check Failed!" "${ERROR}";
  505. exit 1;
  506. fi;
  507. else
  508. echo "MD5 Check skipped (awk not found).."
  509. fi;
  510. else
  511. #if [ "${MD5BIN}" = "" ]; then
  512. # echo "MD5 Check skipped (md5sum not found).."
  513. #else
  514. echo "MD5 Check skipped (No MD5 hash found to compare against).."
  515. #fi
  516. fi;
  517. else
  518. echo "MD5 Check skipped (Requested).."
  519. fi
  520. fi;
  521. OLDPWD=${PWD}
  522. echo "Getting Temp Dir"
  523. random TEMPDIR
  524. echo "Got Temp Dir: ${TEMPDIR}"
  525. cd ${TEMPDIR}
  526. echo "Uncompressing to temp dir.."
  527. uncompress
  528. echo "Done."
  529. # Check if extract only was wanted.
  530. if [ "${extractOnly}" = "true" ]; then
  531. echo "Extracted. (Files can be found in: ${TEMPDIR})"
  532. exit 0;
  533. fi
  534. if [ -e "${TEMPDIR}/setup.sh" ]; then
  535. echo "Running setup.."
  536. chmod a+x ${TEMPDIR}/setup.sh
  537. ${TEMPDIR}/setup.sh ${setupParams}
  538. echo ""
  539. if [ $? -eq 0 ]; then
  540. echo "Setup completed."
  541. else
  542. echo "Setup failed."
  543. fi
  544. else
  545. echo "No setup.sh found. This was pointless?"
  546. fi
  547. echo "Removing temp dir"
  548. cd ${OLDPWD}
  549. rm -Rf ${TEMPDIR}
  550. echo "Installation Completed."
  551. # Job Done!
  552. exit 0;
  553. ###END INCLUDE###