-mkdir -p ~/Applications/AltOS
-find ~/Applications/AltOS -type d -print0 | xargs -0 chmod +w
-cp -f -a * ~/Applications/AltOS
-cd ~/Applications/AltOS
-chmod +w *
-xattr -c *
+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
+osascript -e 'display dialog "Installation of'"${INSTALLED}"' complete" with title "Installation Complete" buttons {"OK"} default button 1' >/dev/null