[go: up one dir, main page]

File: install-macosx

package info (click to toggle)
altos 1.9.16-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 78,396 kB
  • sloc: ansic: 110,166; java: 42,103; makefile: 7,904; sh: 4,375; xml: 2,155; pascal: 2,008
file content (55 lines) | stat: -rwxr-xr-x 1,411 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash

JVM=/Library/Java/JavaVirtualMachines
dir=`dirname "$0"`

case `id -u` in
    0)
    ;;
    *)
	SUDO_ASKPASS="${dir}/ask-pass" sudo -A "$0" "$@"
	case $? in
	    0)
	    ;;
	    *)
		osascript -e 'display dialog "Installation failed. Incorrect password?" buttons {"OK"} default button 1 with title "Installation Status"' > /dev/null
		;;
	esac
	exit 0
	;;
esac

# Check for java
if ls "$JVM" | grep -q temurin; then
    echo "Adoptium already present"
else
    open https://adoptium.net/
    osascript -e 'display dialog "Install Java from https://adoptium.net then click Continue" buttons {"Continue"} default button 1 with title "Install Java"' >/dev/null
fi

cd "$dir"
LIBRARY=/Library/AltusMetrum
APPLICATIONS=/Applications
INSTALLED=
for file in *; do
    echo 'Installing' "$file"
    case "$file" in
	*.app)
	    mkdir -p "${APPLICATIONS}"
	    if [ -d "${APPLICATIONS}/${file}" ]; then
		rm -rf "${APPLICATIONS}/${file}"
	    fi
	    cp -a "$file" "${APPLICATIONS}/${file}"
	    chmod -R +w "${APPLICATIONS}/${file}"
	    xattr -rc "${APPLICATIONS}/${file}"
	    APP=`basename "$file" .app`
	    INSTALLED="${INSTALLED} ${APP}"
	    ;;
	*)
	    mkdir -p "${LIBRARY}"
	    cp -a "$file" "${LIBRARY}"
	    ;;
    esac
done
open "${LIBRARY}"
osascript -e 'display dialog "Installation of'"${INSTALLED}"' complete" with title "Installation Complete" buttons {"OK"} default button 1' >/dev/null