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