From 2e2ec288578911e86dc2bfd3459dd5a2689f4a2b Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Thu, 8 May 2025 22:36:04 +1000 Subject: [PATCH] fix(windows): use json file name against cache folder Be more precise by matching the file name in the cache.json file with the downloaded file in the cache folder. This will mean any older installation versions that were not correctly cleaned up will not be installed. fixes #13831 --- .../kmshell/main/Keyman.System.UpdateStateMachine.pas | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/windows/src/desktop/kmshell/main/Keyman.System.UpdateStateMachine.pas b/windows/src/desktop/kmshell/main/Keyman.System.UpdateStateMachine.pas index a6cf9bd2e5..9fc6a24789 100644 --- a/windows/src/desktop/kmshell/main/Keyman.System.UpdateStateMachine.pas +++ b/windows/src/desktop/kmshell/main/Keyman.System.UpdateStateMachine.pas @@ -1010,19 +1010,20 @@ function InstallingState.DoInstallKeyman: Boolean; var FResult: Boolean; SavePath: String; - fileExt: String; FileName: String; FileNames: TStringDynArray; + ucr: TUpdateCheckResponse; + ucrFileName: String; found: Boolean; begin - + TUpdateCheckStorage.LoadUpdateCacheData(ucr); + ucrFileName := ucr.FileName; SavePath := IncludeTrailingPathDelimiter(TKeymanPaths.KeymanUpdateCachePath); GetFileNamesInDirectory(SavePath, FileNames); found := False; for FileName in FileNames do begin - fileExt := LowerCase(ExtractFileExt(FileName)); - if fileExt = '.exe' then + if ucrFileName = ExtractFileName(FileName) then begin found := True; break;