Attempt to fix fail bottle setup on some distros.

This commit is contained in:
Storm Dragon
2026-08-30 01:27:30 -04:00
parent 38a9b2cd39
commit edf8e8e104
+16 -7
View File
@@ -110,6 +110,7 @@ install_winespeak() {
local verificationAttempt local verificationAttempt
local registryOutput local registryOutput
local voiceOutput local voiceOutput
local voiceStatus
local defaultToken='HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\Espeak-ng US English' local defaultToken='HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\Espeak-ng US English'
if [[ -z "${wineSpeakInstaller:-}" ]]; then if [[ -z "${wineSpeakInstaller:-}" ]]; then
@@ -159,17 +160,25 @@ 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
if ! grep -Fq "Espeak-ng US English" <<< "$voiceOutput"; then
echo "WineSpeak's 32-bit SAPI verification returned an unexpected voice." 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" echo "$voiceOutput"
fi
return 1 return 1
fi fi