Skip to content

Commit 50175a7

Browse files
authored
Merge pull request #324 from keymanapp/feat/online-update-use-app-go-url
feat: use app go/ url for online update checks to capture download stats
2 parents fc00e9e + cd2dc0e commit 50175a7

4 files changed

Lines changed: 212 additions & 4 deletions

File tree

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
{
2+
"msi": {
3+
"name": "Keyman for Windows MSI installer",
4+
"version": "18.0.245",
5+
"date": "2025-12-03",
6+
"platform": "win",
7+
"stability": "stable",
8+
"file": "keymandesktop.msi",
9+
"md5": "98EABC9C8F4803B11C5EF2EF64F0D802",
10+
"type": "msi",
11+
"build": "245",
12+
"size": 110870528,
13+
"url": "https://downloads.keyman.com/windows/stable/18.0.245/keymandesktop.msi"
14+
},
15+
"setup": {
16+
"name": "Keyman for Windows setup bootstrap",
17+
"version": "18.0.245",
18+
"date": "2025-12-03",
19+
"platform": "win",
20+
"stability": "stable",
21+
"file": "setup.exe",
22+
"md5": "C32FD8926909F1E447BBC72AF8B16380",
23+
"type": "exe",
24+
"build": "245",
25+
"size": 4032904,
26+
"url": "https://downloads.keyman.com/windows/stable/18.0.245/setup.exe"
27+
},
28+
"bundle": {
29+
"name": "Keyman for Windows",
30+
"version": "18.0.245",
31+
"date": "2025-12-03",
32+
"platform": "win",
33+
"stability": "stable",
34+
"file": "keyman-18.0.245.exe",
35+
"md5": "2BE0290AF6DF49BA736CEDCE50D1E763",
36+
"type": "exe",
37+
"build": "245",
38+
"size": 111668424,
39+
"url": "https://downloads.keyman.com/windows/stable/18.0.245/keyman-18.0.245.exe"
40+
},
41+
"keyboards": {
42+
"khmer_angkor": {
43+
"id": "khmer_angkor",
44+
"name": "Khmer Angkor",
45+
"license": "mit",
46+
"authorName": "Makara Sok",
47+
"authorEmail": "makara_sok@sil.org",
48+
"description": "<p>Khmer Unicode keyboard layout based on the NiDA keyboard layout.\nAutomatically corrects many common keying errors.</p>",
49+
"languages": {
50+
"km": {
51+
"examples": [
52+
{
53+
"keys": "x j m E r",
54+
"note": "Name of language",
55+
"text": "\u1781\u17d2\u1798\u17c2\u179a"
56+
}
57+
],
58+
"font": {
59+
"family": "Busra",
60+
"source": [
61+
"Busra-Regular.ttf"
62+
]
63+
},
64+
"oskFont": {
65+
"family": "KbdKhmr",
66+
"source": [
67+
"KbdKhmr.ttf"
68+
]
69+
},
70+
"languageName": "Khmer",
71+
"displayName": "Khmer"
72+
}
73+
},
74+
"lastModifiedDate": "2025-12-16T08:51:56.000Z",
75+
"packageFilename": "khmer_angkor.kmp",
76+
"packageFileSize": 2541924,
77+
"jsFilename": "khmer_angkor.js",
78+
"jsFileSize": 74154,
79+
"packageIncludes": [
80+
"visualKeyboard",
81+
"welcome",
82+
"documentation",
83+
"fonts"
84+
],
85+
"version": "2.4",
86+
"encodings": [
87+
"unicode"
88+
],
89+
"platformSupport": {
90+
"windows": "full",
91+
"macos": "full",
92+
"linux": "full",
93+
"desktopWeb": "full",
94+
"ios": "full",
95+
"android": "full",
96+
"mobileWeb": "full"
97+
},
98+
"minKeymanVersion": "10.0",
99+
"sourcePath": "release/k/khmer_angkor",
100+
"helpLink": "https://help.keyman.com/keyboard/khmer_angkor",
101+
"related": {
102+
"khmer10": {
103+
"deprecates": true
104+
},
105+
"basic_kbdkni": {
106+
"deprecates": false
107+
}
108+
},
109+
"url": "https://keyman.com/go/package/download/khmer_angkor?version=2.4&platform=windows&tier=stable&update=0"
110+
},
111+
"sil_ipa": {
112+
"id": "sil_ipa",
113+
"name": "IPA (SIL)",
114+
"license": "mit",
115+
"authorName": "Martin Hosken, Lorna Evans",
116+
"authorEmail": "fonts@sil.org",
117+
"description": "<p>The keyboard layout is described in terms of an IPA chart rather than a\nkeyboard. This is because many base characters are typed as a sequence\nof a letter followed by one of &lt;, &gt; or = which are characters used to\nchange a base character to another base character. Diacritics are typed\nas sequences of an appropriate key.</p>",
118+
"languages": {
119+
"und-latn": {
120+
"examples": [],
121+
"font": {
122+
"family": "Charis",
123+
"source": [
124+
"Charis-Regular.ttf"
125+
]
126+
},
127+
"oskFont": {
128+
"family": "Charis",
129+
"source": [
130+
"Charis-Regular.ttf"
131+
]
132+
},
133+
"languageName": "Undetermined",
134+
"scriptName": "Latin",
135+
"displayName": "Undetermined (Latin)"
136+
}
137+
},
138+
"lastModifiedDate": "2025-06-09T21:19:30.000Z",
139+
"packageFilename": "sil_ipa.kmp",
140+
"packageFileSize": 3626354,
141+
"jsFilename": "sil_ipa.js",
142+
"jsFileSize": 88661,
143+
"packageIncludes": [
144+
"documentation",
145+
"welcome",
146+
"fonts"
147+
],
148+
"version": "2.0.2",
149+
"encodings": [
150+
"unicode"
151+
],
152+
"platformSupport": {
153+
"windows": "full",
154+
"macos": "full",
155+
"linux": "full",
156+
"desktopWeb": "full",
157+
"ios": "full",
158+
"android": "full",
159+
"mobileWeb": "full"
160+
},
161+
"minKeymanVersion": "17.0",
162+
"sourcePath": "release/sil/sil_ipa",
163+
"helpLink": "https://help.keyman.com/keyboard/sil_ipa",
164+
"related": {
165+
"ipauni11": {
166+
"deprecates": true
167+
},
168+
"ipauni111": {
169+
"deprecates": true
170+
},
171+
"ipa93_km5": {
172+
"deprecates": false
173+
}
174+
},
175+
"url": "https://keyman.com/go/package/download/sil_ipa?version=2.0.2&platform=windows&tier=stable&update=0"
176+
}
177+
}
178+
}

