From edf8e8e1044f74f5de66206a5fc827fa94d302b7 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 30 Aug 2026 01:27:30 -0400 Subject: [PATCH] Attempt to fix fail bottle setup on some distros. --- .includes/bottle.sh | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.includes/bottle.sh b/.includes/bottle.sh index 52db0e4..aeac322 100644 --- a/.includes/bottle.sh +++ b/.includes/bottle.sh @@ -110,6 +110,7 @@ install_winespeak() { local verificationAttempt local registryOutput local voiceOutput + local voiceStatus local defaultToken='HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\Espeak-ng US English' if [[ -z "${wineSpeakInstaller:-}" ]]; then @@ -159,17 +160,25 @@ 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 "Espeak-ng US English" <<< "$voiceOutput"; then - echo "WineSpeak's 32-bit SAPI verification returned an unexpected voice." - echo "$voiceOutput" + 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