spiegel-keyman/windows/src
2020-02-26 21:01:08 +07:00
..
buildtools chore(windows): use new version infrastructure 2020-01-29 09:59:50 +11:00
desktop Merge branch 'master' into chore/beta-to-master-p9s2-final 2020-02-19 14:35:29 +11:00
developer Merge pull request #2739 from keymanapp/fix/developer/2730-smp-in-debugger-splits-on-bksp 2020-02-26 21:01:08 +07:00
engine fix(developer): touch layout editor character map integration 2020-02-11 09:04:22 +11:00
ext feat(developer): Add QRCode for debugger url 2019-12-08 18:14:31 +00:00
global feat(developer): always save options 2020-02-25 23:51:07 +07:00
support feat(developer): add kmdecomp 2019-12-05 11:02:27 +01:00
test Merge branch 'master' into fix/developer/1448-zero-length-store-names 2019-12-12 07:26:08 +11:00
unit-tests fix(developer): tweak unit test path 2019-11-29 15:14:01 +00:00
.gitignore chore: cleanup gitignore 2019-11-30 07:14:21 +00:00
_make.bat Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121) 2017-07-25 10:53:06 +07:00
components.groupproj Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121) 2017-07-25 10:53:06 +07:00
Defines.mak chore(windows): use new version infrastructure 2020-01-29 09:59:50 +11:00
docopy.bat Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121) 2017-07-25 10:53:06 +07:00
edithistory.txt Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121) 2017-07-25 10:53:06 +07:00
Header.mak [Windows] Refactor version.txt to use constant templates and avoid needing to update with major version changes 2019-10-21 05:54:15 +07:00
header_format.txt Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121) 2017-07-25 10:53:06 +07:00
header_template.txt Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121) 2017-07-25 10:53:06 +07:00
LICENSE.md Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121) 2017-07-25 10:53:06 +07:00
Makefile chore: address review comments 2020-01-31 20:01:46 +11:00
nightly_patchbuild.bat Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121) 2017-07-25 10:53:06 +07:00
README.md docs(windows): Tweak Delphi version references 2019-10-25 21:14:32 +07:00
set-release-version.bat Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121) 2017-07-25 10:53:06 +07:00
Target.mak [Windows] Add version.rc and manifest.xml to def-clean target 2019-10-24 06:30:17 +07:00
versionhistory.txt Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121) 2017-07-25 10:53:06 +07:00

Keyman Desktop and Keyman Developer

Build Prerequisites

  1. Install VS2017 Community Edition.
  2. Install Delphi 10.2 or Delphi 10.3.
  3. Install git.
  4. Install nodejs.
  5. Follow steps in /web/README.md to install prerequisites for building KeymanWeb (included in Keyman Developer)
  6. Add the Keyman root folder to antivirus exclusions for performance and file lock reasons (optional - but highly recommended).
  7. Start Delphi IDE once after installation to create default environment files and ensure registration is complete.
  8. Set environment variables per notes below: KEYMAN_ROOT, USERDEFINES, GIT_BASH_FOR_KEYMAN.
  9. Add the windows/lib folder in the Keyman repository to your PATH environment variable (required for packages in Delphi).
  10. In order to run Keyman Developer in the development build, you need to specify where the https://github.com/keymanapp/CEF4Delphi_binary repo is on your system, with the registry setting HKCU\Software\Keyman\Debug, Debug_CEFPath.

Release build prerequisites

For local development you do not need to perform a release build so these are optional.

  1. Install 7-Zip 64-bit (or 32-bit on x86 Windows). 7-Zip is used for archiving build files -- may be eliminated in future.
  2. Install HTML Help Workshop.
  3. Install WiX 3.11.1 to C:\Program Files (x86)\WiX Toolset v3.11.
  4. Add the environment variable KEYMAN_CEF4DELPHI_ROOT.

Building Keyman Desktop and Keyman Developer

  1. Start 'x64_x86 Cross Tools Command Prompt for VS 2017'.
  2. Run make build from the windows/src folder.
  3. Artifacts from a successful build will be placed in windows/bin folder.

Note: running make build will currently reset the packages and path settings in your Delphi environment. If you use Delphi for other projects, you should consider building Keyman under a login user dedicated to it, or in a VM.

Type make to see build targets. Common build targets are:

make build <-- builds Keyman Desktop and Keyman Developer make clean <-- remove temporary files and build artifacts make release <-- makes a release of all Keyman Windows projects

