From 27bf5355c50e1e027c80b79f62bf64c1cf7c09c5 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Tue, 28 Jan 2025 22:51:04 +1000 Subject: [PATCH] feat(windows): add fmBoot option Add fmBoot option code and update state machine code so that on boot a prompt can let the user the new update is about to install. --- windows/src/desktop/kmshell/main/initprog.pas | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/windows/src/desktop/kmshell/main/initprog.pas b/windows/src/desktop/kmshell/main/initprog.pas index 9d573b9be1..e4002d5a31 100644 --- a/windows/src/desktop/kmshell/main/initprog.pas +++ b/windows/src/desktop/kmshell/main/initprog.pas @@ -233,7 +233,7 @@ begin // package installation. See https://superuser.com/a/1395288/521575 and // https://github.com/keymanapp/keyman/issues/2467 else if s = '-f' then FForce := True - else if s = '-boot' then FMode := fmBoot + else if s = '-boot' then FMode := fmBoot else if s = '-c' then FMode := fmMain else if s = '-m' then FMode := fmMigrate else if s = '-i' then FMode := fmInstall @@ -453,14 +453,14 @@ begin Exit; end; - if not FSilent and (FMode in [fmStart, fmSplash, fmMain, fmAbout]) then // I4773 + if not FSilent and (FMode in [fmStart, fmSplash, fmMain, fmAbout, fmBoot]) then // I4773 begin DoCheckTIPInstallStatus(False); end; // I1818 - remove start mode change - if FMode = fmStart then FIcon := 'appicon.ico' + if (FMode in [fmStart, fmBoot]) then FIcon := 'appicon.ico' else FIcon := 'cfgicon.ico'; FIcon := GetDebugPath(FIcon, ExtractFilePath(ParamStr(0)) + FIcon, False); @@ -511,6 +511,11 @@ begin ////TODO: TUtilExecute.Shell(PChar('hh.exe mk:@MSITStore:'+ExtractFilePath(KMShellExe)+'keyman.chm::/context/keyman_usage.html'), SW_SHOWNORMAL); + fmBoot: + begin + // on boot splash should be suppressed therefore Silent = True + StartKeyman(False, True, FStartWithConfiguration); + end; fmStart: begin // I2720 StartKeyman(False, FSilent, FStartWithConfiguration); @@ -701,8 +706,8 @@ begin // UI elements from the state machine we have bring some of logic here. UserCanceled := False; if BUpdateSM.ReadyToInstall and - (not FSilent and (FMode in [fmStart, fmSplash, fmMain, fmAbout, fmHelp, - fmShowHelp, fmSettings])) then + (not FSilent and (FMode in [fmStart, fmSplash, fmMain, fmAbout, + fmHelp, fmShowHelp, fmSettings, fmBoot])) then begin frmStartInstall := TfrmStartInstall.Create(nil); try