Commit graph

17 commits

Author SHA1 Message Date
Marc Durdin
40cdd49c28 fix(windows): setup handle whitespace in setup.inf 2023-11-14 12:47:13 +07:00
Marc Durdin
35c82ea128 fix(windows): handle invalid package names during install
Fixes #4886.

This patch includes 5 separate fixes for the various scenarios we
encountered during package installation.

1. RunTools.pas: don't attempt to install TIPs if package is not also
   being installed.

2. Keyman.Setup.System.OnlineResourceCheck.pas, OnlineUpdateCheck.pas:
   handle online update check for packages with spaces or periods in the
   id (legacy packages only).

3. Keyman.Setup.System.InstallInfo.pas: Handle browsers renaming
   downloaded files with `(n)` and `[n]` patterns as well as the current
   ` (n)` pattern.

4. Keyman.Setup.System.InstallInfo.pas: Handle browsers renaming
   downloaded files with `_n` pattern. See code comments for details.

5. Keyman.Configuration.System.TIPMaintenance.pas: Avoid crashing if
   `kmshell -install-tips-for-packages` is passed an invalid package
   name.

The crash is actually fixed in point 5 above, but the root causes are
addressed in the other points.
2021-04-19 08:25:31 +10:00
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
Marc Durdin
d6290e6373 fix(windows): Show full version with tag in Setup
Fixes #4041.

Show the version with tier and build flags in Setup so that it is clear
which version of Keyman will be installed, as the Keyman version can be
distinct from the setup.exe version.

Constructs the version tag from version+stability data in the
UpdateCheckResponse and uses a new MSI property called VersionWithTag
for Windows Installers. Older MSIs will still show a.b.c.d versions
instead of the tagged version if they are checked locally (as opposed to
online), because the new VersionWithTag property will not be present.
2020-12-17 15:01:37 +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
6015000492 fix(windows): error reading kmp.inf in setup
Fixes #3775.
2020-10-28 17:22:16 +11:00
Marc Durdin
89e27dc226 chore(windows): cleanup code 2020-08-03 11:18:51 +10:00
Marc Durdin
d71ae718e6 feat(windows): i18n for Setup 2020-08-03 10:56:27 +10:00
Marc Durdin
d569e7880d feat(windows): setup select tier from filename or parameter 2020-07-20 09:23:57 +10:00
Marc Durdin
717a86257a feat(windows): strip ' (1)' from filename in setup 2020-07-20 08:32:33 +10:00
Marc Durdin
72b526d302 fix: remove large dependencies
Setup had some large dependencies which were little needed.
Refactored to remove those and replace with only what we use.
2020-07-14 07:21:06 +10:00
Marc Durdin
4cbaca5c3e chore(windows): code cleanup
Fixup constant strings; remove old dependencies; add update param
2020-07-08 11:05:52 +10:00
Marc Durdin
d1fb87a6f9 chore: cleanup 2020-07-06 15:18:00 +10:00
Marc Durdin
08f9f30b95 fix: temp path and download api params 2020-07-04 07:22:45 +10:00
Marc Durdin
a0c0141092 feat: more work towards bootstrap 2020-07-03 13:42:12 +10:00
Marc Durdin
268ec6ce3c feat(windows): Keyman Setup online bootstrap
This starts the refactoring of Keyman Setup for Windows
for a more online-first bootstrap approach for bundling.
For users who are offline, the traditional bundled approach
works, as does throwing package files into the same folder
as setup.exe. This makes the whole installer much simpler
to deploy and test.

At this stage, there are a lot of rough edges, so need to
refine these, including setup strings, language choices,
and error and logging management.
2020-07-01 20:59:25 +10:00