fix(windows): config frm result used to close splash

The Configuration window will return a mrAbort result when we want
the Splash screen to close. This is in the case the Installation
now has been selected.
This commit is contained in:
rc-swag 2026-01-06 10:39:54 +10:00
parent aa3e6567f7
commit 10f1e2470e
4 changed files with 24 additions and 8 deletions

View file

@ -30,7 +30,7 @@ type
*)
function DoDownloadUpdates(SavePath: string; Params: TUpdateCheckResponse): Boolean;
// pseduo code name this something more appropriate
procedure MyEventHandler(const Message: string; Position: Int64; Total: Int64);
//procedure MyEventHandler(const Message: string; Position: Int64; Total: Int64);
public
@ -102,7 +102,7 @@ var
http.Request.Agent := API_UserAgent;
http.Request.SetURL(url);
http.OnStatus := myeventhandler;
//http.OnStatus := myeventhandler;
http.Upload;
if http.Response.StatusCode = 200 then
begin

View file

@ -842,7 +842,9 @@ begin
'TrmfMain: Shell Execute Update_ApplyNow Failed')
else
ModalResult := mrAbort; // look into the most appropiate
// Application.Terminate;
// Maybe mrYes and mrNo. What we are after is that if we have a splash screen
// open when Install Now has run we want the result be value that the splash
// screen will be closed.
end;
end;

View file

@ -70,7 +70,7 @@ uses
Windows, Controls, SysUtils, Classes, ErrorControlledRegistry, Forms, MessageIdentifiers, MessageIdentifierConsts, keymanapi_TLB;
procedure Run;
procedure Main(Owner: TComponent = nil);
function Main(Owner: TComponent = nil): Integer;
type
@ -164,7 +164,7 @@ procedure ShowKeyboardWelcome(PackageName: WideString); forward; // I2569
procedure PrintKeyboard(KeyboardName: WideString); forward; // I2329
function ProcessBackgroundUpdate(FMode: TKMShellMode; FSilent: Boolean): Boolean; forward;
procedure Main(Owner: TComponent = nil);
function Main(Owner: TComponent = nil): Integer;
var
frmMain: TfrmMain;
begin

View file

@ -139,6 +139,8 @@ begin
end;
procedure TfrmSplash.WMUser_FormShown(var Message: TMessage);
var
configFrmResult: Integer;
begin
if (GetForegroundWindow <> Handle) and
(GetWindowThreadProcessId(GetForegroundWindow) <> GetCurrentThreadId) then // I3730
@ -152,15 +154,27 @@ begin
if FShowConfigurationOnLoad then
begin
Main(Self);
Do_Content_Render;
configFrmResult := Main(Self);
if configFrmResult = mrAbort then
Command_Exit
else
Do_Content_Render;
end;
end;
procedure TfrmSplash.FireCommand(const command: WideString; params: TStringList);
var
configFrmResult: Integer;
begin
if command = 'start' then Command_Start
else if command = 'config' then begin Main(Self); Do_Content_Render; end // I4393 // I4396
else if command = 'config' then
begin
configFrmResult := Main(Self);
if configFrmResult = mrAbort then
Command_Exit
else
Do_Content_Render;
end // I4393 // I4396
else if command = 'hidesplash' then FShouldDisplay := False
else if command = 'showsplash' then FShouldDisplay := True
else if command = 'exit' then Command_Exit