The version will have a major and minor component that reflects the current release version -- but may not match the actual version.

Release build

To perform a release build, you will need to obtain valid certificates. A release build is unnecessary for local development. Release builds are currently run from a TeamCity CI environment.

  1. Start 'x64_x86 Cross Tools Command Prompt for VS 2017'.
  2. Run make release from the windows/src folder.
  3. Artifacts from a successful build will be placed in windows/release folder.
  4. buildtools/help-keyman-com.sh will push updated documentation to help.keyman.com. Environment variable HELP_KEYMAN_COM needs to be set to the root of the local help.keyman.com git repository.

Note: by default, the version number generated may vary from the current release version. You will not be able to install it over a later version of Keyman, and will need to uninstall and reinstall.

Installing Keyman

These steps are only required the first time you install Keyman:

  1. Install release versions of Keyman Desktop and Keyman Developer for the branch in which you are working ( e.g. for master branch, download latest alpha, for beta, download latest beta, etc).
  2. Install the Keyman test certificates. Do the following for each KeymanTestCA cert in windows/src/buildtools/certificates:
    1. Open the certificate and click 'Install certificate...' to open the Certificate Import Wizard.
    2. Select either 'Current User' or 'Local Machine' for 'Store Location' depending on your preference and click Next.
    3. Select 'Place all certificates in the following store' and 'Browse...' to select 'Trusted Root Certification Authorities'. Click Next and finish the wizard.

To deploy a development build of Keyman and Keyman Developer,

  1. Start 'x64_x86 Cross Tools Command Prompt for VS 2017'.
  2. Run make signcode from the windows/src folder.
  3. Ensure that Keyman and Keyman Developer are not running.
  4. Run make install in windows/src/engine, windows/src/desktop and windows/src/developer.

Detailed Prerequisite Notes

Visual Studio 2017 Community Edition setup requirements

In Visual Studio 2017, you need to have the following installed:

Workloads

  • Desktop development with C++
  • Universal Windows Platform development

Individual components

  • Windows Universal CRT SDK
  • Windows 8.1 SDK

Configure Visual Studio to use two-space tab stops:

  1. Open the options dialog: Tools > Options.
  2. Navigate to Text Editor > All Languages > Tabs.
  3. Change 'Tab size' to 2 and 'Indent size' to 2.
  4. Select 'Insert spaces'.

Delphi setup requirements

Delphi Community Edition is free and can be downloaded here.

Install Delphi using the following options:

  • Windows 32 and 64 bit
  • DUnit components
  • No other 3rd party components required
  • No Interbase components required

Delphi 10.3 is supported by default. For Delphi 10.2, set the environment variable DELPHI_VERSION=19.0. This variable can also be added to your UserDefines.mak.

Environment Variables

To check whether these variables are set, run SET NAME_OF_VAR in command prompt.

KEYMAN_ROOT - Locating the source

If you pull the entire keyman.git repo to c:\keyman, then the paths by default will work without changes. Otherwise, you will need to set an environment variable KEYMAN_ROOT to the root path of the Keyman repo. For example:

SET KEYMAN_ROOT=c:\projects\keyman

GIT_BASH_FOR_KEYMAN

This environment variable is optional: the build will run bash in a separate window in order to build KeymanWeb if it isn't present, but you'll lose logging and have the annoyance of a window popping up halfway through the build. To resolve both of those issues, set the environment variable to:

SET GIT_BASH_FOR_KEYMAN="C:\Program Files\Git\bin\bash.exe" --init-file "c:\Program Files\Git\etc\profile" -l

You should verify the install location of Git on your computer as it may vary.

USERDEFINES - User Defines

You can specify defines that will not be added to the git repository and will be used in the build in the UserDefines.mak file in the root folder. This is used mostly for code signing certificates. If not specified, a test certificate will be used to sign executables when you build a release.

To include UserDefines.mak in the build, use the command line parameter -DUSERDEFINES. You can also set an environment variable USERDEFINES=1 to get the same result.

KEYMAN_CEF4DELPHI_ROOT - Chromium Embedded Framework in Keyman Developer

Keyman Developer uses Chromium Embedded Framework. The source repo is at https://github.com/keymanapp/CEF4Delphi. In order to build the installers, we need to source the binary files from the https://github.com/keymanapp/CEF4Delphi_binary repo. The KEYMAN_CEF4DELPHI_ROOT environment variable should be set to the root of this repo on your local machine.

Keyman Desktop does not currently depend on this component.