9 Commits
7 changed files with 118 additions and 40 deletions
+1
View File
@@ -1,3 +1,4 @@
*.x.c *.x.c
*.x *.x
music/ music/
/game.log
+73 -31
View File
@@ -40,15 +40,41 @@ set_wine_env() {
# Note: install_wine function removed - we now use system wine with simplified bottle management # 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() { winetricks() {
# Report used packages to the winetricks maintainer so he knows they are being used. # 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 enable_winetricks_usage_reporting
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
# Download or update agm's copy of winetricks # Download or update agm's copy of winetricks
if [[ ! -e "${winetricksPath}/winetricks" ]]; then if [[ ! -e "${winetricksPath}/winetricks" ]]; then
checkWinetricksUpdate="true" checkWinetricksUpdate="true"
@@ -58,42 +84,50 @@ winetricks() {
else else
if [[ "$checkWinetricksUpdate" != "true" ]]; then if [[ "$checkWinetricksUpdate" != "true" ]]; then
checkWinetricksUpdate="true" checkWinetricksUpdate="true"
${winetricksPath}/winetricks --self-update "${winetricksPath}/winetricks" --self-update
fi fi
fi fi
# Run the requested winetricks parameters # Run the requested winetricks parameters
if command -v FEXLoader &> /dev/null ; then if command -v FEXLoader &> /dev/null ; then
WINE="" FEXLoader -- ${winetricksPath}/winetricks "$@" WINE="" FEXLoader -- "${winetricksPath}/winetricks" "$@"
else else
${winetricksPath}/winetricks "$@" "${winetricksPath}/winetricks" "$@"
fi fi
} }
install_winespeak() { install_winespeak() {
local installerName="winespeak.exe" local installerName="winespeak.exe"
local installerPath="${cache}/${installerName}" local installerPath="${cache}/${installerName}"
local installerSha256="187d4db69f3af7c1bca1c100a04489b76732048be7c38449781da360ed7b2d66" local installerSha256="8007004cd024b391e8f1962455ffe2a8b241cfdf52641a2bc1aa2274bc80f236"
local wrapperPath="${WINEPREFIX}/drive_c/Program Files (x86)/espeak-ng-sapi/EspeakSAPI.dll" 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 cscriptPath="${WINEPREFIX}/drive_c/windows/syswow64/cscript.exe"
local verifyScriptPath="${WINEPREFIX}/drive_c/windows/temp/verify_winespeak.vbs" local verifyScriptPath="${WINEPREFIX}/drive_c/windows/temp/verify_winespeak.vbs"
local actualSha256 local actualSha256
local verificationAttempt
local registryOutput local registryOutput
local voiceOutput 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 if [[ -z "${wineSpeakInstaller:-}" ]]; then
echo "WineSpeak download URL is not configured." echo "WineSpeak download URL is not configured."
return 1 return 1
fi fi
download "$wineSpeakInstaller" for ((verificationAttempt = 1; verificationAttempt <= 3; verificationAttempt++)); do
actualSha256="$(sha256sum "$installerPath" | awk '{print $1}')" download "$wineSpeakInstaller"
if [[ "$actualSha256" != "$installerSha256" ]]; then actualSha256="$(sha256sum "$installerPath" | awk '{print $1}')"
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" rm -f "$installerPath"
return 1 if ((verificationAttempt == 3)); then
fi return 1
fi
echo "Downloading WineSpeak again."
done
if ! wine "$installerPath" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-; then if ! wine "$installerPath" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-; then
echo "WineSpeak installer failed." echo "WineSpeak installer failed."
@@ -123,21 +157,29 @@ install_winespeak() {
mkdir -p "${verifyScriptPath%/*}" mkdir -p "${verifyScriptPath%/*}"
cat > "$verifyScriptPath" <<'EOF' cat > "$verifyScriptPath" <<'EOF'
dim speechobject dim speechobject
dim voiceDescription
set speechobject=createobject("sapi.spvoice") 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 EOF
if ! voiceOutput="$(wine "$cscriptPath" //nologo 'c:\windows\temp\verify_winespeak.vbs' 2>&1)"; then voiceStatus=0
echo "WineSpeak's 32-bit SAPI voice could not be created." voiceOutput="$(wine "$cscriptPath" //nologo 'c:\windows\temp\verify_winespeak.vbs' 2>&1)" || voiceStatus=$?
echo "$voiceOutput" if [[ "$voiceStatus" -ne 0 ]]; then
return 1 if [[ "$voiceStatus" -eq 2 ]]; then
fi echo "WineSpeak's 32-bit SAPI verification returned an unexpected voice."
if ! grep -Fq "English (America)" <<< "$voiceOutput"; then else
echo "WineSpeak's 32-bit SAPI verification returned an unexpected voice." echo "WineSpeak's 32-bit SAPI voice could not be created."
echo "$voiceOutput" fi
if [[ -n "$voiceOutput" ]]; then
echo "$voiceOutput"
fi
return 1 return 1
fi fi
echo "WineSpeak English (America) is the default SAPI voice." echo "WineSpeak US English is the default SAPI voice."
} }
install_rhvoice() { install_rhvoice() {
@@ -239,7 +281,7 @@ install_wine_bottle() {
if [[ ${#regularDeps[@]} -gt 0 ]]; then if [[ ${#regularDeps[@]} -gt 0 ]]; then
echo "Installing additional dependencies: ${regularDeps[*]}" 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..." } | agm_progressbox "Wine Setup" "Installing additional dependencies..."
fi fi
@@ -247,7 +289,7 @@ install_wine_bottle() {
if [[ "$needsSpeechsdk" == "true" ]]; then if [[ "$needsSpeechsdk" == "true" ]]; then
echo "Installing speechsdk with WINETRICKS_FORCE=1" 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..." } | agm_progressbox "Wine Setup" "Installing Speech SDK..."
fi fi
fi fi
+1
View File
@@ -7,6 +7,7 @@ declare -Ag ipfs=(
[nvdaControllerClient32]="${ipfsGateway}/ipfs/QmTrRrT4QFKSkZ8ivfUawA6iJ6adEyyogccE3nLDTfSK8u?filename=nvdaControllerClient32.dll" [nvdaControllerClient32]="${ipfsGateway}/ipfs/QmTrRrT4QFKSkZ8ivfUawA6iJ6adEyyogccE3nLDTfSK8u?filename=nvdaControllerClient32.dll"
[nvdaControllerClient64]="${ipfsGateway}/ipfs/QmaYE7RFDtwHCiXCVLcuA3esfFx6E7koidtvrck9AwPuuN?filename=nvdaControllerClient64.dll" [nvdaControllerClient64]="${ipfsGateway}/ipfs/QmaYE7RFDtwHCiXCVLcuA3esfFx6E7koidtvrck9AwPuuN?filename=nvdaControllerClient64.dll"
[nvda2speechd]="${ipfsGateway}/ipfs/QmPxhoNsoFoJC7bCfioBBCcK8tEoSoYpm342z6u7KjFsVz?filename=nvda2speechd" [nvda2speechd]="${ipfsGateway}/ipfs/QmPxhoNsoFoJC7bCfioBBCcK8tEoSoYpm342z6u7KjFsVz?filename=nvda2speechd"
[speechsdk]="${ipfsGateway}/ipfs/QmXKp7xKoaLmpLJ8GoGJbQcGXnfMkfoqq5PDpyWHWnL9DB?filename=speechsdk.zip"
[winespeak]="https://stormgames.wolfe.casa/downloads/winespeak.exe" [winespeak]="https://stormgames.wolfe.casa/downloads/winespeak.exe"
# Games (alphabetical order) # 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
@@ -303,6 +303,9 @@ ensure_wine_bottles() {
# Initialize wine64 bottle # Initialize wine64 bottle
echo "# Initializing wine64 environment..." echo "# Initializing wine64 environment..."
DISPLAY="" wine wineboot -u DISPLAY="" wine wineboot -u
# Seed Winetricks with the Speech SDK payload before installing dependencies.
prepare_speechsdk_cache || return 1
# Install mono and gecko # Install mono and gecko
echo "# Installing .NET Framework..." echo "# Installing .NET Framework..."
@@ -327,13 +330,13 @@ ensure_wine_bottles() {
# Install Speech SDK for SAPI compatibility (experimental - requires WINETRICKS_FORCE=1) # Install Speech SDK for SAPI compatibility (experimental - requires WINETRICKS_FORCE=1)
echo "# Installing Speech SDK for wine64 SAPI support..." 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) # Restore win10 after speechsdk (speechsdk sets winxp)
winetricks -q win10 winetricks -q win10
# Install and verify the default 32-bit SAPI voice. # Install and verify the default 32-bit SAPI voice.
echo "# Installing WineSpeak English (America)..." echo "# Installing WineSpeak US English..."
if ! install_winespeak; then if ! install_winespeak; then
echo "# WineSpeak installation or SAPI verification failed." echo "# WineSpeak installation or SAPI verification failed."
return 1 return 1
+2
View File
@@ -13,4 +13,6 @@ if [[ $newver -gt $myver ]]; then
download "https://kaldobsky.com/audiogames/swamp2_update.zip" download "https://kaldobsky.com/audiogames/swamp2_update.zip"
install_with_progress unzip "Extracting game files..." -d "${swamphouse}" "${cache}/swamp2_update.zip" install_with_progress unzip "Extracting game files..." -d "${swamphouse}" "${cache}/swamp2_update.zip"
rm "${cache}/swamp2_update.zip" rm "${cache}/swamp2_update.zip"
else
agm_msgbox "Nothing to do; your game is up to date."
fi fi
+30 -7
View File
@@ -4,15 +4,17 @@ set -euo pipefail
export WINEPREFIX="${WINEPREFIX:-${HOME}/.local/wine64}" export WINEPREFIX="${WINEPREFIX:-${HOME}/.local/wine64}"
export WINEDEBUG="${WINEDEBUG:--all}" 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" installerName="winespeak.exe"
installerSha256="187d4db69f3af7c1bca1c100a04489b76732048be7c38449781da360ed7b2d66" installerSha256="${WINESPEAK_INSTALLER_SHA256:-8007004cd024b391e8f1962455ffe2a8b241cfdf52641a2bc1aa2274bc80f236}"
cacheDir="${XDG_CACHE_HOME:-${HOME}/.cache}/audiogame-manager" cacheDir="${XDG_CACHE_HOME:-${HOME}/.cache}/audiogame-manager"
installerPath="${cacheDir}/${installerName}" installerPath="${cacheDir}/${installerName}"
partialPath="${installerPath}.part" partialPath="${installerPath}.part"
wrapperPath="${WINEPREFIX}/drive_c/Program Files (x86)/espeak-ng-sapi/EspeakSAPI.dll" wrapperPath="${WINEPREFIX}/drive_c/Program Files (x86)/espeak-ng-sapi/EspeakSAPI.dll"
wrapperSha256="8009750dad82ca6665871814033dcee6844bb424f033130c109f47e188c5364b" wrapperSha256="2282da4a23f18b40e6601a4b9a880f484196bf2f5138881e76428be10d8dbe76"
voiceToken="HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\TokenEnums\\eSpeak-NG\\English (America)" 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() { fail() {
printf 'Error: %s\n' "$*" >&2 printf 'Error: %s\n' "$*" >&2
@@ -57,9 +59,11 @@ download_installer() {
install_winespeak() { install_winespeak() {
local registryOutput local registryOutput
local voiceOutput
download_installer download_installer
wineserver -k || true
printf 'Installing WineSpeak into %s...\n' "$WINEPREFIX" printf 'Installing WineSpeak into %s...\n' "$WINEPREFIX"
if ! wine "$installerPath" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-; then if ! wine "$installerPath" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-; then
fail 'WineSpeak installation failed.' fail 'WineSpeak installation failed.'
@@ -72,7 +76,7 @@ install_winespeak() {
fail 'WineSpeak installed an unexpected 32-bit SAPI wrapper.' fail 'WineSpeak installed an unexpected 32-bit SAPI wrapper.'
fi 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' \ if ! wine reg add 'HKCU\Software\Microsoft\Speech\Voices' \
/v DefaultTokenId /t REG_SZ /d "$voiceToken" /f > /dev/null; then /v DefaultTokenId /t REG_SZ /d "$voiceToken" /f > /dev/null; then
fail 'Could not set the default SAPI voice.' fail 'Could not set the default SAPI voice.'
@@ -83,10 +87,29 @@ install_winespeak() {
fail 'Could not verify the default SAPI voice.' fail 'Could not verify the default SAPI voice.'
fi 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" require_command "$commandName"
done done