fix(sql): Forzar reinicio mandatorio tras parche de registro InstallLanguage

This commit is contained in:
Ricardo Monla
2026-02-26 11:23:29 -03:00
parent 8a834a3507
commit 3fe5fed7a0
+20 -31
View File
@@ -13,42 +13,31 @@ Log-Msg "INYECTANDO PARCHES DE REGISTRO PROFUNDOS PARA IDIOMA (SPAIN-3082 / 0C0A
Log-Msg "==========================================================" Log-Msg "=========================================================="
# SQL Server en Server Core chequea estrictamente estas claves del registro para el 'LanguageMismatch' # SQL Server en Server Core chequea estrictamente estas claves del registro para el 'LanguageMismatch'
try { $installLang = (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name "InstallLanguage").InstallLanguage
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name "InstallLanguage" -Value "0C0A" if ($installLang -ne "0C0A") {
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name "Default" -Value "0C0A" try {
Log-Msg "Claves de registro de Idioma parcheadas a 0C0A (Espanol)." Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name "InstallLanguage" -Value "0C0A"
} catch { Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name "Default" -Value "0C0A"
Log-Msg "Fallo al inyectar claves de registro: $_" Set-WinSystemLocale -SystemLocale es-ES
Set-WinUserLanguageList -LanguageList es-ES -Force
Log-Msg "Claves de registro de Idioma inyectadas a 0C0A (Espanol)."
Log-Msg "REINICIO OBLIGATORIO DETECTADO. El OS necesita reiniciar para volcar el registro a RAM."
Log-Msg "Reiniciando servidor DB01 en 3 segundos..."
Log-Msg "Operador: Cuando la maquina virtual haya vuelto, ejecuta el C2 Launcher de nuevo."
Start-Sleep -Seconds 3
Restart-Computer -Force
exit
} catch {
Log-Msg "Fallo al inyectar claves de registro obligatorias: $_"
}
} }
$locale = Get-WinSystemLocale $locale = Get-WinSystemLocale
if ($locale.Name -ne "es-ES") {
if (Test-Path "C:\reboot_pending.txt") { exit }
Set-Content -Path "C:\reboot_pending.txt" -Value "Yes"
Log-Msg "=========================================================="
Log-Msg "SISTEMA INCOMPATIBLE CONFIRMADO: OS = $($locale.Name), SQL ISO = ESN (es-ES)."
Log-Msg "APLICANDO PARCHE DE COMPATIBILIDAD (en-US -> es-ES)..."
Log-Msg "=========================================================="
Set-WinSystemLocale -SystemLocale es-ES
Set-WinUserLanguageList -LanguageList es-ES -Force
Set-WinUILanguageOverride -Language es-ES -ErrorAction SilentlyContinue
Log-Msg "Parche inyectado. REINICIANDO EL SERVIDOR DB01 en 3 segundos..."
Log-Msg "Operador: El servidor se reiniciara, el VNC se caera temporalmente. Al volver, reconecta y ejecuta el C2 Launcher de nuevo."
Start-Sleep -Seconds 3
Restart-Computer -Force
exit
}
if (Test-Path "C:\reboot_pending.txt") {
Remove-Item "C:\reboot_pending.txt" -Force -ErrorAction SilentlyContinue
}
Log-Msg "==========================================================" Log-Msg "=========================================================="
Log-Msg "SISTEMA COMPATIBLE ($($locale.Name)). PROCEDIENDO CON INSTALACION SQL." Log-Msg "SISTEMA COMPATIBLE ($($locale.Name) / 0C0A). PROCEDIENDO CON INSTALACION SQL."
Log-Msg "==========================================================" Log-Msg "=========================================================="
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0 Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0