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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. cd ../../modules/installer/windows/files
  42. if [ "" != "${plugins}" ]; then
  43. echo "Adding plugins to jar"
  44. ln -sf ${jarPath}"/plugins"
  45. pluginList=""
  46. for plugin in ${plugins}; do
  47. pluginList=${pluginList}" plugins/${plugin}"
  48. done
  49. jar -uvf "DMDirc.jar" ${pluginList}
  50. ../../../../updateBundledPlugins.sh
  51. rm -Rf plugins;
  52. fi
  53. cp ../../../../src/com/dmdirc/res/icon.ico icon.ico
  54. cd ..
  55. for NSI in updater.nsi launcher.nsi installer.nsi; do
  56. LASTCOMMIT=`git rev-list --max-count=1 HEAD -- $NSI`
  57. NSISVERSION=`git describe --tags --always $LASTCOMMIT`
  58. makensis -DVERSION="${NSISVERSION}" -V2 $NSI;
  59. done
  60. cd "${OLDDIR}"
  61. SRC="../../modules/installer/output/DMDirc-Setup.exe"
  62. doRename=0
  63. if [ "${TAGGED}" != "" ]; then
  64. doRename=1
  65. fi;
  66. if [ ${doRename} -eq 1 ]; then
  67. if [ "${TAGGED}" = "" ]; then
  68. releaseTag=branch-${isRelease}
  69. else
  70. releaseTag=${TAGGED}
  71. fi;
  72. DEST="DMDirc-${releaseTag}-Setup${finalTag}.exe"
  73. else
  74. DEST="${INSTALLNAME}${finalTag}.exe"
  75. fi;
  76. mv "${SRC}" "../output/${DEST}"
  77. # Get signcode path
  78. SIGNCODE=`which signcode`
  79. if [ "" = "${SIGNCODE}" ]; then
  80. echo "Signcode not found. EXE's will not be digitally signed."
  81. fi
  82. # Sign stuff!
  83. signexe() {
  84. if [ "" != "${SIGNCODE}" ]; then
  85. if [ -e "../signing/DMDirc.spc" -a -e "../signing/DMDirc.pvk" ]; then
  86. echo "Digitally Signing EXE (${@})..."
  87. ${SIGNCODE} -spc "../signing/DMDirc.spc" -v "../signing/DMDirc.pvk" -i "http://www.dmdirc.com/" -n "DMDirc Installer" $@ 2>/dev/null || {
  88. kill -15 $$;
  89. };
  90. rm ${@}.sig
  91. rm ${@}.bak
  92. fi
  93. fi
  94. }
  95. FULLINSTALLER="../output/${DEST}"
  96. echo "Chmodding.."
  97. chmod a+x ${FULLINSTALLER}
  98. if [ "${signEXE}" = "true" ]; then
  99. echo "Signing.."
  100. signexe ${FULLINSTALLER}
  101. else
  102. echo "Not Signing.."
  103. fi;