Cut down on repeating tasks for existing wine bottles.
This commit is contained in:
@@ -95,8 +95,21 @@ install_wine_bottle() {
|
|||||||
# Modern wine is unified - no separate wine32/wine64 executables
|
# Modern wine is unified - no separate wine32/wine64 executables
|
||||||
export WINE="wine"
|
export WINE="wine"
|
||||||
export WINESERVER="wineserver"
|
export WINESERVER="wineserver"
|
||||||
# Arguments to the function are dependancies to be installed.
|
|
||||||
# Get location of mono and gecko.
|
# Check if bottle already exists and is properly initialized
|
||||||
|
local bottleExists=false
|
||||||
|
if [[ -d "$WINEPREFIX" ]] && [[ -f "$WINEPREFIX/system.reg" ]] && [[ -f "$WINEPREFIX/user.reg" ]]; then
|
||||||
|
bottleExists=true
|
||||||
|
echo "Using existing wine${architecture} bottle at $WINEPREFIX"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Only do basic setup if bottle doesn't exist
|
||||||
|
if [[ "$bottleExists" == false ]]; then
|
||||||
|
echo -n "Creating new wine${architecture} bottle - Using "
|
||||||
|
wine --version
|
||||||
|
DISPLAY="" wineboot -u | agm_progressbox "Wine Setup" "Initializing wine bottle..."
|
||||||
|
|
||||||
|
# Install mono and gecko only for new bottles
|
||||||
monoPath="$(find /usr/share/wine/ -maxdepth 1 -type d -name mono 2> /dev/null)"
|
monoPath="$(find /usr/share/wine/ -maxdepth 1 -type d -name mono 2> /dev/null)"
|
||||||
geckoPath="$(find /usr/share/wine/ -maxdepth 1 -type d -name "gecko" 2> /dev/null)"
|
geckoPath="$(find /usr/share/wine/ -maxdepth 1 -type d -name "gecko" 2> /dev/null)"
|
||||||
if [[ -z "$monoPath" ]]; then
|
if [[ -z "$monoPath" ]]; then
|
||||||
@@ -107,24 +120,31 @@ install_wine_bottle() {
|
|||||||
download 'http://dl.winehq.org/wine/wine-gecko/2.40/wine_gecko-2.40-x86.msi'
|
download 'http://dl.winehq.org/wine/wine-gecko/2.40/wine_gecko-2.40-x86.msi'
|
||||||
geckoPath="${cache}/wine_gecko-2.40-x86.msi"
|
geckoPath="${cache}/wine_gecko-2.40-x86.msi"
|
||||||
fi
|
fi
|
||||||
echo -n "Using "
|
|
||||||
wine --version
|
|
||||||
DISPLAY="" wineboot -u | agm_progressbox "Wine Setup" "Initializing wine bottle..."
|
|
||||||
wine msiexec /i z:"$monoPath" /quiet | agm_progressbox "Wine Setup" "Installing .NET Framework..."
|
wine msiexec /i z:"$monoPath" /quiet | agm_progressbox "Wine Setup" "Installing .NET Framework..."
|
||||||
wine msiexec /i z:"$geckoPath" /quiet | agm_progressbox "Wine Setup" "Installing Web Browser support..."
|
wine msiexec /i z:"$geckoPath" /quiet | agm_progressbox "Wine Setup" "Installing Web Browser support..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install RHVoice only if needed and not already installed
|
||||||
if [[ "${*}" =~ (speechsdk|sapi) ]]; then
|
if [[ "${*}" =~ (speechsdk|sapi) ]]; then
|
||||||
install_rhvoice
|
install_rhvoice
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Setup nvda2speechd for wine64 bottles (only once)
|
||||||
if [[ "${WINEARCH}" == "win64" ]]; then
|
if [[ "${WINEARCH}" == "win64" ]]; then
|
||||||
download "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd"
|
download "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd"
|
||||||
fi
|
if [[ ! -f "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd" ]]; then
|
||||||
if [[ "${WINEARCH}" == "win64" ]] && [[ ! -f "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd" ]]; then
|
|
||||||
cp "${cache}/nvda2speechd" "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd"
|
cp "${cache}/nvda2speechd" "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd"
|
||||||
chmod +x "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd"
|
chmod +x "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd"
|
||||||
fi
|
fi
|
||||||
winetricks -q isolate_home "$@" "${winVer:-win7}" ${winetricksSettings} | agm_progressbox "Wine Setup" "Installing wine dependencies..."
|
fi
|
||||||
|
|
||||||
# Set default voice for speech-enabled games
|
# Install winetricks dependencies - this is more complex to optimize
|
||||||
|
# For now, let winetricks handle checking if packages are already installed
|
||||||
|
if [[ $# -gt 0 ]] || [[ -n "${winVer}" ]] || [[ -n "${winetricksSettings}" ]]; then
|
||||||
|
winetricks -q isolate_home "$@" "${winVer:-win7}" ${winetricksSettings} | agm_progressbox "Wine Setup" "Installing wine dependencies..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set default voice for speech-enabled games (only if not already set)
|
||||||
if [[ ${#defaultVoice} -ge 2 ]] && [[ "$*" =~ (speechsdk|sapi) ]]; then
|
if [[ ${#defaultVoice} -ge 2 ]] && [[ "$*" =~ (speechsdk|sapi) ]]; then
|
||||||
echo "Setting default voice for wine${architecture}."
|
echo "Setting default voice for wine${architecture}."
|
||||||
"${0%/*}/speech/set-voice.sh" -b "wine${architecture}" -r "${defaultRate:-7}" -v "${defaultVoice}"
|
"${0%/*}/speech/set-voice.sh" -b "wine${architecture}" -r "${defaultRate:-7}" -v "${defaultVoice}"
|
||||||
|
Reference in New Issue
Block a user