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.

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