build/windows: Auto repair Inno langs if .ps1 script is interrupted

027013c7 was fine but not good enough. Without this new commit,
if you stop the script after touching the Inno lang files and run
the script again it would not restore the patched lang files so
patch over patch, producing something like "GIMP 3.0.0 3.0.0".

So, this new commit identifies if the script wasn't completed and
repair Inno installation before applying the patches again.
This commit is contained in:
Bruno 2024-11-17 11:18:39 -03:00
parent a9056419ce
commit f0fb443553
No known key found for this signature in database

View file

@ -26,10 +26,16 @@ Invoke-WebRequest https://jrsoftware.org/download.php/is.exe -OutFile ..\is.exe
$inno_version_downloaded = (Get-Item ..\is.exe).VersionInfo.ProductVersion -replace ' ',''
## Install or Update Inno
$broken_inno = Get-ChildItem $Env:Tmp -Filter *.isl.bak -ErrorAction SilentlyContinue
$inno_version = Get-ItemProperty Registry::'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup*' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty DisplayVersion
if ("$inno_version" -ne "$inno_version_downloaded")
if ("$broken_inno" -or "$inno_version" -ne "$inno_version_downloaded")
{
if ("$inno_version" -notlike "*.*")
if ("$broken_inno")
{
Write-Output '(INFO): repairing Inno'
$broken_inno | Remove-Item -Recurse
}
elseif ("$inno_version" -notlike "*.*")
{
Write-Output '(INFO): installing Inno'
}