script/windows/14.0/update/WindowsUpdateCheck.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ private function CheckVersionResponse($tier, $tiers, $InstalledVersion, $regex)
133133
}
134134
}
135135

136-
$filedata->url = KeymanHosts::Instance()->downloads_keyman_com . "/windows/$tier/{$filedata->version}/{$file}";
136+
$filedata->url =
137+
KeymanHosts::Instance()->keyman_com . "/go/app/download/windows/{$filedata->version}/$tier?url=" .
138+
rawurlencode(KeymanHosts::Instance()->downloads_keyman_com . "/windows/$tier/{$filedata->version}/{$file}");
137139
return $filedata;
138140
}
139141
}

script/windows/14.0/update/index.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
11
<?php
2+
/**
3+
* https://api.keyman.com/windows/{majorVersion}/update?version={fullVersion}&package_{id}={packageVersion}...&update={update}&manual={manual}
4+
*
5+
* Parameters:
6+
* - `majorVersion` is the same as the Keyman release version, "14.0" or
7+
* later
8+
* - `fullVersion` is the currently installed version on the user's computer,
9+
* e.g. "18.0.240.0"
10+
* - `id` is package id, e.g. "khmer_angkor"; more than one package is
11+
* allowed
12+
* - `packageVersion` is the version of that package, e.g. "1.0"
13+
* - `update` should be 0 for a new install (from setup.exe), or 1 for an
14+
* update
15+
* - `manual` should be 0 for automatic update checks, 1 for new install
16+
* (from setup.exe), or where the user presses 'Check for Updates'
17+
*
18+
* This returns a JSON object, following the schema at
19+
* /schemas/windows-update/17.0/windows-update.json See example at
20+
* /schemas/windows-update/17.0/sample.json
21+
*
22+
* The value for `update` is included in the URL for keyboard package
23+
* download in the JSON, e.g.:
24+
*
25+
* `https://keyman.com/go/package/download/sil_ipa?version=2.0.2&platform=windows&tier=stable&update=0`
26+
*
27+
* This is so it can be passed into the increment-download API, to allow us
28+
* to track whether updates are from new installs or from existing users.
29+
*/
230
require_once __DIR__ . '/../../../../tools/base.inc.php';
331
require_once __DIR__ . '/../../../../tools/util.php';
432
require_once __DIR__ . '/../../../../tools/db/db.php';

tests/fixtures/WindowsUpdateCheck.14.0.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type": "exe",
1111
"build": "102",
1212
"size": 68694016,
13-
"url": "https://downloads.keyman.com/windows/alpha/14.0.102.0/keymandesktop.msi"
13+
"url": "https://keyman-staging.com/go/app/download/windows/14.0.102.0/alpha?url=https%3A%2F%2Fdownloads.keyman.com%2Fwindows%2Falpha%2F14.0.102.0%2Fkeymandesktop.msi"
1414
},
1515
"setup": {
1616
"name": "Keyman Desktop setup bootstrap",
@@ -23,7 +23,7 @@
2323
"type": "exe",
2424
"build": "102",
2525
"size": 4705280,
26-
"url": "https://downloads.keyman.com/windows/alpha/14.0.102.0/setup.exe"
26+
"url": "https://keyman-staging.com/go/app/download/windows/14.0.102.0/alpha?url=https%3A%2F%2Fdownloads.keyman.com%2Fwindows%2Falpha%2F14.0.102.0%2Fsetup.exe"
2727
},
2828
"bundle": {
2929
"name": "Keyman Desktop",
@@ -36,7 +36,7 @@
3636
"type": "exe",
3737
"build": "102",
3838
"size": 70575440,
39-
"url": "https://downloads.keyman.com/windows/alpha/14.0.102.0/keymandesktop-14.0.102.0.exe"
39+
"url": "https://keyman-staging.com/go/app/download/windows/14.0.102.0/alpha?url=https%3A%2F%2Fdownloads.keyman.com%2Fwindows%2Falpha%2F14.0.102.0%2Fkeymandesktop-14.0.102.0.exe"
4040
},
4141
"keyboards": {
4242
"khmer_angkor": {

0 commit comments

Comments
 (0)