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
This commit is contained in:
rc-swag 2025-05-08 22:36:04 +10:00
parent f509d1c71a
commit 2e2ec28857

View file

@ -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;