From 7ec9859838c2dc992c962d3dab780bff57b15dfd Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 29 Jun 2022 10:58:40 +1000 Subject: [PATCH] fix(developer): Show full version number Updated various places in Keyman Developer to show the full VersionWithTag rather than the short version number we had been previously showing: - About dialog - Welcome screen - Installer - kmcomp help - kmconvert help - kmanalyze help - kmdecomp help This should help when testing to verify that we are testing the right version. Also fixed the keymansentry path when running command line C++ programs from source repo. --- common/windows/cpp/include/keymanversion.h | 6 ++++++ common/windows/cpp/src/keymansentry.cpp | 2 +- developer/src/inst/download.in.mak | 2 +- developer/src/kmanalyze/kmanalyze.cpp | 14 +++++++++----- developer/src/kmcomp/main.pas | 2 +- .../Keyman.Developer.System.KeymanConvertMain.pas | 2 +- developer/src/kmdecomp/kmdecomp.cpp | 12 ++++++++---- developer/src/setup/SetupStrings.pas | 2 +- developer/src/setup/UfrmRun.pas | 4 ++-- developer/src/tike/dialogs/UfrmAboutTike.pas | 2 +- ...an.Developer.System.Project.WelcomeRenderer.pas | 3 ++- 11 files changed, 33 insertions(+), 18 deletions(-) diff --git a/common/windows/cpp/include/keymanversion.h b/common/windows/cpp/include/keymanversion.h index ea9a95539a..a35421a2de 100644 --- a/common/windows/cpp/include/keymanversion.h +++ b/common/windows/cpp/include/keymanversion.h @@ -20,8 +20,14 @@ #define KEYMANVERSION90W L"9.0" #define KEYMANVERSION80W L"8.0" +// These macros may be used only in RC files + #define KV_COMPANY_NAME "SIL International\0" #define KV_LEGAL_COPYRIGHT "\xA9 SIL International\0" #define KV_LEGAL_TRADEMARKS "Keyman is a registered trademark in Australia\0" +// These macros may be used in C++ files + +#define KEYMAN_Copyright "(C) SIL International" + #endif diff --git a/common/windows/cpp/src/keymansentry.cpp b/common/windows/cpp/src/keymansentry.cpp index 3cd59c7870..177ef74d31 100644 --- a/common/windows/cpp/src/keymansentry.cpp +++ b/common/windows/cpp/src/keymansentry.cpp @@ -270,7 +270,7 @@ void keyman_sentry_test_crash() { #define SENTRY_DLL SENTRY_BASE_DLL #endif #define SENTRY_INSTALL_PATH "sentry-0.4.9\\" SENTRY_DLL -#define SENTRY_DEV_PATH "windows\\src\\ext\\sentry\\" SENTRY_DLL +#define SENTRY_DEV_PATH "common\\windows\\delphi\\ext\\sentry\\" SENTRY_DLL #define ENV_KEYMAN_ROOT "KEYMAN_ROOT" HMODULE LoadSentryLibrary() { diff --git a/developer/src/inst/download.in.mak b/developer/src/inst/download.in.mak index 79b7c0184d..0f6c59f128 100644 --- a/developer/src/inst/download.in.mak +++ b/developer/src/inst/download.in.mak @@ -98,7 +98,7 @@ makeinstaller: echo [Setup] > setup.inf echo Version=$Version >> setup.inf echo MSIFileName=keymandeveloper.msi >> setup.inf - echo Title=Keyman Developer $VersionRelease >>setup.inf + echo Title=Keyman Developer $VersionWithTag >>setup.inf $(WZZIP) setup.zip keymandeveloper.msi setup.inf copy /b $(DEVELOPER_PROGRAM)\setup.exe + setup.zip keymandeveloper-$Version.exe $(SIGNCODE) /d "Keyman Developer" keymandeveloper-$Version.exe diff --git a/developer/src/kmanalyze/kmanalyze.cpp b/developer/src/kmanalyze/kmanalyze.cpp index bff2c53763..6feebfb5c4 100644 --- a/developer/src/kmanalyze/kmanalyze.cpp +++ b/developer/src/kmanalyze/kmanalyze.cpp @@ -3,6 +3,7 @@ #include "pch.h" #include "../../../common/windows/cpp/include/crc32.h" +#include "../../../common/windows/cpp/include/keymanversion.h" #include #include #include @@ -59,11 +60,14 @@ int run(int argc, char *argv[]) if (argc < 2 || !strcmp(argv[1], "--help")) { - puts("KMANALYZE: Extract rules from a Keyman .kmx keyboard to use for building automated tests"); - puts("(C) SIL International"); - puts("Usage: KMANALYZE [outputfilename]\n"); - puts("Will create a keyboard.tests from keyboard.js; if outputfilename is not specified,"); - puts("then will put the output file in the same folder as filename."); + printf( + "KMANALYZE: Extract rules from a Keyman .kmx keyboard to use for building automated tests\n" + "Version %s, %s\n" + "Usage: KMANALYZE [outputfilename]\n\n" + "Will create a keyboard.tests from keyboard.js; if outputfilename is not specified,\n" + "then will put the output file in the same folder as filename.", + KEYMAN_VersionWithTag, KEYMAN_Copyright + ); return 1; } diff --git a/developer/src/kmcomp/main.pas b/developer/src/kmcomp/main.pas index a8d880de4a..b91dc736c8 100644 --- a/developer/src/kmcomp/main.pas +++ b/developer/src/kmcomp/main.pas @@ -208,7 +208,7 @@ begin {$ELSE} writeln(SKeymanDeveloperName + ' Compiler (32-bit)'); {$ENDIF} - writeln('Version ' + GetVersionString + ', ' + GetVersionCopyright); + writeln('Version ' + CKeymanVersionInfo.VersionWithTag + ', ' + GetVersionCopyright); end; if FError or (FParamInfile = '') then diff --git a/developer/src/kmconvert/Keyman.Developer.System.KeymanConvertMain.pas b/developer/src/kmconvert/Keyman.Developer.System.KeymanConvertMain.pas index f298e59af6..c6d70a3a36 100644 --- a/developer/src/kmconvert/Keyman.Developer.System.KeymanConvertMain.pas +++ b/developer/src/kmconvert/Keyman.Developer.System.KeymanConvertMain.pas @@ -148,7 +148,7 @@ end; procedure WriteBanner; begin writeln(SKeymanDeveloperName + ' Conversion Utility'); - writeln('Version ' + GetVersionString + ', ' + GetVersionCopyright); + writeln('Version ' + CKeymanVersionInfo.VersionWithTag + ', ' + GetVersionCopyright); writeln; end; diff --git a/developer/src/kmdecomp/kmdecomp.cpp b/developer/src/kmdecomp/kmdecomp.cpp index 8a768af646..819a63350e 100644 --- a/developer/src/kmdecomp/kmdecomp.cpp +++ b/developer/src/kmdecomp/kmdecomp.cpp @@ -21,6 +21,7 @@ #include #include #include "../../../common/windows/cpp/include/keymansentry.h" +#include "../../../common/windows/cpp/include/keymanversion.h" #include "../../../common/windows/cpp/include/legacy_kmx_memory.h" #include "../../../common/windows/cpp/include/legacy_kmx_file.h" @@ -56,10 +57,13 @@ int run(int argc, char *argv[]) if(argc < 2 || !strcmp(argv[1], "--help")) { - puts("KMDECOMP: Decompile Keyman .kmx keyboard"); - puts("(C) SIL International"); - puts("Usage: KMDECOMP [output]\n"); - puts("Will create a .kmn and optionally a .bmp/.ico with the same filename and in the same location as the input"); + printf( + "KMDECOMP: Decompile Keyman .kmx keyboard\n" + "Version %s, %s\n" + "Usage: KMDECOMP [output]\n" + "Will create a.kmn and optionally a.bmp / .ico with the same filename and in the same location as the input", + KEYMAN_VersionWithTag, KEYMAN_Copyright + ); return 1; } diff --git a/developer/src/setup/SetupStrings.pas b/developer/src/setup/SetupStrings.pas index 9d74219127..b2126b9a18 100644 --- a/developer/src/setup/SetupStrings.pas +++ b/developer/src/setup/SetupStrings.pas @@ -60,7 +60,7 @@ const '', '', '', 'Keyman Developer Setup', - '%0:s Setup', + 'Keyman Developer %0:s Setup', 'Setup will install %0:s', 'Created by SIL International', 'Check for &updates online before installing', diff --git a/developer/src/setup/UfrmRun.pas b/developer/src/setup/UfrmRun.pas index fe253edc3c..291dd7b374 100644 --- a/developer/src/setup/UfrmRun.pas +++ b/developer/src/setup/UfrmRun.pas @@ -494,8 +494,8 @@ begin SetFontProperties(IDC_CHECK1, FW_NORMAL, ssFontSize_Dialog, ssFontName_Dialog); SetFontProperties(IDCANCEL, FW_NORMAL, ssFontSize_Dialog, ssFontName_Dialog); - SetWindowText(GetDlgItem(Handle, IDC_TITLE), PWideChar(FInstallInfo.Text(ssTitle, [FInstallInfo.EditionTitle]))); - SetWindowText(GetDlgItem(Handle, IDC_LOGOMESSAGE), PWideChar(FInstallInfo.Text(ssSIL, [FInstallInfo.EditionTitle]))); + SetWindowText(GetDlgItem(Handle, IDC_TITLE), PWideChar(FInstallInfo.Text(ssTitle, [FInstallInfo.Version]))); + SetWindowText(GetDlgItem(Handle, IDC_LOGOMESSAGE), PWideChar(FInstallInfo.Text(ssSIL, []))); SetWindowText(GetDlgItem(Handle, IDC_MESSAGE), PWideChar(FInstallInfo.Text(ssWelcome_Plain, [FInstallInfo.EditionTitle]))); SetWindowText(GetDlgItem(Handle, IDC_CHECK1), PWideChar(FInstallInfo.Text(ssCheckForUpdates))); diff --git a/developer/src/tike/dialogs/UfrmAboutTike.pas b/developer/src/tike/dialogs/UfrmAboutTike.pas index 6feb679525..88113326d8 100644 --- a/developer/src/tike/dialogs/UfrmAboutTike.pas +++ b/developer/src/tike/dialogs/UfrmAboutTike.pas @@ -79,7 +79,7 @@ begin inherited; Caption := SCaption; lblWebsite.Caption := MakeKeymanURL(URLPath_KeymanDeveloperHome_Presentation); - lblVersion.Caption := 'Version ' + GetVersionString; + lblVersion.Caption := 'Version ' + CKeymanVersionInfo.VersionWithTag; lblCopyright.Caption := GetVersionCopyright; end; diff --git a/developer/src/tike/project/Keyman.Developer.System.Project.WelcomeRenderer.pas b/developer/src/tike/project/Keyman.Developer.System.Project.WelcomeRenderer.pas index 0de6a14467..bdd4af2c32 100644 --- a/developer/src/tike/project/Keyman.Developer.System.Project.WelcomeRenderer.pas +++ b/developer/src/tike/project/Keyman.Developer.System.Project.WelcomeRenderer.pas @@ -16,6 +16,7 @@ uses Winapi.Shlobj, Xml.Win.msxmldom, + KeymanVersion, Keyman.Developer.System.Project.ProjectFile, Keyman.Developer.System.Project.UrlRenderer, RegistryKeys, @@ -72,7 +73,7 @@ begin end; node := doc.createElement('Version'); - node.appendChild(doc.createTextNode(GetVersionString)); + node.appendChild(doc.createTextNode(CKeymanVersionInfo.VersionWithTag)); root.appendChild(node); TProjectUrlRenderer.AddUrls(root);