feat(windows): review comment suggestions

Co-authored-by: Marc Durdin <marc@durdin.net>
This commit is contained in:
rc-swag 2024-11-05 11:33:18 +10:00 committed by GitHub
parent 544b955570
commit 7be490a67b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 11 deletions

View file

@ -12,9 +12,6 @@ uses
KeymanPaths, KeymanPaths,
OnlineUpdateCheck; OnlineUpdateCheck;
const
DaysBetweenCheckingForUpdates: Integer = 7; // Days between checking for updates
type type
TDownloadUpdateParams = record TDownloadUpdateParams = record
TotalSize: Integer; TotalSize: Integer;
@ -170,17 +167,13 @@ begin
begin begin
// TODO-WINDOWS-UPDATES: #10210 convert to error log. // TODO-WINDOWS-UPDATES: #10210 convert to error log.
LogMessage('DoDownloadUpdates Failed to download' + Params.InstallURL); LogMessage('DoDownloadUpdates Failed to download' + Params.InstallURL);
InstallerDownloaded := False;
end end
else else
begin begin
InstallerDownloaded := True; // If installer has downloaded that is success even
end; // if zero packages were downloaded.
// If installer has downloaded that is success even
// if zero packages where downloaded.
if InstallerDownloaded then
Result := True; Result := True;
end;
end; end;
function TDownloadUpdate.DownloadUpdates: Boolean; function TDownloadUpdate.DownloadUpdates: Boolean;

View file

@ -40,7 +40,7 @@ begin
if RegCreateKeyEx(HKEY_CURRENT_USER, PChar(SRegKey_KeymanEngine_CU), 0, NULL, KEY_ALL_ACCESS, NULL, &hk, NULL) = ERROR_SUCCESS then if RegCreateKeyEx(HKEY_CURRENT_USER, PChar(SRegKey_KeymanEngine_CU), 0, NULL, KEY_ALL_ACCESS, NULL, &hk, NULL) = ERROR_SUCCESS then
begin begin
try try
if RegSetValueEx(hk, PChar(SRegValue_Update_State), 0, REG_SZ, PWideChar(UpdateStr), Length(UpdateStr) * SizeOf(Char)) = ERROR_SUCCESS then if RegSetValueEx(hk, PChar(SRegValue_Update_State), 0, REG_SZ, PChar(UpdateStr), (Length(UpdateStr)+1) * SizeOf(Char)) = ERROR_SUCCESS then
begin begin
Result := True; Result := True;
end end