altos/test: Adjust CRC error rate after FEC fix
[fw/altos] / altosui / install-macosx
1 #!/bin/bash
2
3 JVM=/Library/Java/JavaVirtualMachines
4 dir=`dirname "$0"`
5
6 case `id -u` in
7     0)
8     ;;
9     *)
10         SUDO_ASKPASS="${dir}/ask-pass" sudo -A "$0" "$@"
11         exit 0
12         ;;
13 esac
14
15 # Check for java
16 if ls "$JVM" | grep -q adopt; then
17     echo "Adopt OpenJDK already present"
18 else
19     open https://adoptopenjdk.net/
20     osascript -e 'display dialog "Install Java from https://adoptopenjdk.net then click Continue" buttons {"Continue"} default button 1 with title "Install Java"' >/dev/null
21 fi
22
23 cd "$dir"
24 LIBRARY=/Library/AltusMetrum
25 APPLICATIONS=/Applications
26 INSTALLED=
27 for file in *; do
28     echo 'Installing' "$file"
29     case "$file" in
30         *.app)
31             mkdir -p "${APPLICATIONS}"
32             if [ -d "${APPLICATIONS}/${file}" ]; then
33                 rm -rf "${APPLICATIONS}/${file}"
34             fi
35             cp -a "$file" "${APPLICATIONS}/${file}"
36             chmod -R +w "${APPLICATIONS}/${file}"
37             xattr -rc "${APPLICATIONS}/${file}"
38             APP=`basename "$file" .app`
39             INSTALLED="${INSTALLED} ${APP}"
40             ;;
41         *)
42             mkdir -p "${LIBRARY}"
43             cp -a "$file" "${LIBRARY}"
44             ;;
45     esac
46 done
47 osascript -e 'display dialog "Installation of'"${INSTALLED}"' complete" with title "Installation Complete" buttons {"OK"} default button 1' >/dev/null