Commit graph

3302 commits

Author SHA1 Message Date
Marc Durdin
fe986a2fda
Merge pull request #3818 from keymanapp/fix/developer/1584-incorrect-script-for-language
fix(developer): Incorrect script:language map
2020-11-05 13:11:09 +11:00
Marc Durdin
94a062f20a fix(developer): remove obsolete NRSIAllTags
Relates to #799.

Removes NRSIAllTags, alltags.txt, parser and utility units.

Also re-enables standardsdata.dpr unit test which needed some syntax
cleanup.
2020-11-04 18:41:17 +11:00
Marc Durdin
3c2857da51 fix(developer): Incorrect script:language map
Fixes #1584.

In the "Select BCP 47 Tag" dialog, when the user starts typing a
language tag, e.g. "hi" for Hindi, the "h" would match "ha" for Hausa,
and set the script to "Latn". When the "i" was then typed, the script
box would not be cleared, giving an incorrect result of "hi-Latn"
instead of just plain "hi".

The earlier issue of "yo-Brai" has already been resolved.
2020-11-04 15:01:21 +11:00
Marc Durdin
d8e70bea77 fix(developer): support for notany() and context()
This is part 1 of 2 of a fix for #917. This adds in version 14.0
targeting and a new function `KNO` which is used in one specific place:
when a context() statement references a notany() statement. This
minimizes any risk in this change because existing supported patterns
should compile identically.

If the compiler finds this pattern, it will enforce 14.0 minimum version
for web targets.
2020-11-04 13:49:48 +11:00
Marc Durdin
3be518ebd8
Merge pull request #3804 from keymanapp/fix/windows/3797-task-create-failure
fix(windows): Handle failure on task creation
2020-10-30 17:39:00 +11:00
Marc Durdin
fd5845a912
Merge pull request #3805 from keymanapp/fix/windows/3801-crash-installing-malformed-package
fix(windows): crash installing package with a race
2020-10-30 17:31:23 +11:00
Marc Durdin
9904ec5396
Merge pull request #3800 from keymanapp/fix/windows/3725-3783-keyboard-menu-sync
fix(windows): keyboard menu could get out of sync
2020-10-30 17:23:28 +11:00
Marc Durdin
1fac72cceb
Merge pull request #3799 from keymanapp/fix/windows/3798-profile-disable-enable-incorrect-langid
fix(windows): disabling/enabling a profile could have wrong association
2020-10-30 17:23:01 +11:00
Marc Durdin
38932b7173 chore(windows): address review issues 2020-10-30 17:05:57 +11:00
Marc Durdin
76f77857c5 fix(windows): crash installing package with a race
Fixes #3801.
Fixes #3802.
Fixes KEYMAN-WINDOWS-5M.
Fixes KEYMAN-WINDOWS-5N.

This is a two-part fix for Keyman Configuration where it appears there
was a race with creating a temporary file, and which caused a cascading
exception.

The first part resolves the race; the second part (in
UfrmInstallKeyboard.pas) adds a little extra robustness (probably not
totally necessary).
2020-10-30 16:52:17 +11:00
Marc Durdin
0aaea62b1c fix(windows): Handle failure on task creation
Fixes #3797.
Fixes KEYMAN-WINDOWS-5H.

Report unexpected errors creating or deleting scheduled task, and ignore
expected errors better, handling a potential race condition where two
processes both attempt to create a folder at the same time.

Note that creating the task should not be a race because we use the
`TASK_CREATE_OR_UPDATE` flag.
2020-10-30 15:47:43 +11:00
Marc Durdin
baff142d8b
Merge pull request #3793 from keymanapp/fix/windows/3689-cleanup-setup-action-list
fix(windows): cleanup setup action list
2020-10-30 14:27:31 +11:00
Marc Durdin
66b6baf223
Merge pull request #3792 from keymanapp/fix/windows/3689-bootstrap-progress
fix(windows): show bootstrap progress in setup
2020-10-30 14:26:56 +11:00
Marc Durdin
71d42b2580
Merge pull request #3794 from keymanapp/fix/windows/3689-install-location-choice
fix(windows): setup now allows choice of source
2020-10-30 14:26:32 +11:00
Marc Durdin
99e44d030a fix(windows): keyboard menu could get out of sync
Fixes #3725.
Fixed #3783.

In some situations, the keyboard menu would either display empty or
would not refresh to get all installed keyboards.
2020-10-30 14:22:20 +11:00
Marc Durdin
5a4287a68d fix(windows): disabling/enabling a profile could have wrong association
Transient language profiles would get the wrong language association
when they were disabled and re-enabled.

Fixes #3798.
2020-10-30 14:20:00 +11:00
Marc Durdin
704efc65d1 chore: cleanup delphi parser garbage in dproj 2020-10-29 16:04:04 +11:00
Marc Durdin
90dd2bc08b fix(windows): fix test dependency 2020-10-29 15:57:47 +11:00
Marc Durdin
add8f1e5e2 fix(windows): cleanup setup action list
If the list of actions that Setup will perform is too long, a scrollbar
will now be shown. This will probably not arise frequently but certainly
helps if it does.

