First run event is actually called from the setup installation package
this means the setup file will be locked and will not be removed
by the first run event. Therefore we need to remove the cache files
in idle state when we get kmshell events. This seems excesive but we
need to do it for the reason explained.
Fixes: #14577
It became apparent that we need to abort the "waitingtorestart" state
before promting the user if they want to install. Otherwise it is
confusing as to why nothing happens and Keyman just starts.
In doing that it was easier to refactor ReadyToInstall to validate the
cache, and check that automatic updates was still set.
It can now also trigger an abort clearing the cache and returning to
idle. This has slight flow on effect in that the HandleKMShell event
can still be called following in the exectution flow.
Before prompting check if automatic updates has been turned
off in the time sitting in waiting for restart.
Also check it as we transition to waiting for restart in case
it was turned off while downloading.
Fixes:#14262
# Keyman Conventional Commit suggestions:
#
# - Link to a Sentry issue with git trailer:
# Fixes: _MODULE_-_ID_
# - Give credit to co-authors:
# Co-authored-by: _Name_ <_email_>
# - Use imperative, present tense ('attach' not 'attaches', 'attached' etc)
# - Don't include a period at the end of the title
# - Always include a blank line before trailers
# - More: https://github.com/keymanapp/keyman/wiki/Pull-Request-and-Commit-workflow-notes
When determining whether to move to the update available the
ucrsUpdateReady is now taken into account, not just the wucSuccess
flag. All the cases that check if there is Keyman installer file in
the metadata now check for this, and this was the original intent.
A two new function HasKeymanInstallFileUpdate and
CheckMetaDataForUpdate have been added to aid this check.
or stale. This commit adds a precondition check when entering the
Download state. It checks to see if the cache.json file still exists
then it checks if there are packages or installer files to download.
This will also check the version with ucrsUpdateReady, so if the
installed version is already newer it will not attempt the download.
If the check fails it will removed any cached files and return to
the idle state and check for updates.
Fixes: #13767
As this will also be seen when a user declines elevation
it is not really an error just breadcrumb incase there is
some actual error as a result.
fixes: #14066
If configuration is set to not automatically downloadupdates
and then from the configuration tab the check for update button is
clicked. If an update is found the upgrade statemachine is now in
state UpdateAvailable. If a updated keyman installer file is then
download direclty from keyman.com. Then installed by running the self
installer then on firstrun the statemachine will still be in the
UpdateState. This is should be fine, but it will be good to breadcrumb
incase we start to see some crashes on firstrun with this interaction.
The setup executable could modify the registry state directly but it is
cleaner to have the one master of the registry state value.
Fixes: #13771
The state machine method for Exiting a a state was overiding
the Delphi system Exit. This meant that any intended early returns
inside TState method where actually just calling the State.Exit
method then continuing execution within the method.
Fixes: 13831
Be more precise by matching the file name in the cache.json file
with the downloaded file in the cache folder. This will mean any
older installation versions that were not correctly cleaned up will
not be installed.
fixes#13831
# Keyman Conventional Commit suggestions:
#
# - Link to a Sentry issue with git trailer:
# Fixes: _MODULE_-_ID_
# - Give credit to co-authors:
# Co-authored-by: _Name_ <_email_>
# - Use imperative, present tense ('attach' not 'attaches', 'attached' etc)
# - Don't include a period at the end of the title
# - Always include a blank line before trailers
# - More: https://github.com/keymanapp/keyman/wiki/Pull-Request-and-Commit-workflow-notes
Using the KeymanMutex wrapper to check if a download process is occuring
if it isn't and we are in the downloading state this means the download
process exited early. We can then clean up any downloaded files and
reset the statemachine and check for updates again.
Check updates meaning has slightly changed it is now automatic updates
and it will now check, download and when possible start the install.
Previously it just meant a check for upates was made and notified
the user of updates.
Fixes:#13114
# Keyman Conventional Commit suggestions:
#
# - Link to a Sentry issue with git trailer:
# Fixes: _MODULE_-_ID_
# - Give credit to co-authors:
# Co-authored-by: _Name_ <_email_>
# - Use imperative, present tense ('attach' not 'attaches', 'attached' etc)
# - Don't include a period at the end of the title
# - Always include a blank line before trailers
# - More: https://github.com/keymanapp/keyman/wiki/Pull-Request-and-Commit-workflow-notes