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
+18 -9
View File
@@ -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