Skip to content

bug(windows): automatic updates may not be able to find downloaded packages when admin user is not same as current user #16360

Description

@mcdurdin

Kmshell -ikp is called, but does not pass any information about downloaded files. The admin user may not even have access to the files for the current user. So we need to consider, in this scenario, how to download and make the files accessible to the admin user.

procedure InstallingState.HandleInstallPackages;
var
ucr: TUpdateCheckResponse;
hasKeymanInstall : Boolean;
begin
TUpdateCheckStorage.LoadUpdateCacheData(ucr);
hasKeymanInstall := TUpdateCheckStorage.HasKeymanInstallFileUpdate(ucr);
// This event should only be reached in elevated process if not then
// move on to just installing Keyman
if not kmcom.SystemInfo.IsAdministrator then
begin
if hasKeymanInstall then
DoInstallKeyman;
Exit;
end;
if (TUpdateCheckStorage.LoadUpdateCacheData(ucr)) then
begin
DoInstallPackages(ucr);
end;
if hasKeymanInstall then
begin
DoInstallKeyman;
end
else
begin
// There is no Keyman installer we can return to the IdleState
bucStateContext.RemoveCachedFiles;
ChangeState(IdleState);
end;
end;

See also #16162, as this will also need to handle passing the baselayout setting to the elevated process.

Metadata

Metadata

Assignees

Type

Projects

Status
Todo

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions