Attempt to fix fail bottle setup on some distros.
This commit is contained in:
+18
-9
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user