diff --git a/.includes/bottle.sh b/.includes/bottle.sh index 396a067..cf4bb05 100644 --- a/.includes/bottle.sh +++ b/.includes/bottle.sh @@ -1,44 +1,13 @@ +#!/usr/bin/env bash + get_bottle() { - local architecture="${1/win/}" + # Simple rule: wine64 for everything, wine32 only for speech APIs + local architecture="${1:-win64}" + architecture="${architecture/win/}" export WINEPREFIX="$HOME/.local/wine${architecture}" - # Wine version for bottles - if [[ "$game" =~ entombed ]]; then - install_wine "6.18" "32" - fi - if [[ "$game" =~ rs-games ]]; then - install_wine "7.0" "32" - fi - if [[ "$game" =~ shadow-line ]]; then - install_wine "7.7" "32" - fi } -install_wine() { - # Requires wine version, e.g. 7.7 and architecture, 32|64 - if [[ $# -ne 2 ]]; then - exit 1 - fi - # Figure out wineInstallationPath - wineInstallationPath="${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/wine_$2/$1" - export wine="${wineInstallationPath}/bin/wine" - # If the path exists, wine should already be installed. - # Just make sure we didn't wind up with a empty directory for some reason - rmdir "${wineInstallationPath}" 2> /dev/null - if [[ -d "${wineInstallationPath}" ]]; then - return - fi - mkdir -p "${wineInstallationPath}" 2> /dev/null - # This probably does not need to be cached, so download to tmp. - installationFile="$(mktemp)" - local v=$2 - v="${v/32/x86}" - v="${v/64/x64}" # Probably wrong, so just a place holder. - # If this goes wrong, bail out - set -e - { curl -L --output "${installationFile}" "https://www.playonlinux.com/wine/binaries/phoenicis/upstream-linux-x86/PlayOnLinux-wine-${1}-upstream-linux-${v}.tar.gz" - tar xf "${installationFile}" -C "${wineInstallationPath}"; } | agm_progressbox "Wine Installation" "Installing $2 bit Wine version $1." - set +e -} +# Note: install_wine function removed - we now use system wine with simplified bottle management winetricks() { # Report used packages to the winetricks maintainer so he knows they are being used. @@ -104,29 +73,22 @@ install_rhvoice() { } install_wine_bottle() { - # Wine defaults to 64, so if you need 32 bit, don't forget export WINEARCH=win32 - export WINEARCH="${WINEARCH:-win32}" - # Figure out if we are using a specific version of wine + # Simple rule: wine64 for everything, wine32 ONLY for speech APIs (SAPI5 doesn't work in WOW64) + local architecture + if [[ "$*" =~ speechsdk || "$*" =~ sapi ]]; then + architecture=32 + export WINEARCH="win32" + echo "Using wine32 for speech API compatibility (SAPI5 broken in WOW64)" + else + architecture=64 + export WINEARCH="win64" + echo "Using wine64 for optimal performance" + fi + + export WINEPREFIX="$HOME/.local/wine${architecture}" export wine="${wine:-$(command -v wine)}" - # Set the WINE and WINESERVER environmental variables so winetricks will use the right installation. export WINE="${wine}" export WINESERVER="${wine}server" - # Installation paths are based on WINEARCH unless game is set for custom bottle. - local bottle="" - if [[ ${#game} -gt 0 ]]; then - bottle="${game,,}" - bottle="${bottle//[[:space:]]/-}" - if [[ -d "$HOME/.local/wine/${bottle}" ]]; then - echo "$HOME/.local/wine/${bottle} exists. Please remove it before running this installer." - exit 1 - fi - fi - if [[ ( -z "$WINEARCH" || "$WINEARCH" == "win64" ) && ! "$*" =~ speechsdk ]]; then - local architecture=64 - else - local architecture=32 - fi - export WINEPREFIX="$HOME/.local/wine${bottle:+/}${bottle:-$architecture}" # Arguments to the function are dependancies to be installed. # Get location of mono and gecko. monoPath="$(find /usr/share/wine/ -maxdepth 1 -type d -name mono 2> /dev/null)" @@ -154,21 +116,13 @@ install_wine_bottle() { cp "${cache}/nvda2speechd" "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd" chmod +x "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd" fi - winetricks -q isolate_home $@ ${winVer:-win7} ${winetricksSettings} - # make it easy for game scripts to know which version of wine to use. - if [[ ${#bottle} -gt 1 ]]; then - echo "WINE=\"${WINE}\"" > "$HOME/.local/wine/${bottle}/agm.conf" - echo "WINESERVER=\"${WINESERVER}\"" >> "$HOME/.local/wine/${bottle}/agm.conf" - echo "Setting default voice for bottle \"${bottle}\" to \"${defaultVoice}\"." - "${0%/*}/speech/set-voice.sh" -b "${bottle}" -r "${defaultRate:-7}" -v "${defaultVoice}" + winetricks -q isolate_home "$@" "${winVer:-win7}" ${winetricksSettings} + + # Set default voice for speech-enabled games + if [[ ${#defaultVoice} -ge 2 ]] && [[ "$*" =~ (speechsdk|sapi) ]]; then + echo "Setting default voice for wine${architecture}." + "${0%/*}/speech/set-voice.sh" -b "wine${architecture}" -r "${defaultRate:-7}" -v "${defaultVoice}" fi - # If default voice is set, change it for the current architecture - if [[ -z "$bottle" ]]; then - if [[ ${#defaultVoice} -ge 2 ]] && [[ "${*}" =~ (speechsdk|sapi) ]]; then - echo "Setting default voice for wine${architecture}." - "${0%/*}/speech/set-voice.sh" -b "${bottle}" -r "${defaultRate:-7}" -v "${defaultVoice}" - fi - fi } add_launcher() { diff --git a/.includes/dialog-interface.sh b/.includes/dialog-interface.sh index 8f96bcc..322e3b9 100644 --- a/.includes/dialog-interface.sh +++ b/.includes/dialog-interface.sh @@ -49,8 +49,9 @@ agm_menu() { --height=400 \ --width=600) - # Return the mapped value + # Strip trailing pipes and return the mapped value if [[ -n "$selectedDescription" ]]; then + selectedDescription="${selectedDescription%|}" echo "${valueMap["$selectedDescription"]}" fi else @@ -185,10 +186,12 @@ agm_yesno() { local text="$3" if [[ "$dialogType" == "yad" ]]; then - yad --question \ + yad --form \ --title="$title" \ - --text="$text" \ + --field="$text:LBL" \ --selectable-labels \ + --button="Yes:0" \ + --button="No:1" \ --width=400 else dialog --backtitle "$backTitle" \ diff --git a/.install/Alien Outback.sh b/.install/Alien Outback.sh index 1a41a7c..70e0b6f 100644 --- a/.install/Alien Outback.sh +++ b/.install/Alien Outback.sh @@ -1,5 +1,5 @@ download "http://download.dracoent.com/Windows/classic/AOSetup.exe" -export bottle="draconis" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle vb6run dx8vb speechsdk quartz cp -v "${cache}/AOSetup.exe" "$WINEPREFIX/drive_c/windows/temp/" diff --git a/.install/Battle of the Hunter.sh b/.install/Battle of the Hunter.sh index 444a7b4..e7d465a 100644 --- a/.install/Battle of the Hunter.sh +++ b/.install/Battle of the Hunter.sh @@ -1,5 +1,5 @@ download "http://files.tunmi13.com/projects_archive/bth.zip" -export bottle="tunmi13" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle speechsdk unzip -d "$WINEPREFIX/drive_c/Program Files/$game" "${cache}/bth.zip" diff --git a/.install/Battlefield 2D.sh b/.install/Battlefield 2D.sh index 7914fe8..b056b0f 100644 --- a/.install/Battlefield 2D.sh +++ b/.install/Battlefield 2D.sh @@ -2,7 +2,7 @@ get_installer "bf.zip" "https://tunmi13.itch.io/battlefield-2d" download "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd64.dll" export WINEARCH=win64 export winVer="win8" -export bottle=tunmi13-64bit +# Uses standard wine path based on architecture (win32/win64) install_wine_bottle unzip -d "$WINEPREFIX/drive_c/Program Files/" "${cache}/bf.zip" find "${WINEPREFIX}/drive_c/Program Files/bf" -type f -name 'nvdaControllerClient64.dll' -exec cp -v "${cache}/nvda2speechd64.dll" "{}" \; diff --git a/.install/Bokurano Daibouken 2.sh b/.install/Bokurano Daibouken 2.sh index 85b5e50..2210988 100644 --- a/.install/Bokurano Daibouken 2.sh +++ b/.install/Bokurano Daibouken 2.sh @@ -1,5 +1,5 @@ download "https://www.nyanchangames.com/softs/nn2_setup.exe" -export bottle="nyanchan" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle 7z x -o"$WINEPREFIX/drive_c/nyanchangame/bk2" "${cache}/nn2_setup.exe" diff --git a/.install/Bokurano Daibouken 3.sh b/.install/Bokurano Daibouken 3.sh index 3d2f09c..ea40ee3 100644 --- a/.install/Bokurano Daibouken 3.sh +++ b/.install/Bokurano Daibouken 3.sh @@ -15,7 +15,7 @@ if [[ "${#dictFile}" -ge 3 ]] && [[ ! -r "${cache}/bk3-dict.dat" ]]; then agm_yesno "Bokurano Daibouken 3" "Bokurano Daibouken 3" "Possible English translation file found at $dictFile. Would you like to use it for BK3?" && cp -v "$dictFile" "${cache}/bk3-dict.dat" fi download "https://www.nyanchangames.com/softs/nn3_setup.exe" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd32.dll" -export bottle="nyanchan" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle cp "${cache}/nvda2speechd" "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd" diff --git a/.install/Bokurano Daibouken.sh b/.install/Bokurano Daibouken.sh index 4402fb5..9fc8179 100644 --- a/.install/Bokurano Daibouken.sh +++ b/.install/Bokurano Daibouken.sh @@ -1,5 +1,5 @@ download "https://www.nyanchangames.com/softs/nn_setup.exe" -export bottle="nyanchan" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle 7z x -o"$WINEPREFIX/drive_c/nyanchangame/bk" "${cache}/nn_setup.exe" diff --git a/.install/Bombercats.sh b/.install/Bombercats.sh index 1f206fc..91e0744 100644 --- a/.install/Bombercats.sh +++ b/.install/Bombercats.sh @@ -1,5 +1,5 @@ download "http://oriolgomez.com/games/bombercats_en.zip" -export bottle="oriol-gomez" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle unzip -d "$WINEPREFIX/drive_c/Program Files/bomvercats" "${cache}/bombercats_en.zip" diff --git a/.install/Castaways 2.sh b/.install/Castaways 2.sh index adeecca..17e9f48 100644 --- a/.install/Castaways 2.sh +++ b/.install/Castaways 2.sh @@ -1,5 +1,5 @@ download "http://www.kaldobsky.com/audiogames/castaways2beta.zip" -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle vb6run dx8vb speechsdk unzip -d "$WINEPREFIX/drive_c/Program Files/castaways2" "${cache}/castaways2beta.zip" diff --git a/.install/Castaways.sh b/.install/Castaways.sh index 82cf9ea..48e2240 100644 --- a/.install/Castaways.sh +++ b/.install/Castaways.sh @@ -1,5 +1,5 @@ download "https://www.kaldobsky.com/audiogames/castaways.zip" -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle vb6run dx8vb speechsdk unzip -d "$WINEPREFIX/drive_c/Program Files/castaways" "${cache}/castaways.zip" diff --git a/.install/Challenge of the Horse.sh b/.install/Challenge of the Horse.sh index d0a8c04..a92f2c1 100644 --- a/.install/Challenge of the Horse.sh +++ b/.install/Challenge of the Horse.sh @@ -1,5 +1,5 @@ download "http://files.tunmi13.com/projects_archive/coth.zip" -export bottle="tunmi13" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle speechsdk unzip -d "$WINEPREFIX/drive_c/Program Files/$game" "${cache}/coth.zip" diff --git a/.install/Change Reaction.sh b/.install/Change Reaction.sh index af5df01..5ae499e 100644 --- a/.install/Change Reaction.sh +++ b/.install/Change Reaction.sh @@ -1,5 +1,5 @@ download "https://download.dracoent.com/Windows/ChangeReactionSetup.exe" -export bottle="draconis" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle vb6run dx8vb speechsdk quartz cp -v "${cache}/ChangeReactionSetup.exe" "$WINEPREFIX/drive_c/windows/temp/" diff --git a/.install/Clashes of the Sky.sh b/.install/Clashes of the Sky.sh index 94b4ee1..136a5a3 100644 --- a/.install/Clashes of the Sky.sh +++ b/.install/Clashes of the Sky.sh @@ -1,5 +1,5 @@ get_installer "clashes_of_the_sky.zip" "https://tunmi13.itch.io/clashes-of-the-sky" -export bottle="tunmi13" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle speechsdk unzip -d "$WINEPREFIX/drive_c/Program Files" "${cache}/clashes_of_the_sky.zip" diff --git a/.install/Copter Mission.sh b/.install/Copter Mission.sh index 14ac50e..c92a7a0 100644 --- a/.install/Copter Mission.sh +++ b/.install/Copter Mission.sh @@ -1,4 +1,4 @@ -export bottle="oriol-gomez" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "http://oriolgomez.com/games/copter_en.zip" install_wine_bottle diff --git a/.install/Danger on the Wheel.sh b/.install/Danger on the Wheel.sh index 0dfe23b..05f21b4 100644 --- a/.install/Danger on the Wheel.sh +++ b/.install/Danger on the Wheel.sh @@ -1,5 +1,5 @@ download "http://oriolgomez.com/games/wheel_en.zip" -export bottle="oriol-gomez" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle speechsdk unzip -d "$WINEPREFIX/drive_c/Program Files/danger on the wheel" "${cache}/wheel_en.zip" diff --git a/.install/Dark Destroyer.sh b/.install/Dark Destroyer.sh index dc8c70f..1286575 100644 --- a/.install/Dark Destroyer.sh +++ b/.install/Dark Destroyer.sh @@ -1,5 +1,5 @@ # -export bottle=pbgames +# No custom bottle needed - use standard wine path based on architecture download "https://www.agarchive.net/games/pb/Dark-Destroyer-Setup.exe" install_wine_bottle speechsdk ie6 wine "$cache/Dark-Destroyer-Setup.exe" /silent diff --git a/.install/Daytona and the Book of Gold.sh b/.install/Daytona and the Book of Gold.sh index 1e3c61d..a5fa3b7 100644 --- a/.install/Daytona and the Book of Gold.sh +++ b/.install/Daytona and the Book of Gold.sh @@ -1,4 +1,4 @@ -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" export winetricksSettings="vd=1024x768" download "https://kaldobsky.com/audiogames/Daytona.zip" diff --git a/.install/Death on the Road.sh b/.install/Death on the Road.sh index e6d8ff0..2573437 100644 --- a/.install/Death on the Road.sh +++ b/.install/Death on the Road.sh @@ -1,4 +1,4 @@ -export bottle="oriol-gomez" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "http://oriolgomez.com/games/road_en.zip" install_wine_bottle diff --git a/.install/Dog Who Hates Toast.sh b/.install/Dog Who Hates Toast.sh index 6aa746e..03d13ad 100644 --- a/.install/Dog Who Hates Toast.sh +++ b/.install/Dog Who Hates Toast.sh @@ -1,4 +1,4 @@ -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" export winetricksSettings="vd=1024x768" download "https://www.kaldobsky.com/audiogames/dogwhohatestoast.zip" diff --git a/.install/Dreamland.sh b/.install/Dreamland.sh index 8013107..9ca90e4 100644 --- a/.install/Dreamland.sh +++ b/.install/Dreamland.sh @@ -2,7 +2,7 @@ download https://scwl-1251129685.cos.ap-shanghai.myqcloud.com/dreamland/Win/Drea install_wine_bottle speechsdk ole32 $wine "${cache}/DreamLandSetup.exe" /silent "Duck Hunt") -export bottle="l-works" +# Uses standard wine path based on architecture (win32/win64) download "http://files.l-works.net/dhsetup.exe" install_wine_bottle vb6run dx8vb speechsdk wine "${cache}/dhsetup.exe" /silent diff --git a/.install/Duck Hunt.sh b/.install/Duck Hunt.sh index bb87a34..49a98ea 100644 --- a/.install/Duck Hunt.sh +++ b/.install/Duck Hunt.sh @@ -1,5 +1,5 @@ "Duck Hunt") -export bottle="l-works" +# Uses standard wine path based on architecture (win32/win64) download "http://files.l-works.net/dhsetup.exe" install_wine_bottle vb6run dx8vb speechsdk wine "${cache}/dhsetup.exe" /silent diff --git a/.install/DynaMan.sh b/.install/DynaMan.sh index 25c768c..ef6e1df 100644 --- a/.install/DynaMan.sh +++ b/.install/DynaMan.sh @@ -1,5 +1,5 @@ export winVer="win7" -export bottle="draconis" +# Uses standard wine path based on architecture (win32/win64) download "http://download.dracoent.com/Windows/classic/DMSetup.exe" install_wine_bottle vb6run dx8vb speechsdk quartz cp -v "${cache}/DMSetup.exe" "$WINEPREFIX/drive_c/windows/temp/" diff --git a/.install/ESP Pinball Classic.sh b/.install/ESP Pinball Classic.sh index ac46a98..5c4f4bb 100644 --- a/.install/ESP Pinball Classic.sh +++ b/.install/ESP Pinball Classic.sh @@ -1,5 +1,5 @@ export winVer="win7" -export bottle="draconis" +# Uses standard wine path based on architecture (win32/win64) download "http://download.dracoent.com/Windows/classic/PBCSetup.exe" install_wine_bottle vb6run dx8vb speechsdk quartz cp -v "${cache}/PBCSetup.exe" "$WINEPREFIX/drive_c/windows/temp/" diff --git a/.install/ESP Pinball Extreme.sh b/.install/ESP Pinball Extreme.sh index 4079c97..8e290c7 100644 --- a/.install/ESP Pinball Extreme.sh +++ b/.install/ESP Pinball Extreme.sh @@ -1,5 +1,5 @@ export winVer="win7" -export bottle="draconis" +# Uses standard wine path based on architecture (win32/win64) download "http://download.dracoent.com/Windows/classic/PBXSetup.exe" install_wine_bottle vb6run dx8vb speechsdk quartz cp -v "${cache}/PBXSetup.exe" "$WINEPREFIX/drive_c/windows/temp/" diff --git a/.install/ESP Pinball Party Pack.sh b/.install/ESP Pinball Party Pack.sh index c4701d9..109ba61 100644 --- a/.install/ESP Pinball Party Pack.sh +++ b/.install/ESP Pinball Party Pack.sh @@ -1,5 +1,5 @@ export winVer="win7" -export bottle="draconis" +# Uses standard wine path based on architecture (win32/win64) export WINEPREFIX="$HOME/.local/wine/draconis" # Only works in conjunction with esp pinball extreme. if ! [ -f "$HOME/.local/wine/$bottle/drive_c/Program Files/Draconis Entertainment/ESP Pinball Xtreme/pbx.exe" ] ; then diff --git a/.install/Entombed.sh b/.install/Entombed.sh index f07746e..b3a3f73 100644 --- a/.install/Entombed.sh +++ b/.install/Entombed.sh @@ -1,6 +1,5 @@ -export version="6.18" download "http://blind-games.com/newentombed/EntombedSetup.exe" "https://download.microsoft.com/download/E/C/1/EC1B2340-67A0-4B87-85F0-74D987A27160/SSCERuntime-ENU.exe" "https://stormgames.wolfe.casa/downloads/Entombed.exe.config" "https://stormgames.wolfe.casa/downloads/mfplat.dll" -install_wine "$version" "32" +# Uses wine32 due to speechsdk dependency export winVer="win7" install_wine_bottle speechsdk msvcrt40 gdiplus ie7 wmp11 mf # Ok, more dotnet. diff --git a/.install/Fuck That Bird.sh b/.install/Fuck That Bird.sh index 0fad3e2..0f1a15e 100644 --- a/.install/Fuck That Bird.sh +++ b/.install/Fuck That Bird.sh @@ -1,4 +1,4 @@ -export bottle="oriol-gomez" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "http://oriolgomez.com/games/bird_en.zip" install_wine_bottle diff --git a/.install/Hammer of Glory.sh b/.install/Hammer of Glory.sh index 520dc73..645b328 100644 --- a/.install/Hammer of Glory.sh +++ b/.install/Hammer of Glory.sh @@ -1,4 +1,4 @@ -export bottle="oriol-gomez" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "http://oriolgomez.com/games/hammer_en.zip" install_wine_bottle speechsdk diff --git a/.install/Insect Therapy.sh b/.install/Insect Therapy.sh index 7aa5925..313aa0b 100644 --- a/.install/Insect Therapy.sh +++ b/.install/Insect Therapy.sh @@ -1,4 +1,4 @@ -export bottle="oriol-gomez" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "http://oriolgomez.com/games/insect_en.zip" install_wine_bottle diff --git a/.install/Judgement Day.sh b/.install/Judgement Day.sh index 60ae578..a9a4f90 100644 --- a/.install/Judgement Day.sh +++ b/.install/Judgement Day.sh @@ -1,4 +1,4 @@ -export bottle="l-works" +# Uses standard wine path based on architecture (win32/win64) download "http://files.l-works.net/judgmentdayfullsetup.exe" install_wine_bottle vb6run dx8vb quartz wine "${cache}/judgmentdayfullsetup.exe" /silent diff --git a/.install/Laser Breakout.sh b/.install/Laser Breakout.sh index 1833bf8..8266a4d 100644 --- a/.install/Laser Breakout.sh +++ b/.install/Laser Breakout.sh @@ -1,5 +1,5 @@ # Currently only speaks in japanese, looking to see if we can find an english version. -export bottle="nyanchan" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "https://www.agarchive.net/games/nyanchan/laser%20breakout.7z" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd32.dll" "https://stormgames.wolfe.casa/downloads/laser-breakout-options.dat" install_wine_bottle diff --git a/.install/Lockpick.sh b/.install/Lockpick.sh index 427142b..a9fa742 100644 --- a/.install/Lockpick.sh +++ b/.install/Lockpick.sh @@ -1,4 +1,4 @@ -export bottle="l-works" +# Uses standard wine path based on architecture (win32/win64) download "http://files.l-works.net/lockpicksetup.exe" install_wine_bottle vb6run dx8vb wine "${cache}/lockpicksetup.exe" /silent diff --git a/.install/Lost.sh b/.install/Lost.sh index 2313d07..7a24330 100644 --- a/.install/Lost.sh +++ b/.install/Lost.sh @@ -1,4 +1,4 @@ -export bottle=dan-z +# Uses standard wine path based on architecture (win32/win64) download "https://agarchive.net/games/danZ/lost.zip" install_wine_bottle speechsdk unzip -d "$WINEPREFIX/drive_c/Program Files/lost" "$cache/lost.zip" diff --git a/.install/Lunimals.sh b/.install/Lunimals.sh index 349ce03..901d25e 100644 --- a/.install/Lunimals.sh +++ b/.install/Lunimals.sh @@ -1,4 +1,4 @@ -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" export winetricksSettings="vd=1024x768" download "https://kaldobsky.com/audiogames/lunimals.zip" diff --git a/.install/Marina Break.sh b/.install/Marina Break.sh index 8ed3afd..6a46527 100644 --- a/.install/Marina Break.sh +++ b/.install/Marina Break.sh @@ -1,5 +1,5 @@ # -export bottle="nyanchan" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "https://www.nyanchangames.com/softs/MbSetupE.exe" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd32.dll" install_wine_bottle speechsdk diff --git a/.install/Maze Craze.sh b/.install/Maze Craze.sh index 5db7775..ce1052f 100644 --- a/.install/Maze Craze.sh +++ b/.install/Maze Craze.sh @@ -1,4 +1,4 @@ -export bottle=dan-z +# Uses standard wine path based on architecture (win32/win64) download "http://www.danielzingaro.com/maze_craze_setup.exe" install_wine_bottle vb6run dx8vb ${wine} "${cache}/maze_craze_setup.exe" & diff --git a/.install/Monkey Business.sh b/.install/Monkey Business.sh index c277831..bba69b6 100644 --- a/.install/Monkey Business.sh +++ b/.install/Monkey Business.sh @@ -1,5 +1,5 @@ export winVer="win7" -export bottle="draconis" +# Uses standard wine path based on architecture (win32/win64) download "http://download.dracoent.com/Windows/classic/MBSetup.exe" install_wine_bottle vb6run dx8vb speechsdk quartz cp -v "${cache}/MBSetup.exe" "$WINEPREFIX/drive_c/windows/temp/" diff --git a/.install/Paw Prints.sh b/.install/Paw Prints.sh index 933a3be..60fb203 100644 --- a/.install/Paw Prints.sh +++ b/.install/Paw Prints.sh @@ -1,4 +1,4 @@ -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" export winetricksSettings="vd=1024x768" download "https://www.kaldobsky.com/audiogames/pawprints.zip" diff --git a/.install/Penta Path.sh b/.install/Penta Path.sh index f4ba764..50a243e 100644 --- a/.install/Penta Path.sh +++ b/.install/Penta Path.sh @@ -1,4 +1,4 @@ -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" export winetricksSettings="vd=1024x768" download "http://www.kaldobsky.com/audiogames/pentapath.zip" diff --git a/.install/Pigeon Panic.sh b/.install/Pigeon Panic.sh index 32b4e1e..44dceaf 100644 --- a/.install/Pigeon Panic.sh +++ b/.install/Pigeon Panic.sh @@ -1,4 +1,4 @@ -export bottle="l-works" +# Uses standard wine path based on architecture (win32/win64) download "http://agarchive.net/games/lworks/pigeon%20panic%20setup.exe" install_wine_bottle vb6run dx8vb wine "${cache}/pigeon panic setup.exe" /silent diff --git a/.install/Preludeamals.sh b/.install/Preludeamals.sh index 67230ce..72daa46 100644 --- a/.install/Preludeamals.sh +++ b/.install/Preludeamals.sh @@ -1,4 +1,4 @@ -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" export winetricksSettings="vd=1024x768" download "https://www.kaldobsky.com/audiogames/Preludeamals.zip" diff --git a/.install/Puzzle Divided.sh b/.install/Puzzle Divided.sh index c616527..3b43880 100644 --- a/.install/Puzzle Divided.sh +++ b/.install/Puzzle Divided.sh @@ -1,4 +1,4 @@ -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" export winetricksSettings="vd=1024x768" download "https://www.kaldobsky.com/audiogames/puzzledivided.zip" diff --git a/.install/Rettou.sh b/.install/Rettou.sh index 7f6c1bc..7a12391 100644 --- a/.install/Rettou.sh +++ b/.install/Rettou.sh @@ -1,4 +1,4 @@ -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" export winetricksSettings="vd=1024x768" download "http://www.kaldobsky.com/audiogames/rettou.zip" diff --git a/.install/Revelation.sh b/.install/Revelation.sh index cb288a6..31a1aed 100644 --- a/.install/Revelation.sh +++ b/.install/Revelation.sh @@ -1,4 +1,4 @@ -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" export winetricksSettings="vd=1024x768" download "https://www.kaldobsky.com/audiogames/revelation.zip" diff --git a/.install/Rhythm Rage.sh b/.install/Rhythm Rage.sh index b926ce0..0645465 100644 --- a/.install/Rhythm Rage.sh +++ b/.install/Rhythm Rage.sh @@ -1,4 +1,4 @@ -export bottle="oriol-gomez" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "http://oriolgomez.com/games/rr_en.zip" "${nvdaControllerClientDll}" install_wine_bottle speechsdk diff --git a/.install/Run For Your Life.sh b/.install/Run For Your Life.sh index d7f2a1a..fa5cbd9 100644 --- a/.install/Run For Your Life.sh +++ b/.install/Run For Your Life.sh @@ -1,4 +1,4 @@ -export bottle="oriol-gomez" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "http://oriolgomez.com/games/rfyl_en.zip" install_wine_bottle diff --git a/.install/Screaming Strike 2.sh b/.install/Screaming Strike 2.sh index d4592f5..969b845 100644 --- a/.install/Screaming Strike 2.sh +++ b/.install/Screaming Strike 2.sh @@ -1,4 +1,4 @@ -export bottle="nyanchan" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "https://www.nyanchangames.com/softs/screamingStrike2.exe" "${nvdaControllerClientDll}" install_wine_bottle fakejapanese speechsdk diff --git a/.install/Shadow Line.sh b/.install/Shadow Line.sh index 4f02b80..b724cca 100644 --- a/.install/Shadow Line.sh +++ b/.install/Shadow Line.sh @@ -1,6 +1,5 @@ -export version="7.7" download "https://www.mm-galabo.com/sr/Download_files_srfv/shadowrine_fullvoice3.171.exe" "https://raw.githubusercontent.com/LordLuceus/sr-english-localization/master/language_en.dat" -install_wine "$version" "32" +# Uses wine64 (no speech API dependency) export winVer="win8" install_wine_bottle $wine "${cache}/shadowrine_fullvoice3.171.exe" /sp- & diff --git a/.install/Silver Dollar.sh b/.install/Silver Dollar.sh index 827e6a4..e5e3ce2 100644 --- a/.install/Silver Dollar.sh +++ b/.install/Silver Dollar.sh @@ -1,5 +1,5 @@ export winVer="win7" -export bottle="draconis" +# Uses standard wine path based on architecture (win32/win64) download "http://download.dracoent.com/Windows/SilverDollarSetup.exe" install_wine_bottle speechsdk cp -v "${cache}/SilverDollarSetup.exe" "$WINEPREFIX/drive_c/windows/temp/" diff --git a/.install/Skateboarder Pro.sh b/.install/Skateboarder Pro.sh index 944b4d6..e926253 100644 --- a/.install/Skateboarder Pro.sh +++ b/.install/Skateboarder Pro.sh @@ -1,7 +1,7 @@ download "https://tunmi13.com/projects/sb_pro_rw.zip" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd64.dll" export WINEARCH=win64 export winVer="win8" -export bottle=tunmi13-64bit +# No custom bottle - use standard wine64 path install_wine_bottle sapi unzip -d "$WINEPREFIX/drive_c/Program Files/" "${cache}/sb_pro_rw.zip" find "${WINEPREFIX}/drive_c/Program Files/sb_pro_rw" -type f -name 'nvdaControllerClient64.dll' -exec cp -v "${cache}/nvda2speechd64.dll" "{}" \; diff --git a/.install/Slender Lost Vision.sh b/.install/Slender Lost Vision.sh index 3b4f4ab..2b4fcd5 100644 --- a/.install/Slender Lost Vision.sh +++ b/.install/Slender Lost Vision.sh @@ -16,7 +16,7 @@ add_launcher "c:\Program Files\shooter\shooter.exe" download "https://tunmi13.com/projects/sb_pro_rw.zip" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd64.dll" export WINEARCH=win64 export winVer="win8" -export bottle=tunmi13-64bit +# Uses standard wine path based on architecture (win32/win64) install_wine_bottle sapi unzip -d "$WINEPREFIX/drive_c/Program Files/" "${cache}/sb_pro_rw.zip" find "${WINEPREFIX}/drive_c/Program Files/sb_pro_rw" -type f -name 'nvdaControllerClient64.dll' -exec cp -v "${cache}/nvda2speechd64.dll" "{}" \; diff --git a/.install/Smashathon.sh b/.install/Smashathon.sh index 48c652e..3048b6c 100644 --- a/.install/Smashathon.sh +++ b/.install/Smashathon.sh @@ -1,4 +1,4 @@ -export bottle="l-works" +# Uses standard wine path based on architecture (win32/win64) download "https://agarchive.net/games/lworks/Smashathon0.02.zip" install_wine_bottle speechsdk unzip -d "$WINEPREFIX/drive_c/Program Files" "$cache/Smashathon0.02.zip" diff --git a/.install/Super Deekout.sh b/.install/Super Deekout.sh index 92f96e6..dd5b1f8 100644 --- a/.install/Super Deekout.sh +++ b/.install/Super Deekout.sh @@ -1,4 +1,4 @@ -export bottle=dan-z +# Uses standard wine path based on architecture (win32/win64) download "http://www.danielzingaro.com/superdeekout_setup.exe" "http://www.danielzingaro.com/sd_full.exe" install_wine_bottle vb6run dx8vb ${wine} "${cache}/superdeekout_setup.exe" & diff --git a/.install/Super Egg Hunt.sh b/.install/Super Egg Hunt.sh index ebd9979..bb1c16c 100644 --- a/.install/Super Egg Hunt.sh +++ b/.install/Super Egg Hunt.sh @@ -1,4 +1,4 @@ -export bottle="l-works" +# Uses standard wine path based on architecture (win32/win64) download "https://agarchive.net/games/lworks/super%20egg%20hunt+%20setup.exe" install_wine_bottle wine "${cache}/super egg hunt+ setup.exe" /silent diff --git a/.install/Super Liam.sh b/.install/Super Liam.sh index 2d47580..595b71f 100644 --- a/.install/Super Liam.sh +++ b/.install/Super Liam.sh @@ -1,4 +1,4 @@ -export bottle="l-works" +# Uses standard wine path based on architecture (win32/win64) download "http://files.l-works.net/superliamsetup.exe" install_wine_bottle vb6run dx8vb wine "${cache}/superliamsetup.exe" /silent diff --git a/.install/Swamp.sh b/.install/Swamp.sh index ee2737e..ca5e96c 100644 --- a/.install/Swamp.sh +++ b/.install/Swamp.sh @@ -1,7 +1,7 @@ # Source dialog interface wrapper source "${0%/*}/../.includes/dialog-interface.sh" -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" export winetricksSettings="vd=1024x768" agm_yesno "Swamp Installation" "Swamp Installation" "If you do not have a full 32 bit gstreamer installation, the Swamp music can cause stuttering and crashes. Would you like to remove the music directory after installation?" diff --git a/.install/Tarot Assistant.sh b/.install/Tarot Assistant.sh index 5430bfe..12637f7 100644 --- a/.install/Tarot Assistant.sh +++ b/.install/Tarot Assistant.sh @@ -1,4 +1,4 @@ -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "https://www.kaldobsky.com/audiogames/tarot.zip" install_wine_bottle vb6run dx8vb speechsdk diff --git a/.install/Ten Pin Alley.sh b/.install/Ten Pin Alley.sh index 743f197..799c19c 100644 --- a/.install/Ten Pin Alley.sh +++ b/.install/Ten Pin Alley.sh @@ -1,5 +1,5 @@ export winVer="win7" -export bottle="draconis" +# Uses standard wine path based on architecture (win32/win64) download "http://download.dracoent.com/Windows/classic/TPAXPSetup.exe" install_wine_bottle vb6run dx8vb speechsdk quartz cp -v "${cache}/TPAXPSetup.exe" "$WINEPREFIX/drive_c/windows/temp/" diff --git a/.install/The Great Toy Robbery.sh b/.install/The Great Toy Robbery.sh index 67f79b7..d8b56f2 100644 --- a/.install/The Great Toy Robbery.sh +++ b/.install/The Great Toy Robbery.sh @@ -1,4 +1,4 @@ -export bottle="l-works" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "http://files.l-works.net/tgtrsetup_2.04.exe" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd32.dll" install_wine_bottle dsound directmusic diff --git a/.install/Thief.sh b/.install/Thief.sh index 5a4f10a..1ced42a 100644 --- a/.install/Thief.sh +++ b/.install/Thief.sh @@ -1,4 +1,4 @@ -export bottle="oriol-gomez" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "http://oriolgomez.com/games/thief_en.zip" install_wine_bottle diff --git a/.install/Triple Triad.sh b/.install/Triple Triad.sh index 4e3bf6f..d0658ab 100644 --- a/.install/Triple Triad.sh +++ b/.install/Triple Triad.sh @@ -1,4 +1,4 @@ -export bottle="aprone" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "https://www.kaldobsky.com/audiogames/tripletriad.zip" install_wine_bottle vb6run dx8vb speechsdk diff --git a/.install/Ultimate SounDoku.sh b/.install/Ultimate SounDoku.sh index 966c7fc..e69af1c 100644 --- a/.install/Ultimate SounDoku.sh +++ b/.install/Ultimate SounDoku.sh @@ -1,5 +1,5 @@ export winVer="win7" -export bottle="draconis" +# Uses standard wine path based on architecture (win32/win64) download "http://download.dracoent.com/Windows/classic/USSetup.exe" install_wine_bottle vb6run dx8vb speechsdk quartz cp -v "${cache}/USSetup.exe" "$WINEPREFIX/drive_c/windows/temp/" diff --git a/.install/Villains From Beyond.sh b/.install/Villains From Beyond.sh index 03eca82..ebe6043 100644 --- a/.install/Villains From Beyond.sh +++ b/.install/Villains From Beyond.sh @@ -1,4 +1,4 @@ -export bottle="oriol-gomez" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "${ipfsGateway}/ipfs/QmWx271xuk3Mv9XTBoVu5BDJvXFZdasawC2nhtV21WAaUU?filename=villains_en.zip" install_wine_bottle speechsdk diff --git a/.install/World of War.sh b/.install/World of War.sh index 0a12abf..45d1fe5 100644 --- a/.install/World of War.sh +++ b/.install/World of War.sh @@ -1,4 +1,4 @@ -export bottle="nyanchan" +# Uses standard wine path based on architecture (win32/win64) export winVer="win7" download "https://www.agarchive.net/games/nyanchan/world%20of%20war%20English.7z" install_wine_bottle diff --git a/.install/haunted Party.sh b/.install/haunted Party.sh index 95090fc..e0fd811 100644 --- a/.install/haunted Party.sh +++ b/.install/haunted Party.sh @@ -2,7 +2,7 @@ get_installer "hp.zip" "https://tunmi13.itch.io/haunted-party" download "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd64.dll" export WINEARCH=win64 export winVer="win8" -export bottle=tunmi13-64bit +# Uses standard wine path based on architecture (win32/win64) install_wine_bottle unzip -d "$WINEPREFIX/drive_c/Program Files/" "${cache}/hp.zip" find "${WINEPREFIX}/drive_c/Program Files/hp" -type f -name 'nvdaControllerClient64.dll' -exec cp -v "${cache}/nvda2speechd64.dll" "{}" \; diff --git a/speech/clipboard_translator.sh b/speech/clipboard_translator.sh index d5ab82d..f05139d 100755 --- a/speech/clipboard_translator.sh +++ b/speech/clipboard_translator.sh @@ -39,20 +39,20 @@ fi # Define a function to safely query the database query_database() { - local db_file="$1" - local sql_query="$2" - sqlite3 -line "$db_file" "$sql_query" + local dbFile="$1" + local sqlQuery="$2" + sqlite3 -line "$dbFile" "$sqlQuery" } # Define a function to safely insert into the database insert_database() { - local db_file="$1" + local dbFile="$1" local text="$2" local translation="$3" # Use sqlite3 .import feature which is more robust for special characters - echo "$text|$translation" | sqlite3 -separator "|" "$db_file" ".import /dev/stdin temp_import" - sqlite3 "$db_file" "INSERT OR IGNORE INTO translations SELECT * FROM temp_import; DROP TABLE IF EXISTS temp_import;" + echo "$text|$translation" | sqlite3 -separator "|" "$dbFile" ".import /dev/stdin temp_import" + sqlite3 "$dbFile" "INSERT OR IGNORE INTO translations SELECT * FROM temp_import; DROP TABLE IF EXISTS temp_import;" } # Read so long as the application is running @@ -77,25 +77,25 @@ while pgrep -u "$USER" ^$1 &> /dev/null ; do # Normalize different unicode space characters to the same space # https://stackoverflow.com/a/43640405 - alias normalize_spaces="perl -CSDA -plE 's/[^\\S\\t]/ /g'" - alias normalize_unicode="normalize_spaces | nfc" + alias normalizeSpaces="perl -CSDA -plE 's/[^\\S\\t]/ /g'" + alias normalizeUnicode="normalizeSpaces | nfc" # Normalize text - normalized_text="$(echo "$text" | normalize_unicode)" + normalizedText="$(echo "$text" | normalizeUnicode)" # Create a temporary database for import sqlite3 "$translationFile" "CREATE TABLE IF NOT EXISTS temp_import(text TEXT, translation TEXT);" # Check if we already have a translation - translated=$(sqlite3 "$translationFile" "SELECT translation FROM translations WHERE text = '$normalized_text' LIMIT 1;" 2>/dev/null) + translated=$(sqlite3 "$translationFile" "SELECT translation FROM translations WHERE text = '$normalizedText' LIMIT 1;" 2>/dev/null) if [[ -z "$translated" ]]; then # Get translation from the trans utility - translated="$(trans -no-autocorrect -no-warn -brief "$normalized_text" | head -1 | sed 's/\s*$//' | normalize_unicode)" + translated="$(trans -no-autocorrect -no-warn -brief "$normalizedText" | head -1 | sed 's/\s*$//' | normalizeUnicode)" if [[ -n "$translated" ]]; then # Insert using echo piping to avoid escaping issues - echo "$normalized_text|$translated" | sqlite3 -separator "|" "$translationFile" ".import /dev/stdin temp_import" + echo "$normalizedText|$translated" | sqlite3 -separator "|" "$translationFile" ".import /dev/stdin temp_import" sqlite3 "$translationFile" "INSERT OR IGNORE INTO translations SELECT * FROM temp_import; DELETE FROM temp_import;" fi fi diff --git a/speech/speak_window_title.sh b/speech/speak_window_title.sh index eb73553..d296dfa 100755 --- a/speech/speak_window_title.sh +++ b/speech/speak_window_title.sh @@ -19,9 +19,9 @@ while pgrep -u "$USER" ^$1 &> /dev/null ; do if [[ "$wnd_title" =~ $lookfor ]]; then wnd_title=${BASH_REMATCH[1]} - if [[ "$old_title" != "$wnd_title" ]]; then + if [[ "$oldTitle" != "$wnd_title" ]]; then spd-say -- "$wnd_title" - old_title="$wnd_title" + oldTitle="$wnd_title" fi fi done