ASIO to JACK driver for WINE
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.

57 lines
1.7KB

  1. #!/bin/bash
  2. # exit if any command fails
  3. set -e
  4. # read WINEPREFIX from environment, with fallback if unset
  5. WINEPREFIX=${WINEPREFIX:=~/.wine}
  6. # make sure the WINEPREFIX directory exists
  7. if [ ! -d "${WINEPREFIX}" ]; then
  8. wineboot -u
  9. fi
  10. # define possible locations for wineasio DLLs
  11. u32=(
  12. "/opt/wine-devel/lib/wine/i386-unix/wineasio32.dll.so"
  13. "/opt/wine-stable/lib/wine/i386-unix/wineasio32.dll.so"
  14. "/opt/wine-staging/lib/wine/i386-unix/wineasio32.dll.so"
  15. "/usr/lib/wine/i386-unix/wineasio32.dll.so"
  16. "/usr/lib32/wine/i386-unix/wineasio32.dll.so"
  17. "/usr/lib/i386-linux-gnu/wine/i386-unix/wineasio32.dll.so"
  18. )
  19. u64=(
  20. "/opt/wine-devel/lib64/wine/x86_64-unix/wineasio64.dll.so"
  21. "/opt/wine-stable/lib64/wine/x86_64-unix/wineasio64.dll.so"
  22. "/opt/wine-staging/lib64/wine/x86_64-unix/wineasio64.dll.so"
  23. "/usr/lib/wine/x86_64-unix/wineasio64.dll.so"
  24. "/usr/lib64/wine/x86_64-unix/wineasio64.dll.so"
  25. "/usr/lib/x86_64-linux-gnu/wine/x86_64-unix/wineasio64.dll.so"
  26. )
  27. # try to register 32bit DLL
  28. for u in ${u32[@]}; do
  29. w=$(echo ${u} | sed -e 's|/i386-unix/wineasio32.dll.so|/i386-windows/wineasio32.dll|g')
  30. if [ -e "${u}" ] && [ -e "${w}" ]; then
  31. cp -v "${w}" "${WINEPREFIX}/drive_c/windows/system32"
  32. regsvr32 "${u}"
  33. break
  34. fi
  35. done
  36. # only continue past this point if wine64 command is available and prefix supports 64bit
  37. if ! command -v wine64 > /dev/null || [ ! -d "${WINEPREFIX}/drive_c/windows/syswow64" ]; then
  38. exit 0
  39. fi
  40. # try to register 64bit DLL
  41. for u in ${u64[@]}; do
  42. w=$(echo ${u} | sed -e 's|/x86_64-unix/wineasio64.dll.so|/x86_64-windows/wineasio64.dll|g')
  43. if [ -e "${u}" ] && [ -e "${w}" ]; then
  44. cp -v "${w}" "${WINEPREFIX}/drive_c/windows/system32"
  45. wine64 regsvr32 "${u}"
  46. break
  47. fi
  48. done