spiegel-keyman/windows/src/unit-tests/windows-setup
Marc Durdin c3b70d0186 fix(windows): setup must save install start for restarts
Fixes #4467.

Background: in some scenarios, e.g. files in use, Setup must restart
before it completes. This is particularly the case if kmcomapi.dll is
locked and Windows will move the new version into place after a restart.
In this scenario, we would end up calling the old version of
kmcomapi.dll to install keyboards, etc, which is definitely not
desirable.

Problem: Setup was not saving complete state before the restart, so when
it resumed post-restart, would get a blank slate to work from, losing
command-line options passed in and any choices that the end user may
have made during the installation.

Fix: This PR adds serialization of the `TInstallInfo` state data, so
that the install state can be saved to disk before restart, and reloaded
after the restart. This also means that the `-c` parameter now takes a
filename, being the temporary state JSON file, and when in
"ContinueSetup" mode, no longer needs to perform all the checks it did
previously, making the second half of Setup somewhat faster.

Testing: Added a unit test for the serialization of `TInstallInfo`, and
have tested on a VM in various scenarios without problems.

This fix is somewhat broader than I really like to make while in Beta,
but I don't think there was a viable alternative.
2021-03-11 15:15:26 +11:00
..
Keyman.System.Test.InstallInfoTest.pas fix(windows): setup must save install start for restarts 2021-03-11 15:15:26 +11:00
Makefile feat(windows): strip ' (1)' from filename in setup 2020-07-20 08:32:33 +10:00
WindowsSetupTest.dpr fix(windows): fix test dependency 2020-10-29 15:57:47 +11:00
WindowsSetupTest.dproj fix(windows): fix test dependency 2020-10-29 15:57:47 +11:00
WindowsSetupTest.res feat(windows): strip ' (1)' from filename in setup 2020-07-20 08:32:33 +10:00