9 Commits
7 changed files with 118 additions and 40 deletions
+1
View File
@@ -1,3 +1,4 @@
*.x.c
*.x
music/
/game.log
+67 -25
View File
@@ -40,15 +40,41 @@ set_wine_env() {
# Note: install_wine function removed - we now use system wine with simplified bottle management
enable_winetricks_usage_reporting() {
local winetricksCache="${XDG_CACHE_HOME:-$HOME/.cache}/winetricks"
mkdir -p "$winetricksCache"
if [[ ! -e "${winetricksCache}/track_usage" ]]; then
printf '1\n' > "${winetricksCache}/track_usage"
fi
}
prepare_speechsdk_cache() {
local winetricksCache="${XDG_CACHE_HOME:-$HOME/.cache}/winetricks"
local speechsdkPayload="${winetricksCache}/speechsdk/SpeechSDK51.exe"
enable_winetricks_usage_reporting
if [[ -f "$speechsdkPayload" ]]; then
return
fi
echo "Downloading Speech SDK for the Winetricks cache..."
# ipfs and cache are populated by the main script before bottle setup.
# shellcheck disable=SC2154
download "${ipfs[speechsdk]}"
if ! unzip -oq "${cache}/speechsdk.zip" -d "$winetricksCache"; then
echo "Could not extract Speech SDK into the Winetricks cache."
return 1
fi
if [[ ! -f "$speechsdkPayload" ]]; then
echo "The Speech SDK archive did not contain speechsdk/SpeechSDK51.exe."
return 1
fi
}
winetricks() {
# Report used packages to the winetricks maintainer so he knows they are being used.
if ! [[ -e "${XDG_CACHE_HOME:-$HOME/.cache}/winetricks/track_usage" ]]; then
mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}/winetricks/"
echo "1" > "${XDG_CACHE_HOME:-$HOME/.cache}/winetricks/track_usage"
fi
# Temporary work around for winetricks git bugs. Requires winetricks be installed from package manager.
/usr/bin/winetricks "$@"
return
enable_winetricks_usage_reporting
# Download or update agm's copy of winetricks
if [[ ! -e "${winetricksPath}/winetricks" ]]; then
checkWinetricksUpdate="true"
@@ -58,42 +84,50 @@ winetricks() {
else
if [[ "$checkWinetricksUpdate" != "true" ]]; then
checkWinetricksUpdate="true"
${winetricksPath}/winetricks --self-update
"${winetricksPath}/winetricks" --self-update
fi
fi
# Run the requested winetricks parameters
if command -v FEXLoader &> /dev/null ; then
WINE="" FEXLoader -- ${winetricksPath}/winetricks "$@"
WINE="" FEXLoader -- "${winetricksPath}/winetricks" "$@"
else
${winetricksPath}/winetricks "$@"
"${winetricksPath}/winetricks" "$@"
fi
}
install_winespeak() {
local installerName="winespeak.exe"
local installerPath="${cache}/${installerName}"
local installerSha256="187d4db69f3af7c1bca1c100a04489b76732048be7c38449781da360ed7b2d66"
local installerSha256="8007004cd024b391e8f1962455ffe2a8b241cfdf52641a2bc1aa2274bc80f236"
local wrapperPath="${WINEPREFIX}/drive_c/Program Files (x86)/espeak-ng-sapi/EspeakSAPI.dll"
local wrapperSha256="8009750dad82ca6665871814033dcee6844bb424f033130c109f47e188c5364b"
local wrapperSha256="2282da4a23f18b40e6601a4b9a880f484196bf2f5138881e76428be10d8dbe76"
local cscriptPath="${WINEPREFIX}/drive_c/windows/syswow64/cscript.exe"
local verifyScriptPath="${WINEPREFIX}/drive_c/windows/temp/verify_winespeak.vbs"
local actualSha256
local verificationAttempt
local registryOutput
local voiceOutput
local defaultToken='HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\TokenEnums\eSpeak-NG\English (America)'
local voiceStatus
local defaultToken='HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\Espeak-ng US English'
if [[ -z "${wineSpeakInstaller:-}" ]]; then
echo "WineSpeak download URL is not configured."
return 1
fi
for ((verificationAttempt = 1; verificationAttempt <= 3; verificationAttempt++)); do
download "$wineSpeakInstaller"
actualSha256="$(sha256sum "$installerPath" | awk '{print $1}')"
if [[ "$actualSha256" != "$installerSha256" ]]; then
echo "WineSpeak installer failed its SHA-256 check."
if [[ "$actualSha256" == "$installerSha256" ]]; then
break
fi
echo "WineSpeak installer failed its SHA-256 check (attempt ${verificationAttempt} of 3)."
rm -f "$installerPath"
if ((verificationAttempt == 3)); then
return 1
fi
echo "Downloading WineSpeak again."
done
if ! wine "$installerPath" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-; then
echo "WineSpeak installer failed."
@@ -123,21 +157,29 @@ install_winespeak() {
mkdir -p "${verifyScriptPath%/*}"
cat > "$verifyScriptPath" <<'EOF'
dim speechobject
dim voiceDescription
set speechobject=createobject("sapi.spvoice")
wscript.echo speechobject.voice.getdescription
voiceDescription=speechobject.voice.getdescription
if instr(1, voiceDescription, "Espeak-ng US English", 1)=0 then
wscript.echo voiceDescription
wscript.quit 2
end if
EOF
if ! voiceOutput="$(wine "$cscriptPath" //nologo 'c:\windows\temp\verify_winespeak.vbs' 2>&1)"; then
echo "WineSpeak's 32-bit SAPI voice could not be created."
echo "$voiceOutput"
return 1
fi
if ! grep -Fq "English (America)" <<< "$voiceOutput"; then
voiceStatus=0
voiceOutput="$(wine "$cscriptPath" //nologo 'c:\windows\temp\verify_winespeak.vbs' 2>&1)" || voiceStatus=$?
if [[ "$voiceStatus" -ne 0 ]]; then
if [[ "$voiceStatus" -eq 2 ]]; then
echo "WineSpeak's 32-bit SAPI verification returned an unexpected voice."
else
echo "WineSpeak's 32-bit SAPI voice could not be created."
fi
if [[ -n "$voiceOutput" ]]; then
echo "$voiceOutput"
fi
return 1
fi
echo "WineSpeak English (America) is the default SAPI voice."
echo "WineSpeak US English is the default SAPI voice."
}
install_rhvoice() {
@@ -239,7 +281,7 @@ install_wine_bottle() {
if [[ ${#regularDeps[@]} -gt 0 ]]; then
echo "Installing additional dependencies: ${regularDeps[*]}"
{
env WINE="$WINE" WINESERVER="$WINESERVER" DISPLAY="${DISPLAY:-:0}" winetricks -q isolate_home "${regularDeps[@]}" ${winetricksSettings}
WINE="$WINE" WINESERVER="$WINESERVER" DISPLAY="${DISPLAY:-:0}" winetricks -q isolate_home "${regularDeps[@]}" ${winetricksSettings}
} | agm_progressbox "Wine Setup" "Installing additional dependencies..."
fi
@@ -247,7 +289,7 @@ install_wine_bottle() {
if [[ "$needsSpeechsdk" == "true" ]]; then
echo "Installing speechsdk with WINETRICKS_FORCE=1"
{
env WINE="$WINE" WINESERVER="$WINESERVER" DISPLAY="${DISPLAY:-:0}" WINETRICKS_FORCE=1 winetricks -q speechsdk
WINE="$WINE" WINESERVER="$WINESERVER" DISPLAY="${DISPLAY:-:0}" WINETRICKS_FORCE=1 winetricks -q speechsdk
} | agm_progressbox "Wine Setup" "Installing Speech SDK..."
fi
fi
+1
View File
@@ -7,6 +7,7 @@ declare -Ag ipfs=(
[nvdaControllerClient32]="${ipfsGateway}/ipfs/QmTrRrT4QFKSkZ8ivfUawA6iJ6adEyyogccE3nLDTfSK8u?filename=nvdaControllerClient32.dll"
[nvdaControllerClient64]="${ipfsGateway}/ipfs/QmaYE7RFDtwHCiXCVLcuA3esfFx6E7koidtvrck9AwPuuN?filename=nvdaControllerClient64.dll"
[nvda2speechd]="${ipfsGateway}/ipfs/QmPxhoNsoFoJC7bCfioBBCcK8tEoSoYpm342z6u7KjFsVz?filename=nvda2speechd"
[speechsdk]="${ipfsGateway}/ipfs/QmXKp7xKoaLmpLJ8GoGJbQcGXnfMkfoqq5PDpyWHWnL9DB?filename=speechsdk.zip"
[winespeak]="https://stormgames.wolfe.casa/downloads/winespeak.exe"
# Games (alphabetical order)
+6
View File
@@ -0,0 +1,6 @@
install_wine_bottle
download "https://terraformers.nu/terraformers-install1.03.exe"
download "https://terraformers.nu/pinTFLicKey.txt.zip"
wine "${cache}/terraformers-install1.03.exe" /silent
install_with_progress unzip "Extracting game license key..." -d "${WINEPREFIX}/drive_c/Program Files (x86)/Terraformers/Prefs" "${cache}/pinTFLicKey.txt.zip"
add_launcher "c:\Program Files (x86)\Terraformers\Game.exe"
+5 -2
View File
@@ -304,6 +304,9 @@ ensure_wine_bottles() {
echo "# Initializing wine64 environment..."
DISPLAY="" wine wineboot -u
# Seed Winetricks with the Speech SDK payload before installing dependencies.
prepare_speechsdk_cache || return 1
# Install mono and gecko
echo "# Installing .NET Framework..."
monoPath="$(find /usr/share/wine/ -maxdepth 1 -type d -name mono 2> /dev/null)"
@@ -327,13 +330,13 @@ ensure_wine_bottles() {
# Install Speech SDK for SAPI compatibility (experimental - requires WINETRICKS_FORCE=1)
echo "# Installing Speech SDK for wine64 SAPI support..."
env WINE="$WINE" WINESERVER="$WINESERVER" DISPLAY="${DISPLAY:-:0}" WINETRICKS_FORCE=1 winetricks -q speechsdk
WINE="$WINE" WINESERVER="$WINESERVER" DISPLAY="${DISPLAY:-:0}" WINETRICKS_FORCE=1 winetricks -q speechsdk
# Restore win10 after speechsdk (speechsdk sets winxp)
winetricks -q win10
# Install and verify the default 32-bit SAPI voice.
echo "# Installing WineSpeak English (America)..."
echo "# Installing WineSpeak US English..."
if ! install_winespeak; then
echo "# WineSpeak installation or SAPI verification failed."
return 1
+2
View File
@@ -13,4 +13,6 @@ if [[ $newver -gt $myver ]]; then
download "https://kaldobsky.com/audiogames/swamp2_update.zip"
install_with_progress unzip "Extracting game files..." -d "${swamphouse}" "${cache}/swamp2_update.zip"
rm "${cache}/swamp2_update.zip"
else
agm_msgbox "Nothing to do; your game is up to date."
fi
+30 -7
View File
@@ -4,15 +4,17 @@ set -euo pipefail
export WINEPREFIX="${WINEPREFIX:-${HOME}/.local/wine64}"
export WINEDEBUG="${WINEDEBUG:--all}"
installerUrl="https://stormgames.wolfe.casa/downloads/winespeak.exe"
installerUrl="${WINESPEAK_INSTALLER_URL:-https://stormgames.wolfe.casa/downloads/winespeak.exe}"
installerName="winespeak.exe"
installerSha256="187d4db69f3af7c1bca1c100a04489b76732048be7c38449781da360ed7b2d66"
installerSha256="${WINESPEAK_INSTALLER_SHA256:-8007004cd024b391e8f1962455ffe2a8b241cfdf52641a2bc1aa2274bc80f236}"
cacheDir="${XDG_CACHE_HOME:-${HOME}/.cache}/audiogame-manager"
installerPath="${cacheDir}/${installerName}"
partialPath="${installerPath}.part"
wrapperPath="${WINEPREFIX}/drive_c/Program Files (x86)/espeak-ng-sapi/EspeakSAPI.dll"
wrapperSha256="8009750dad82ca6665871814033dcee6844bb424f033130c109f47e188c5364b"
voiceToken="HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\TokenEnums\\eSpeak-NG\\English (America)"
wrapperSha256="2282da4a23f18b40e6601a4b9a880f484196bf2f5138881e76428be10d8dbe76"
cscriptPath="${WINEPREFIX}/drive_c/windows/syswow64/cscript.exe"
verifyScriptPath="${WINEPREFIX}/drive_c/windows/temp/verify_winespeak.vbs"
voiceToken="HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\Espeak-ng US English"
fail() {
printf 'Error: %s\n' "$*" >&2
@@ -57,9 +59,11 @@ download_installer() {
install_winespeak() {
local registryOutput
local voiceOutput
download_installer
wineserver -k || true
printf 'Installing WineSpeak into %s...\n' "$WINEPREFIX"
if ! wine "$installerPath" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-; then
fail 'WineSpeak installation failed.'
@@ -72,7 +76,7 @@ install_winespeak() {
fail 'WineSpeak installed an unexpected 32-bit SAPI wrapper.'
fi
printf 'Setting English (America) as the default SAPI voice...\n'
printf 'Setting WineSpeak US English as the default SAPI voice...\n'
if ! wine reg add 'HKCU\Software\Microsoft\Speech\Voices' \
/v DefaultTokenId /t REG_SZ /d "$voiceToken" /f > /dev/null; then
fail 'Could not set the default SAPI voice.'
@@ -83,10 +87,29 @@ install_winespeak() {
fail 'Could not verify the default SAPI voice.'
fi
printf 'WineSpeak is installed and English (America) is the default SAPI voice.\n'
if [[ ! -f "$cscriptPath" ]]; then
fail "Wine's 32-bit cscript.exe was not found. Install speechsdk in this prefix first."
fi
mkdir -p "${verifyScriptPath%/*}"
printf '%s\n' \
'dim speechobject' \
'set speechobject=createobject("sapi.spvoice")' \
'wscript.echo speechobject.voice.getdescription' > "$verifyScriptPath"
if ! voiceOutput="$(wine "$cscriptPath" //nologo 'c:\windows\temp\verify_winespeak.vbs' 2>&1)"; then
fail "WineSpeak's 32-bit SAPI voice could not be created: ${voiceOutput}"
fi
if ! grep -Fq 'Espeak-ng US English' <<< "$voiceOutput"; then
fail "WineSpeak's 32-bit SAPI verification returned an unexpected voice: ${voiceOutput}"
fi
printf 'WineSpeak is installed and US English is the default SAPI voice.\n'
}
for commandName in curl wine sha256sum awk grep; do
if [[ ! -d "${WINEPREFIX}/drive_c" ]]; then
fail "Wine prefix does not exist: ${WINEPREFIX}"
fi
for commandName in curl wine wineserver sha256sum awk grep; do
require_command "$commandName"
done