-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(windows): add boot switch #12995
Conversation
This updates the registry entry or run on start up and the switch to initprog. TODO is to actually process the switch correctly when set.
User Test Results |
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.
Test ResultsI tested this issue with the attached "18.0.175-alpha-test-12995" build(28/01/2025) on Windows 10 and Windows 11. I'm sharing my observation here.
|
@@ -451,14 +453,14 @@ procedure RunKMCOM(FMode: TKMShellMode; KeyboardFileNames: TStrings; FSilent, FF | |||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right? Previously, we used -s
as the boot switch, which meant FSilent = True
. So I don't think fmBoot
should be checking TIP install status?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because we were overloading the -s to use it for boot which wasn't a perfect match. For boot we wanted -s to supress splash screen or configuration. but checking the DoCheckTIPInstallStatus?
I have changed it back. DoCheckTIPInstallStatus does nothing anyway as it is all commented out. DoCheckTIPInstallStatus
I have created an issue to investigate cleaning this up. #13100
@@ -323,7 +323,7 @@ procedure TUtilKeymanOptionEntry.CustomSave; | |||
if OpenKey('\'+SRegKey_WindowsRun_CU, True) then | |||
begin | |||
if FBoolValue then | |||
WriteString(SRegValue_WindowsRun_Keyman, '"'+TKeymanPaths.KeymanDesktopInstallPath(TKeymanPaths.S_KMShell)+'" -s') | |||
WriteString(SRegValue_WindowsRun_Keyman, '"'+TKeymanPaths.KeymanDesktopInstallPath(TKeymanPaths.S_KMShell)+'" -boot') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to reapply the -boot
flag to the setting when we upgrade from an earlier version of Keyman? AFAICT, the registry setting is not rewritten during the upgrade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I read it is that RunTools.PrepareForReboot
Deletes the key SRegValue_WindowsRun_Keyman
.
// Delete the Keyman autostart; it will be reinstated when setup finishes
Then it is setup again with firstrun
via the options being passed through the command line ..... and the those options being applied. I didn't step all the way through.
I will add a test to this attaching an old build with the -s then have it be upgraded with this PR build
Test ResultsI tested this issue with the attached "Keyman-18.0.175-alpha-test-12995" build(30/01/2025) on Windows 10. I'm sharing my observation here.
|
Changes in this pull request will be available for download in Keyman version 18.0.182-alpha |
Fixes: #12994
This updates the registry entry run on start-up to use
-boot
, add the-boot
switchto initprog. The fmBoot option code allows update state machine code so that
on boot a prompt can let the user the new update is about to install.
User Testing
TEST_BOOT_SWITCH_POP UP
Options tab
WinR type regedit Go the current user key
update state
Press F5 to keep it refreshing it.
The state will go to
usDownloading
tousInstalling
at the same time keep checking theUpdateCache
folder.install
andclose
.TEST_ON_STARTUP_UPDATED
I wasn't able to attach an older build but you can install the build from PR #12956 or even the latest version 17 from Keyman.com
2. Open Keyman Configuration and check
Start with Windows option
2. Open the regedit window
WinR type regedit Go the current key Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Keyman
3. Observe that is
"C:\Program Files (x86)\Keyman\Keyman Desktop\kmshell.exe" -s
4. Download the Keyman for windows attached to this PR.
5. Double-click on the file to install it. Ensure you choose the install options and select the 18.0.175-alpha-test-12995
6. The setup will ask you to reboot the computer to continue installing. Once rebooted and the installing is complete.
7. Open the regedit window
WinR type regedit Go the current key Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Keyman
8. Observe that is
"C:\Program Files (x86)\Keyman\Keyman Desktop\kmshell.exe" -boot