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.

64 lines
1.5KB

  1. #!/bin/bash
  2. set -e
  3. if [ ! -d bin ]; then
  4. echo "Please run this script from the root folder"
  5. exit
  6. fi
  7. if [ -z "${1}" ]; then
  8. echo "usage: ${0} win32|win64"
  9. exit
  10. fi
  11. if [ "${1}" = "win32" ]; then
  12. bit=32
  13. elif [ "${1}" = "win64" ]; then
  14. bit=64
  15. else
  16. echo "usage: ${0} win32|win64"
  17. exit
  18. fi
  19. # setup innosetup
  20. dlfile="${PWD}/bin/innosetup-6.0.5.exe"
  21. innodir="${PWD}/build/innosetup-6.0.5"
  22. iscc="${innodir}/drive_c/InnoSetup/ISCC.exe"
  23. # download it
  24. if [ ! -f "${dlfile}" ]; then
  25. # FIXME proper dl version
  26. curl -L https://jrsoftware.org/download.php/is.exe -o "${dlfile}"
  27. fi
  28. # initialize wine
  29. if [ ! -d "${innodir}"/drive_c ]; then
  30. env WINEPREFIX="${innodir}" wineboot -u
  31. fi
  32. # install innosetup in custom wineprefix
  33. if [ ! -f "${innodir}"/drive_c/InnoSetup/ISCC.exe ]; then
  34. env WINEPREFIX="${innodir}" wine "${dlfile}" /allusers /dir=C:\\InnoSetup /nocancel /norestart /verysilent
  35. fi
  36. # generate resources
  37. echo -n "" > utils/inno/resources.iss
  38. IFS='
  39. '
  40. for f in $(find -L bin/Cardinal.lv2/resources/ -type f); do
  41. d=$(dirname $(echo ${f} | sed "s|bin/Cardinal.lv2/resources/||"))
  42. echo "Source: \"..\\..\\$(echo ${f} | tr '/' '\\')\"; DestDir: \"{commoncf${bit}}\\Cardinal\\$(echo ${d} | tr '/' '\\')\"; Components: resources; Flags: ignoreversion;" >> utils/inno/resources.iss
  43. done
  44. # generate version
  45. echo "#define VERSION \"$(make version)\"" > utils/inno/version.iss
  46. # create the installer file
  47. pushd "utils/inno"
  48. env WINEPREFIX="${innodir}" wine "${iscc}" "win${bit}.iss"
  49. popd
  50. # move installer file where CI expects it to be
  51. mv utils/inno/*.exe .