Fixes #3689.
2020-10-29 15:45:25 +11:00
Marc Durdin
b16a7ab77c fix(windows): tweaks to progress dialog 2020-10-29 15:44:58 +11:00
Marc Durdin
873abda526 fix(windows): show bootstrap progress in setup
When Setup is starting, it can sometimes take a few seconds to show the
main form because it is querying an online server and unzipping various
files. This shows a small progress bar window so that the user doesn't
wonder what is going on.

The progress bar is fairly basic: it has only 4 steps, and because all
actions are happening on the main thread, does not animate well or
smoothly. In my view, it is not worth redesigning into a multi-threaded
process for the sake of this progress bar dialog.

Relates to #3689.
2020-10-29 15:44:57 +11:00
Marc Durdin
d0a63d2b88 fix(windows): fix test dependency 2020-10-29 15:43:46 +11:00
Marc Durdin
3415724966 fix(windows): setup now allows choice of source
Where more than one source of a file is available, e.g. a local
keymandesktop.msi which is older than the current published version
online, then Setup will choose the newer, online version by default,
but allows the user to change the install source in the Options dialog
to have an offline setup if they prefer.

This means that the 'best' location is now chosen at startup, and then
the user can override that.

Relates to #3689.
2020-10-29 11:18:25 +11:00
Marc Durdin
18a7134378 fix(windows): cleanup setup.inf processing
There were a number of obsolete values in setup.inf, and removing those
led to a small cascade of changes:

1. `MSIOptions` and `Version` properties were removed.
2. `Version` is now read directly from the .msi if it is present.
3. Package name and version are now read directly from local .kmp files,
   rather than relying on metadata in setup.inf.
4. Setup now only loads .kmp files that are referenced in setup.inf, to
   avoid scenarios where a user downloads the installer into a common
   location that already includes .kmp files and is then confused by
   why it is offering to install those files as well.
5. `Strings` property is not used outside of `TInstallInfo`.
2020-10-29 09:23:21 +11:00
Marc Durdin
d8e8aaa1d5 fix(windows): CompareVersions sometimes returned wrong value
If version1 was longer than version2, then CompareVersions would return
the inverse value. This issue has been present for a long, long time...
2020-10-29 09:21:12 +11:00
Marc Durdin
93d0935068
Merge pull request #3781 from keymanapp/fix/windows/3775-error-reading-kmp-inf-in-setup
fix(windows): error reading kmp.inf in setup
2020-10-29 06:43:56 +11:00
Marc Durdin
4b970fefbf
Merge pull request #3779 from keymanapp/fix/windows/3650-remove-msctf-dllmain-free
fix(windows): remove msctf free from DllMain
2020-10-29 06:43:49 +11:00
Marc Durdin
3178495e58
Merge pull request #3772 from keymanapp/fix/windows/3562-start-keyman-on-demand-keyman32
fix(windows): Start Keyman on Demand - keyman32
2020-10-29 06:43:42 +11:00
Marc Durdin
6015000492 fix(windows): error reading kmp.inf in setup
Fixes #3775.
2020-10-28 17:22:16 +11:00
Marc Durdin
fc7b51c4ca fix(windows): remove msctf free from DllMain
Fixes #3650.

This removes the bad call to `FreeLibrary` that was still present in
a callee of `DllMain` in keyman32. The refactor moves responsibility for
loading TSF to the `SelectKeyboard` functions and gets rid of the
associated thread globals.

The `TSFINTERFACES` struct is of course a future candidate for a class.

In the process I removed a lot of cruft from keyman32.cpp which was
either obsolete, irrelevant or just plain wrong. None of which had
material impact on the running code.
2020-10-28 16:17:52 +11:00
Marc Durdin
3e9f397b27 chore(windows): small cleanups
1. Remove unused variables
2. Remove invalid build configurations
3. Move hotkey checks before touch keyboard panel check, so hotkeys
   still work when touch panel is active; the touch keyboard panel check
   is there to disable serialised input which conflicts with it.
2020-10-28 10:27:24 +11:00
Marc Durdin
b66915bcd0 chore: code cleanup 2020-10-28 10:12:07 +11:00
Marc Durdin
c9f9bfb2c2 fix(windows): Start Keyman on Demand - tasks
Fixes #3562.

Second part of the two-part special with #3772. When Keyman
Configuration starts, it creates a task that is launched whenever a
specific Keyman event with id 256 is added to the Event Log. This task
launches keyman.exe to start Keyman (and if Keyman is already running,
the newly launched process will exit with no side effects).

This feature is behind a new feature flag `Flag_UseAutoStartTask`, so it
can be disabled in the event of compatibility issues.

The task is created or updated on each launch of Keyman Configuration
(or Keyman via the 'Keyman' shortcut in the Start Menu), and is
intended to be self-maintaining.

