Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Partial fix for #211.
Browse files Browse the repository at this point in the history
  • Loading branch information
thw26 committed Nov 7, 2023
1 parent 7c49a37 commit 71f08f9
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions LogosLinuxInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export LOGOS_SCRIPT_VERSION="3.8.0" # Script version for this Installer Script
#####

# BEGIN ENVIRONMENT
if [ -z "${WINE64_APPIMAGE_FULL_VERSION}" ]; then WINE64_APPIMAGE_FULL_VERSION="v7.18-staging"; export WINE64_APPIMAGE_FULL_VERSION; fi
if [ -z "${WINE64_APPIMAGE_FULL_VERSION}" ]; then WINE64_APPIMAGE_FULL_VERSION="v8.19-devel"; export WINE64_APPIMAGE_FULL_VERSION; fi
if [ -z "${WINE64_APPIMAGE_FULL_URL}" ]; then WINE64_APPIMAGE_FULL_URL="https://github.com/ferion11/LogosLinuxInstaller/releases/download/wine-devel-8.19/wine-devel_8.19-x86_64.AppImage"; export WINE64_APPIMAGE_FULL_URL; fi
if [ -z "${WINE64_APPIMAGE_FULL_FILENAME}" ]; then WINE64_APPIMAGE_FULL_FILENAME="$(basename "${WINE64_APPIMAGE_FULL_URL}")"; export WINE64_APPIMAGE_FULL_FILENAME; fi
if [ -z "${WINE64_APPIMAGE_VERSION}" ]; then WINE64_APPIMAGE_VERSION="v7.18-staging"; export WINE64_APPIMAGE_VERSION; fi
if [ -z "${WINE64_APPIMAGE_URL}" ]; then WINE64_APPIMAGE_URL="https://github.com/ferion11/LogosLinuxInstaller/releases/download/v10.0-1/wine-staging_7.18-x86_64.AppImage"; export WINE64_APPIMAGE_URL; fi
if [ -z "${WINE64_APPIMAGE_VERSION}" ]; then WINE64_APPIMAGE_VERSION="v8.19-devel"; export WINE64_APPIMAGE_VERSION; fi
if [ -z "${WINE64_APPIMAGE_URL}" ]; then WINE64_APPIMAGE_URL="https://github.com/ferion11/LogosLinuxInstaller/releases/download/wine-devel-8.19/wine-devel_8.19-x86_64.AppImage"; export WINE64_APPIMAGE_URL; fi
if [ -z "${WINE64_BOTTLE_TARGZ_URL}" ]; then WINE64_BOTTLE_TARGZ_URL="https://github.com/ferion11/wine64_bottle_dotnet/releases/download/v5.11b/wine64_bottle.tar.gz"; export WINE64_BOTTLE_TARGZ_URL; fi
if [ -z "${WINE64_BOTTLE_TARGZ_NAME}" ]; then WINE64_BOTTLE_TARGZ_NAME="wine64_bottle.tar.gz"; export WINE64_BOTTLE_TARGZ_NAME; fi
if [ -z "${WINE64_APPIMAGE_FILENAME}" ]; then WINE64_APPIMAGE_FILENAME="$(basename "${WINE64_APPIMAGE_URL}" .AppImage)"; export WINE64_APPIMAGE_FILENAME; fi
Expand All @@ -25,6 +25,7 @@ if [ -z "${LAUNCHER_TEMPLATE_URL}" ]; then LAUNCHER_TEMPLATE_URL="https://raw.gi
if [ -z "${CONTROL_PANEL_TEMPLATE_URL}" ]; then CONTROL_PANEL_TEMPLATE_URL="https://raw.githubusercontent.com/ferion11/LogosLinuxInstaller/master/controlPanel-Template.sh"; export CONTROL_PANEL_TEMPLATE_URL; fi
if [ -z "${WINETRICKS_DOWNLOADER+x}" ]; then WINETRICKS_DOWNLOADER="wget" ; export WINETRICKS_DOWNLOADER; fi
if [ -z "${WINETRICKS_UNATTENDED+x}" ]; then WINETRICKS_UNATTENDED="" ; export WINETRICKS_UNATTENDED; fi
if [ -z "${MYDOWNLOADS}" ]; then MYDOWNLOADS="${HOME}/Downloads"; export MYDOWNLOADS; fi
if [ -z "${WORKDIR}" ]; then WORKDIR="$(mktemp -d /tmp/LBS.XXXXXXXX)"; export WORKDIR ; fi
if [ -z "${PRESENT_WORKING_DIRECTORY}" ]; then PRESENT_WORKING_DIRECTORY="${PWD}" ; export PRESENT_WORKING_DIRECTORY; fi
if [ -z "${LOGOS_FORCE_ROOT+x}" ]; then export LOGOS_FORCE_ROOT="" ; fi
Expand Down Expand Up @@ -440,11 +441,10 @@ logos_reuse_download() {
SOURCEURL="${1}"
FILE="${2}"
TARGETDIR="${3}"
DOWNLOADS="${HOME}/Downloads"
DIRS=(
"${INSTALLDIR}"
"${PRESENT_WORKING_DIRECTORY}"
"${DOWNLOADS}"
"${MYDOWNLOADS}"
)
FOUND=1
for i in "${DIRS[@]}"; do
Expand All @@ -457,8 +457,8 @@ logos_reuse_download() {
done
if [[ "${FOUND}" == 1 ]]; then
logos_info "${FILE} does not exist. Downloading…"
logos_download "${SOURCEURL}" "${DOWNLOADS}/${FILE}"
cp "${DOWNLOADS}/${FILE}" "${TARGETDIR}/" | logos_progress "Copying…" "Copying: ${FILE}\ninto: ${TARGETDIR}"
logos_download "${SOURCEURL}" "${MYDOWNLOADS}/${FILE}"
cp "${MYDOWNLOADS}/${FILE}" "${TARGETDIR}/" | logos_progress "Copying…" "Copying: ${FILE}\ninto: ${TARGETDIR}"
fi
}
## END DIALOG FUNCTIONS
Expand Down Expand Up @@ -783,6 +783,18 @@ checkPath() {

}

checkAppImages() {
DIR="${1}"
readarray -t APPIMAGESARR < <(find "${DIR}" -iname "wine*x86_64*AppImage")
for appimage in "${APPIMAGESARR[@]}"; do
if [ -x "${appimage}" ]; then
echo "${appimage}" >> "${WORKDIR}/winebinaries"
else
: # Not executable"
fi
done
}

createWineBinaryList() {
logos_info "Creating binary list."
#TODO: Make optarg to add custom path to this array.
Expand All @@ -797,6 +809,13 @@ createWineBinaryList() {

# Check each directory in PATH for wine64; add to list
checkPath wine64 > "${WORKDIR}/winebinaries"

APPIMAGEDIR="$(grep "destination" ${HOME}/.config/appimagelauncher.cfg | awk -F'=' '{print $2}' | sed "s/^\s//")"
APPIMAGEDIR="${APPIMAGEDIR/#\~/$HOME}"
export APPIMAGEDIR

checkAppImages "${APPIMAGEDIR}"
checkAppImages "${MYDOWNLOADS}"

cp "${WORKDIR}/winebinaries" "${WORKDIR}/winebinaries.bak"

Expand Down Expand Up @@ -847,18 +866,26 @@ chooseInstallMethod() {
WINEOPT="$line"
fi

if [[ "$WINEOPT" == *"/usr/bin/"* ]]; then
if [[ "${WINEOPT}" == *"/usr/bin/"* ]]; then
WINEOPT_CODE="System"
WINEOPT_DESCRIPTION="\"Use the system binary (i.e., /usr/bin/wine64). WINE must be 7.18-staging or later. Stable or Devel do not work.\""
WINEOPT_PATH="${line}"
elif [[ "$WINEOPT" == *"Proton"* ]]; then
elif [[ "${WINEOPT}" == *"Proton"* ]]; then
WINEOPT_CODE="Proton"
WINEOPT_DESCRIPTION="\"Install using the Steam Proton fork of WINE.\""
WINEOPT_PATH="${line}"
elif [[ "$WINEOPT" == *"PlayOnLinux"* ]]; then
elif [[ "${WINEOPT}" == *"PlayOnLinux"* ]]; then
WINEOPT_CODE="PlayOnLinux"
WINEOPT_DESCRIPTION="\"Install using a PlayOnLinux WINE64 binary.\""
WINEOPT_PATH="${line}"
elif [[ "${WINEOPT}" == *"Downloads"* ]]; then
WINEOPT_CODE="AppImage"
WINEOPT_DESCRIPTION="\"Install using a non-default AppImage.\""
WINEOPT_PATH="${line}"
elif [[ "${WINEOPT}" == *"${APPIMAGEDIR}"* ]]; then
WINEOPT_CODE="AppImage"
WINEOPT_DESCRIPTION="\"Install using an integrated non-default AppImage.\""
WINEOPT_PATH="${line}"
else
WINEOPT_CODE="Custom"
WINEOPT_DESCRIPTION="\"Use a WINE64 binary from another directory.\""
Expand Down

0 comments on commit 71f08f9

Please sign in to comment.