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.

54 lines
1.4KB

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