2025-02-01 01:14:42 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
# Author : Gaston Gonzalez
|
|
|
|
|
# Date : 1 February 2025
|
2025-03-18 04:39:51 -07:00
|
|
|
# Updated : 18 March 2025
|
2025-02-01 01:14:42 -07:00
|
|
|
# Purpose : Performs various checks to ensure that changes can be made
|
|
|
|
|
# to a user's local WINE installation.
|
|
|
|
|
|
|
|
|
|
source /opt/emcomm-tools/bin/et-common
|
|
|
|
|
|
|
|
|
|
WINE_OUT=$(which winetricks)
|
|
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
|
echo -e "${RED}Wine is not installed. As root, first run: ${WHITE}/root/emcomm-tools-os-community/scripts/install-wine.sh${NC}"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ "${EUID}" -eq 0 ]]; then
|
|
|
|
|
echo -e "${RED}This script must not be run as root. Run it as your normal user.${NC}"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2025-02-17 16:47:48 -07:00
|
|
|
if [[ -z "${WINEARCH}" ]]; then
|
|
|
|
|
echo -e "The WINEARCH environment variable is not set. Setting it for you."
|
2025-03-18 04:39:51 -07:00
|
|
|
export WINEARCH="win64"
|
2025-02-01 01:14:42 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ -z "${WINEPREFIX}" ]]; then
|
|
|
|
|
echo -e "The WINEPREFIX environment variable is not set. Setting it for you."
|
|
|
|
|
export WINEPREFIX="${HOME}/.wine32"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ -z "${DISPLAY}" && -z "${WAYLAND_DISPLAY}" ]]; then
|
|
|
|
|
echo -e "${RED}No graphical environment detected. Run this command from a desktop session.${NC}"
|
|
|
|
|
echo -e "${RED}This can't be run from within Cubic.${NC}"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|