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.

makeInstallerNSIS.sh 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #!/bin/sh
  2. ## Temporary Hack, this should be removed at some point when we stop
  3. ## using everything in /installer
  4. ## This script only understands the parameters needed by BuildAll and the
  5. ## installer-* ant targets.
  6. if [ ! -e "../../modules/installer/windows/" ]; then
  7. echo "Unable to find NSIS Source"
  8. exit 1;
  9. fi;
  10. signEXE="true"
  11. while test -n "$1"; do
  12. case "$1" in
  13. --plugins|-p)
  14. shift
  15. plugins=${1}
  16. ;;
  17. --jar)
  18. shift
  19. jarfile=${1}
  20. ;;
  21. --tag|-t)
  22. TAGGED=`git describe --tags`
  23. TAGGED=${TAGGED%%-*}
  24. ;;
  25. --unsigned|-u)
  26. signEXE="false"
  27. ;;
  28. --extra|-e)
  29. shift
  30. finalTag="-${1}"
  31. ;;
  32. esac
  33. shift
  34. done
  35. INSTALLNAME=DMDirc-Setup
  36. OLDDIR=`pwd`
  37. mkdir -p ../../modules/installer/output
  38. rm -Rfv ../../modules/installer/windows/files
  39. mkdir -p ../../modules/installer/windows/files
  40. cp "${jarfile}" "../../modules/installer/windows/files/DMDirc.jar"
  41. cp "../../src/com/dmdirc/licences/DMDirc - MIT" "../../modules/installer/windows/licence.txt"
  42. cd ../../modules/installer/windows/files
  43. if [ "" != "${plugins}" ]; then
  44. echo "Adding plugins to jar"
  45. ln -sf ${jarPath}"/plugins"
  46. pluginList=""
  47. for plugin in ${plugins}; do
  48. pluginList=${pluginList}" plugins/${plugin}"
  49. done
  50. jar -uvf "DMDirc.jar" ${pluginList}
  51. ../../../../updateBundledPlugins.sh
  52. rm -Rf plugins;
  53. fi
  54. cp ../../../../src/com/dmdirc/res/icon.ico icon.ico
  55. cd ..
  56. for NSI in updater.nsi launcher.nsi installer.nsi; do
  57. LASTCOMMIT=`git rev-list --max-count=1 HEAD -- $NSI`
  58. NSISVERSION=`git describe --tags --always $LASTCOMMIT`
  59. makensis -DVERSION="${NSISVERSION}" -V2 $NSI;
  60. done
  61. rm "license.txt"
  62. cd "${OLDDIR}"
  63. SRC="../../modules/installer/output/DMDirc-Setup.exe"
  64. doRename=0
  65. if [ "${TAGGED}" != "" ]; then
  66. doRename=1
  67. fi;
  68. if [ ${doRename} -eq 1 ]; then
  69. if [ "${TAGGED}" = "" ]; then
  70. releaseTag=branch-${isRelease}
  71. else
  72. releaseTag=${TAGGED}
  73. fi;
  74. DEST="DMDirc-${releaseTag}-Setup${finalTag}.exe"
  75. else
  76. DEST="${INSTALLNAME}${finalTag}.exe"
  77. fi;
  78. mv "${SRC}" "../output/${DEST}"
  79. # Get signcode path
  80. SIGNCODE=`which signcode`
  81. if [ "" = "${SIGNCODE}" ]; then
  82. echo "Signcode not found. EXE's will not be digitally signed."
  83. fi
  84. # Sign stuff!
  85. signexe() {
  86. if [ "" != "${SIGNCODE}" ]; then
  87. if [ -e "../signing/DMDirc.spc" -a -e "../signing/DMDirc.pvk" ]; then
  88. echo "Digitally Signing EXE (${@})..."
  89. ${SIGNCODE} -spc "../signing/DMDirc.spc" -v "../signing/DMDirc.pvk" -i "http://www.dmdirc.com/" -n "DMDirc Installer" $@ 2>/dev/null || {
  90. kill -15 $$;
  91. };
  92. rm ${@}.sig
  93. rm ${@}.bak
  94. fi
  95. fi
  96. }
  97. FULLINSTALLER="../output/${DEST}"
  98. echo "Chmodding.."
  99. chmod a+x ${FULLINSTALLER}
  100. if [ "${signEXE}" = "true" ]; then
  101. echo "Signing.."
  102. signexe ${FULLINSTALLER}
  103. else
  104. echo "Not Signing.."
  105. fi;