Fix stale caching of winespeak.

This commit is contained in:
Storm Dragon committed 2026-08-30 00:27:28 -04:00
1 parent 4f11130369
commit 4112aa3bda
1 file changed
+13 -6
+13 -6
View File
@@ -78,6 +78,7 @@ install_winespeak() {
local cscriptPath="${WINEPREFIX}/drive_c/windows/syswow64/cscript.exe"
local verifyScriptPath="${WINEPREFIX}/drive_c/windows/temp/verify_winespeak.vbs"
local actualSha256
local verificationAttempt
local registryOutput
local voiceOutput
local defaultToken='HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\Espeak-ng US English'
@@ -87,13 +88,19 @@ install_winespeak() {
return 1
fi
download "$wineSpeakInstaller"
actualSha256="$(sha256sum "$installerPath" | awk '{print $1}')"
if [[ "$actualSha256" != "$installerSha256" ]]; then
echo "WineSpeak installer failed its SHA-256 check."
for ((verificationAttempt = 1; verificationAttempt <= 3; verificationAttempt++)); do
download "$wineSpeakInstaller"
actualSha256="$(sha256sum "$installerPath" | awk '{print $1}')"
if [[ "$actualSha256" == "$installerSha256" ]]; then
break
fi
echo "WineSpeak installer failed its SHA-256 check (attempt ${verificationAttempt} of 3)."
rm -f "$installerPath"
return 1
fi
if ((verificationAttempt == 3)); then
return 1
fi
echo "Downloading WineSpeak again."
done
if ! wine "$installerPath" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-; then
echo "WineSpeak installer failed."