The test_starttask project (4 of the 12 files) is just a wrapper around
the start TKeymanStartTask class to allow for manual testing. No unit
tests for this at this time; I think it would be difficult to unit test
this effectively.
2020-10-28 08:16:38 +11:00
Marc Durdin
e8d3a0eb14 fix(windows): exclude keymanmc from sigcheck 2020-10-28 08:15:24 +11:00
Marc Durdin
c66eb49163 fix(windows): Start Keyman on Demand - keyman32
This is the first half of a two-part update to Keyman for Windows. There
are two significant changes here. These changes apply to
keyman32/keyman64, as well as kmtip/kmtip64, but will refer to the
32-bit equivalents for simplicity:

1. Instead of using `GetProcAddress` to connect to keyman32.dll, we
   now have an import library connection. This removes one particularly
   suspect piece of architecture for Keyman, as using `GetProcAddress`
   could lead to a race condition, where keyman32.dll is unloaded after
   that function is called but before we use the handle. This makes the
   kmtip.dll build dependent on keyman32.dll; loading kmtip.dll (by
   selecting a Keyman input method) also loads keyman32.dll.

2. It's not enough (yet) to load kmtip.dll. We also need to be running
   keyman.exe itself, due to global hooks that we still require (it may
   be possible, one day, to avoid these, but it doesn't look very
   hopeful). To that end, kmtip calls new function `TIPIsKeymanRunning`
   to check whether keyman32.dll is initialised (and hence keyman.exe
   has initialised it). Then, if keyman.exe is not running, it issues an
   event to the Windows Event Log, which we will pick up with a
   scheduled task in the next PR.

The first part of this is an architectural change which may lead to some
change in behaviours, as keyman32.dll now may not be unloaded from a
process when keyman.exe exits, due to the lock that kmtip.dll now has on
it. It will be important to test this (@MakaraSok) by running through
various startup and shutdown scenarios. In my initial testing, I found
that there were some situations after restarting keyman.exe where I
needed to switch in and out of the Keyman TIP, but those were not all
critical.

This change also lays groundwork for an eventual ability to run the
Keyman input method without keyman.exe running, which will be helpful
e.g. on login screen, even if missing certain additional functionality
such as the serialised input queue.
2020-10-28 06:10:22 +11:00
Marc Durdin
f7ab5def7b
Merge pull request #3766 from keymanapp/fix/windows/3750-language-list-bugs
fix(windows): Fix multiple issues with UI locales
2020-10-27 13:10:11 +11:00
Marc Durdin
9389152f19
Merge pull request #3763 from keymanapp/fix/windows/3756-keep-in-touch-link-crash
fix(windows): Crash in Keep in Touch external link
2020-10-27 13:09:58 +11:00
Marc Durdin
9988b0fd01
Merge branch 'master' into fix/windows/3750-language-list-bugs 2020-10-27 13:09:51 +11:00
Marc Durdin
b6f0449710
Merge pull request #3764 from keymanapp/fix/windows/community-button
fix(windows): Community button had wrong link
2020-10-27 13:09:10 +11:00
Marc Durdin
2a50bb107e
Merge branch 'master' into fix/windows/3756-keep-in-touch-link-crash 2020-10-27 13:08:58 +11:00
Marc Durdin
4c44296f0a
Merge pull request #3761 from keymanapp/fix/windows/3393-online-update-url
fix(windows): use new windows url for online update check
2020-10-27 13:07:55 +11:00
Marc Durdin
86b9af388a
Merge pull request #3760 from keymanapp/fix/windows/3755-question-in-title-bar
fix(windows): Make help button work
2020-10-27 13:07:35 +11:00
Marc Durdin
7a722639bb
Merge pull request #3753 from keymanapp/fix/windows/3518-config-auto-apply
fix(windows): Keyman Configuration changes apply instantly
2020-10-27 13:07:26 +11:00
Marc Durdin
79b41d0627
Merge pull request #3754 from keymanapp/fix/windows/remove-double-refresh
fix(windows): Remove double refresh
2020-10-27 10:38:25 +11:00
Marc Durdin
186cf0cf23 fix(windows): menu interactions 2020-10-27 10:35:55 +11:00
Marc Durdin
27850864cf fix(windows): config would not refresh correctly
As some of config state was cached, it would not refresh correctly
when displaying. This ensures that the config renderer uses its
own new instance of the COM API data on every refresh.
2020-10-27 10:16:53 +11:00
Marc Durdin
5831776709 fix(windows): template would never read primary locale
The template still referred to the old locale.xml format.
2020-10-27 10:15:28 +11:00
Marc Durdin
4dc171e934 fix(windows): remove unsupported loading locale from package
Locales will be distributed as part of the app, for now. We may
re-introduce package-based locales in the future, across all platforms.
2020-10-27 09:57:49 +11:00
Marc Durdin
5ea49ecb38 fix(windows): validation of locales
Locale files now use a resources tag, not a Locale tag; the validation
was treating all locales as invalid due to this.
2020-10-27 09:57:01 +11:00
Marc Durdin
6ffdce8dae fix(windows): Community button had wrong link 2020-10-27 08:29:30 +11:00