forked from VSCodium/vscodium
-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathwin32-ia32.patch
488 lines (452 loc) · 24.9 KB
/
win32-ia32.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
diff --git a/build/gulpfile.cli.js b/build/gulpfile.cli.js
index 592fc74..a6f98fd 100644
--- a/build/gulpfile.cli.js
+++ b/build/gulpfile.cli.js
@@ -27,7 +27,9 @@ const platformOpensslDirName =
process.platform === 'win32' ? (
process.arch === 'arm64'
? 'arm64-windows-static-md'
- : 'x64-windows-static-md')
+ : process.arch === 'ia32'
+ ? 'x86-windows-static-md'
+ : 'x64-windows-static-md')
: process.platform === 'darwin' ? (
process.arch === 'arm64'
? 'arm64-osx'
diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
index e12a33e..bc076f9 100644
--- a/build/gulpfile.reh.js
+++ b/build/gulpfile.reh.js
@@ -42,6 +42,7 @@ const REMOTE_FOLDER = path.join(REPO_ROOT, 'remote');
// Targets
const BUILD_TARGETS = [
+ { platform: 'win32', arch: 'ia32' },
{ platform: 'win32', arch: 'x64' },
{ platform: 'win32', arch: 'arm64' },
{ platform: 'darwin', arch: 'x64' },
@@ -220,7 +221,9 @@ function nodejs(platform, arch) {
const { fetchUrls, fetchGithub } = require('./lib/fetch');
const untar = require('gulp-untar');
- if (arch === 'armhf') {
+ if (arch === 'ia32') {
+ arch = 'x86';
+ } else if (arch === 'armhf') {
arch = 'armv7l';
} else if (arch === 'alpine') {
platform = 'alpine';
diff --git a/build/gulpfile.scan.js b/build/gulpfile.scan.js
index 127720a..7d878f9 100644
--- a/build/gulpfile.scan.js
+++ b/build/gulpfile.scan.js
@@ -18,6 +18,7 @@ const { existsSync, readdirSync } = require('fs');
const root = path.dirname(__dirname);
const BUILD_TARGETS = [
+ { platform: 'win32', arch: 'ia32' },
{ platform: 'win32', arch: 'x64' },
{ platform: 'win32', arch: 'arm64' },
{ platform: 'darwin', arch: null, opts: { stats: true } },
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
index 7841bb9..196ee82 100644
--- a/build/gulpfile.vscode.js
+++ b/build/gulpfile.vscode.js
@@ -530,10 +530,12 @@ function patchWin32DependenciesTask(destinationFolderName) {
const buildRoot = path.dirname(root);
const BUILD_TARGETS = [
+ { platform: 'win32', arch: 'ia32' },
{ platform: 'win32', arch: 'x64' },
{ platform: 'win32', arch: 'arm64' },
{ platform: 'darwin', arch: 'x64', opts: { stats: true } },
{ platform: 'darwin', arch: 'arm64', opts: { stats: true } },
+ { platform: 'linux', arch: 'ia32' },
{ platform: 'linux', arch: 'x64' },
{ platform: 'linux', arch: 'armhf' },
{ platform: 'linux', arch: 'arm64' },
diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js
index 5adfdfb..674eb41 100644
--- a/build/gulpfile.vscode.win32.js
+++ b/build/gulpfile.vscode.win32.js
@@ -69,6 +69,7 @@ function buildWin32Setup(arch, target) {
}
return cb => {
+ const ia32AppId = target === 'system' ? product.win32AppId : product.win32UserAppId;
const x64AppId = target === 'system' ? product.win32x64AppId : product.win32x64UserAppId;
const arm64AppId = target === 'system' ? product.win32arm64AppId : product.win32arm64UserAppId;
@@ -99,11 +100,12 @@ function buildWin32Setup(arch, target) {
TunnelApplicationName: product.tunnelApplicationName,
ApplicationName: product.applicationName,
Arch: arch,
- AppId: { 'x64': x64AppId, 'arm64': arm64AppId }[arch],
- IncompatibleTargetAppId: { 'x64': product.win32x64AppId, 'arm64': product.win32arm64AppId }[arch],
+ AppId: { 'ia32': ia32AppId, 'x64': x64AppId, 'arm64': arm64AppId }[arch],
+ IncompatibleTargetAppId: { 'ia32': product.win32AppId, 'x64': product.win32x64AppId, 'arm64': product.win32arm64AppId }[arch],
+ IncompatibleArchAppId: { 'ia32': x64AppId, 'x64': ia32AppId, 'arm64': ia32AppId }[arch],
AppUserId: product.win32AppUserModelId,
- ArchitecturesAllowed: { 'x64': 'x64', 'arm64': 'arm64' }[arch],
- ArchitecturesInstallIn64BitMode: { 'x64': 'x64', 'arm64': 'arm64' }[arch],
+ ArchitecturesAllowed: { 'ia32': '', 'x64': 'x64', 'arm64': 'arm64' }[arch],
+ ArchitecturesInstallIn64BitMode: { 'ia32': '', 'x64': 'x64', 'arm64': 'arm64' }[arch],
SourceDir: sourcePath,
RepoDir: repoPath,
OutputDir: outputPath,
@@ -113,7 +115,7 @@ function buildWin32Setup(arch, target) {
};
if (quality === 'insider') {
- definitions['AppxPackage'] = `code_insiders_explorer_${arch}.appx`;
+ definitions['AppxPackage'] = `code_insiders_explorer_${arch === 'ia32' ? 'x86' : arch}.appx`;
definitions['AppxPackageFullname'] = `Microsoft.${product.win32RegValueName}_1.0.0.0_neutral__8wekyb3d8bbwe`;
}
@@ -130,8 +132,10 @@ function defineWin32SetupTasks(arch, target) {
gulp.task(task.define(`vscode-win32-${arch}-${target}-setup`, task.series(cleanTask, buildWin32Setup(arch, target))));
}
+defineWin32SetupTasks('ia32', 'system');
defineWin32SetupTasks('x64', 'system');
defineWin32SetupTasks('arm64', 'system');
+defineWin32SetupTasks('ia32', 'user');
defineWin32SetupTasks('x64', 'user');
defineWin32SetupTasks('arm64', 'user');
@@ -155,5 +159,6 @@ function updateIcon(executablePath) {
};
}
+gulp.task(task.define('vscode-win32-ia32-inno-updater', task.series(copyInnoUpdater('ia32'), updateIcon(path.join(buildPath('ia32'), 'tools', 'inno_updater.exe')))));
gulp.task(task.define('vscode-win32-x64-inno-updater', task.series(copyInnoUpdater('x64'), updateIcon(path.join(buildPath('x64'), 'tools', 'inno_updater.exe')))));
gulp.task(task.define('vscode-win32-arm64-inno-updater', task.series(copyInnoUpdater('arm64'), updateIcon(path.join(buildPath('arm64'), 'tools', 'inno_updater.exe')))));
diff --git a/build/npm/preinstall.js b/build/npm/preinstall.js
index b98f229..e6bdf45 100644
--- a/build/npm/preinstall.js
+++ b/build/npm/preinstall.js
@@ -25,7 +25,7 @@ const fs = require('fs');
const cp = require('child_process');
if (process.platform === 'win32') {
- if (!hasSupportedVisualStudioVersion()) {
+ if (process.platform === 'win32' && !process.env['VSCODE_SKIP_NODE_VERSION_CHECK']) {
console.error('\x1b[1;31m*** Invalid C/C++ Compiler Toolchain. Please check https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites.\x1b[0;0m');
throw new Error();
}
diff --git a/build/win32/code.iss b/build/win32/code.iss
index fca3d1e..f934318 100644
--- a/build/win32/code.iss
+++ b/build/win32/code.iss
@@ -1327,7 +1327,7 @@ begin
#endif
#if "user" == InstallTarget
- #if "arm64" == Arch
+ #if "ia32" == Arch || "arm64" == Arch
#define IncompatibleArchRootKey "HKLM32"
#else
#define IncompatibleArchRootKey "HKLM64"
@@ -1344,6 +1344,22 @@ begin
end;
#endif
+ if Result and IsWin64 then begin
+ RegKey := 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + copy('{#IncompatibleArchAppId}', 2, 38) + '_is1';
+ if '{#Arch}' = 'ia32' then begin
+ Result := not RegKeyExists({#Uninstall64RootKey}, RegKey);
+ ThisArch := '32';
+ AltArch := '64';
+ end else begin
+ Result := not RegKeyExists({#Uninstall32RootKey}, RegKey);
+ ThisArch := '64';
+ AltArch := '32';
+ end;
+ if not Result and not WizardSilent() then begin
+ MsgBox('Please uninstall the ' + AltArch + '-bit version of {#NameShort} before installing this ' + ThisArch + '-bit version. Uninstalling will not delete settings.', mbInformation, MB_OK);
+ end;
+ end;
+
end;
function WizardNotSilent(): Boolean;
diff --git a/build/win32/explorer-appx-fetcher.js b/build/win32/explorer-appx-fetcher.js
index 554b449..d964937 100644
--- a/build/win32/explorer-appx-fetcher.js
+++ b/build/win32/explorer-appx-fetcher.js
@@ -37,10 +37,13 @@ async function downloadExplorerAppx(outDir, quality = 'stable', targetArch = 'x6
await extract(artifact, { dir: fs.realpathSync(outDir) });
}
async function main(outputDir) {
- const arch = process.env['VSCODE_ARCH'];
+ let arch = process.env['VSCODE_ARCH'];
if (!outputDir) {
throw new Error('Required build env not set');
}
+ if (arch === 'ia32') {
+ arch = 'x86';
+ }
const product = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
await downloadExplorerAppx(outputDir, product.quality, arch);
}
@@ -50,4 +53,4 @@ if (require.main === module) {
process.exit(1);
});
}
-//# sourceMappingURL=explorer-appx-fetcher.js.map
\ No newline at end of file
+//# sourceMappingURL=explorer-appx-fetcher.js.map
diff --git a/build/win32/explorer-appx-fetcher.ts b/build/win32/explorer-appx-fetcher.ts
index 89fbb57..5d9acb6 100644
--- a/build/win32/explorer-appx-fetcher.ts
+++ b/build/win32/explorer-appx-fetcher.ts
@@ -45,12 +45,16 @@ export async function downloadExplorerAppx(outDir: string, quality: string = 'st
}
async function main(outputDir?: string): Promise<void> {
- const arch = process.env['VSCODE_ARCH'];
+ let arch = process.env['VSCODE_ARCH'];
if (!outputDir) {
throw new Error('Required build env not set');
}
+ if (arch === 'ia32') {
+ arch = 'x86';
+ }
+
const product = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
await downloadExplorerAppx(outputDir, (product as any).quality, arch);
}
diff --git a/product.json b/product.json
index 908be25..fbbe8aa 100644
--- a/product.json
+++ b/product.json
@@ -16,8 +16,10 @@
"win32DirName": "Microsoft Code OSS",
"win32NameVersion": "Microsoft Code OSS",
"win32RegValueName": "CodeOSS",
+ "win32AppId": "{{E34003BB-9E10-4501-8C11-BE3FAA83F23G}",
"win32x64AppId": "{{D77B7E06-80BA-4137-BCF4-654B95CCEBC5}",
"win32arm64AppId": "{{D1ACE434-89C5-48D1-88D3-E2991DF85475}",
+ "win32UserAppId": "{{C6065F05-9603-4FC4-8101-B9781A25D88F}",
"win32x64UserAppId": "{{CC6B787D-37A0-49E8-AE24-8559A032BE0C}",
"win32arm64UserAppId": "{{3AEBF0C8-F733-4AD4-BADE-FDB816D53D7B}",
"win32AppUserModelId": "Microsoft.CodeOSS",
diff --git a/src/main.js b/src/main.js
index 719f51a..8ae0552 100644
--- a/src/main.js
+++ b/src/main.js
@@ -446,6 +446,9 @@ function configureCrashReporter() {
if (uuidPattern.test(crashReporterId)) {
if (isWindows) {
switch (process.arch) {
+ case 'ia32':
+ submitURL = appCenter['win32-ia32'];
+ break;
case 'x64':
submitURL = appCenter['win32-x64'];
break;
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
index 022d2e6..5aac799 100644
--- a/src/vs/base/common/product.ts
+++ b/src/vs/base/common/product.ts
@@ -231,6 +231,7 @@ export interface IFilePathCondition extends IExtensionRecommendationCondition {
export type IFileContentCondition = (IFileLanguageCondition | IFilePathCondition) & { readonly contentPattern: string };
export interface IAppCenterConfiguration {
+ readonly 'win32-ia32': string;
readonly 'win32-x64': string;
readonly 'win32-arm64': string;
readonly 'linux-x64': string;
diff --git a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts
index 1f6ef7a..b6f011a 100644
--- a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts
+++ b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts
@@ -15,7 +15,7 @@ import { URI } from '../../../base/common/uri.js';
import { IHeaders, IRequestContext, IRequestOptions, isOfflineError } from '../../../base/parts/request/common/request.js';
import { IConfigurationService } from '../../configuration/common/configuration.js';
import { IEnvironmentService } from '../../environment/common/environment.js';
-import { getTargetPlatform, IExtensionGalleryService, IExtensionIdentifier, IExtensionInfo, IGalleryExtension, IGalleryExtensionAsset, IGalleryExtensionAssets, IGalleryExtensionVersion, InstallOperation, IQueryOptions, IExtensionsControlManifest, isNotWebExtensionInWebTargetPlatform, isTargetPlatformCompatible, ITranslation, SortBy, SortOrder, StatisticType, toTargetPlatform, WEB_EXTENSION_TAG, IExtensionQueryOptions, IDeprecationInfo, ISearchPrefferedResults, ExtensionGalleryError, ExtensionGalleryErrorCode, IProductVersion } from './extensionManagement.js';
+import { getFallbackTargetPlatforms, getTargetPlatform, IExtensionGalleryService, IExtensionIdentifier, IExtensionInfo, IGalleryExtension, IGalleryExtensionAsset, IGalleryExtensionAssets, IGalleryExtensionVersion, InstallOperation, IQueryOptions, IExtensionsControlManifest, isNotWebExtensionInWebTargetPlatform, isTargetPlatformCompatible, ITranslation, SortBy, SortOrder, StatisticType, toTargetPlatform, WEB_EXTENSION_TAG, IExtensionQueryOptions, IDeprecationInfo, ISearchPrefferedResults, ExtensionGalleryError, ExtensionGalleryErrorCode, IProductVersion } from './extensionManagement.js';
import { adoptToGalleryExtensionId, areSameExtensions, getGalleryExtensionId, getGalleryExtensionTelemetryData } from './extensionManagementUtil.js';
import { IExtensionManifest, TargetPlatform } from '../../extensions/common/extensions.js';
import { areApiProposalsCompatible, isEngineValid } from '../../extensions/common/extensionValidator.js';
@@ -490,6 +490,7 @@ function getAllTargetPlatforms(rawGalleryExtension: IRawGalleryExtension): Targe
export function sortExtensionVersions(versions: IRawGalleryExtensionVersion[], preferredTargetPlatform: TargetPlatform): IRawGalleryExtensionVersion[] {
/* It is expected that versions from Marketplace are sorted by version. So we are just sorting by preferred targetPlatform */
+ const fallbackTargetPlatforms = getFallbackTargetPlatforms(preferredTargetPlatform);
for (let index = 0; index < versions.length; index++) {
const version = versions[index];
if (version.version === versions[index - 1]?.version) {
@@ -499,6 +500,10 @@ export function sortExtensionVersions(versions: IRawGalleryExtensionVersion[], p
if (versionTargetPlatform === preferredTargetPlatform) {
while (insertionIndex > 0 && versions[insertionIndex - 1].version === version.version) { insertionIndex--; }
}
+ /* put it after version with preferred targetPlatform or at the beginning */
+ else if (fallbackTargetPlatforms.includes(versionTargetPlatform)) {
+ while (insertionIndex > 0 && versions[insertionIndex - 1].version === version.version && getTargetPlatformForExtensionVersion(versions[insertionIndex - 1]) !== preferredTargetPlatform) { insertionIndex--; }
+ }
if (insertionIndex !== index) {
versions.splice(index, 1);
versions.splice(insertionIndex, 0, version);
diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts
index 83ed0c5..80db32c 100644
--- a/src/vs/platform/extensionManagement/common/extensionManagement.ts
+++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts
@@ -34,6 +34,7 @@ export interface IProductVersion {
export function TargetPlatformToString(targetPlatform: TargetPlatform) {
switch (targetPlatform) {
case TargetPlatform.WIN32_X64: return 'Windows 64 bit';
+ case TargetPlatform.WIN32_IA32: return 'Windows 32 bit';
case TargetPlatform.WIN32_ARM64: return 'Windows ARM';
case TargetPlatform.LINUX_X64: return 'Linux 64 bit';
@@ -57,6 +58,7 @@ export function TargetPlatformToString(targetPlatform: TargetPlatform) {
export function toTargetPlatform(targetPlatform: string): TargetPlatform {
switch (targetPlatform) {
case TargetPlatform.WIN32_X64: return TargetPlatform.WIN32_X64;
+ case TargetPlatform.WIN32_IA32: return TargetPlatform.WIN32_IA32;
case TargetPlatform.WIN32_ARM64: return TargetPlatform.WIN32_ARM64;
case TargetPlatform.LINUX_X64: return TargetPlatform.LINUX_X64;
@@ -82,6 +84,9 @@ export function getTargetPlatform(platform: Platform | 'alpine', arch: string |
if (arch === 'x64') {
return TargetPlatform.WIN32_X64;
}
+ if (arch === 'ia32') {
+ return TargetPlatform.WIN32_IA32;
+ }
if (arch === 'arm64') {
return TargetPlatform.WIN32_ARM64;
}
@@ -152,7 +157,17 @@ export function isTargetPlatformCompatible(extensionTargetPlatform: TargetPlatfo
return true;
}
- return false;
+ // Fallback
+ const fallbackTargetPlatforms = getFallbackTargetPlatforms(productTargetPlatform);
+ return fallbackTargetPlatforms.includes(extensionTargetPlatform);
+}
+
+export function getFallbackTargetPlatforms(targetPlatform: TargetPlatform): TargetPlatform[] {
+ switch (targetPlatform) {
+ case TargetPlatform.WIN32_X64: return [TargetPlatform.WIN32_IA32];
+ case TargetPlatform.WIN32_ARM64: return [TargetPlatform.WIN32_IA32];
+ }
+ return [];
}
export interface IGalleryExtensionProperties {
diff --git a/src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts b/src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts
index e4f187c..61f61a3 100644
--- a/src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts
+++ b/src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts
@@ -72,6 +72,13 @@ suite('Extension Gallery Service', () => {
assert.deepStrictEqual(actual, expected);
});
+ test('sorting single extension version with fallback target platform', async () => {
+ const actual = [aExtensionVersion('1.1.2', TargetPlatform.WIN32_IA32)];
+ const expected = [...actual];
+ sortExtensionVersions(actual, TargetPlatform.WIN32_X64);
+ assert.deepStrictEqual(actual, expected);
+ });
+
test('sorting single extension version with not compatible target platform', async () => {
const actual = [aExtensionVersion('1.1.2', TargetPlatform.DARWIN_ARM64)];
const expected = [...actual];
@@ -79,6 +86,41 @@ suite('Extension Gallery Service', () => {
assert.deepStrictEqual(actual, expected);
});
+ test('sorting single extension version with multiple target platforms and preferred at first', async () => {
+ const actual = [aExtensionVersion('1.1.2', TargetPlatform.WIN32_X64), aExtensionVersion('1.1.2', TargetPlatform.WIN32_IA32), aExtensionVersion('1.1.2')];
+ const expected = [...actual];
+ sortExtensionVersions(actual, TargetPlatform.WIN32_X64);
+ assert.deepStrictEqual(actual, expected);
+ });
+
+ test('sorting single extension version with multiple target platforms and preferred at first with no fallbacks', async () => {
+ const actual = [aExtensionVersion('1.1.2', TargetPlatform.DARWIN_X64), aExtensionVersion('1.1.2'), aExtensionVersion('1.1.2', TargetPlatform.WIN32_IA32)];
+ const expected = [...actual];
+ sortExtensionVersions(actual, TargetPlatform.DARWIN_X64);
+ assert.deepStrictEqual(actual, expected);
+ });
+
+ test('sorting single extension version with multiple target platforms and preferred at first and fallback at last', async () => {
+ const actual = [aExtensionVersion('1.1.2', TargetPlatform.WIN32_X64), aExtensionVersion('1.1.2'), aExtensionVersion('1.1.2', TargetPlatform.WIN32_IA32)];
+ const expected = [actual[0], actual[2], actual[1]];
+ sortExtensionVersions(actual, TargetPlatform.WIN32_X64);
+ assert.deepStrictEqual(actual, expected);
+ });
+
+ test('sorting single extension version with multiple target platforms and preferred is not first', async () => {
+ const actual = [aExtensionVersion('1.1.2', TargetPlatform.WIN32_IA32), aExtensionVersion('1.1.2', TargetPlatform.WIN32_X64), aExtensionVersion('1.1.2')];
+ const expected = [actual[1], actual[0], actual[2]];
+ sortExtensionVersions(actual, TargetPlatform.WIN32_X64);
+ assert.deepStrictEqual(actual, expected);
+ });
+
+ test('sorting single extension version with multiple target platforms and preferred is at the end', async () => {
+ const actual = [aExtensionVersion('1.1.2', TargetPlatform.WIN32_IA32), aExtensionVersion('1.1.2'), aExtensionVersion('1.1.2', TargetPlatform.WIN32_X64)];
+ const expected = [actual[2], actual[0], actual[1]];
+ sortExtensionVersions(actual, TargetPlatform.WIN32_X64);
+ assert.deepStrictEqual(actual, expected);
+ });
+
test('sorting multiple extension versions without target platforms', async () => {
const actual = [aExtensionVersion('1.2.4'), aExtensionVersion('1.1.3'), aExtensionVersion('1.1.2'), aExtensionVersion('1.1.1')];
const expected = [...actual];
@@ -101,8 +143,8 @@ suite('Extension Gallery Service', () => {
});
test('sorting multiple extension versions with target platforms - 3', async () => {
- const actual = [aExtensionVersion('1.2.4'), aExtensionVersion('1.1.2'), aExtensionVersion('1.1.1'), aExtensionVersion('1.0.0', TargetPlatform.DARWIN_ARM64), aExtensionVersion('1.0.0', TargetPlatform.WIN32_ARM64)];
- const expected = [actual[0], actual[1], actual[2], actual[4], actual[3]];
+ const actual = [aExtensionVersion('1.2.4'), aExtensionVersion('1.1.2'), aExtensionVersion('1.1.1'), aExtensionVersion('1.0.0', TargetPlatform.DARWIN_ARM64), aExtensionVersion('1.0.0', TargetPlatform.WIN32_IA32), aExtensionVersion('1.0.0', TargetPlatform.WIN32_ARM64)];
+ const expected = [actual[0], actual[1], actual[2], actual[5], actual[4], actual[3]];
sortExtensionVersions(actual, TargetPlatform.WIN32_ARM64);
assert.deepStrictEqual(actual, expected);
});
diff --git a/src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts b/src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts
index 1c3d62f..2ce3bcd 100644
--- a/src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts
+++ b/src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts
@@ -35,13 +35,13 @@ suite('Extension Identifier Pattern', () => {
test('extension key', () => {
assert.strictEqual(new ExtensionKey({ id: 'pub.extension-name' }, '1.0.1').toString(), 'pub.extension-name-1.0.1');
assert.strictEqual(new ExtensionKey({ id: 'pub.extension-name' }, '1.0.1', TargetPlatform.UNDEFINED).toString(), 'pub.extension-name-1.0.1');
- assert.strictEqual(new ExtensionKey({ id: 'pub.extension-name' }, '1.0.1', TargetPlatform.WIN32_X64).toString(), `pub.extension-name-1.0.1-${TargetPlatform.WIN32_X64}`);
+ assert.strictEqual(new ExtensionKey({ id: 'pub.extension-name' }, '1.0.1', TargetPlatform.WIN32_IA32).toString(), `pub.extension-name-1.0.1-${TargetPlatform.WIN32_IA32}`);
});
test('extension key parsing', () => {
assert.strictEqual(ExtensionKey.parse('pub.extension-name'), null);
assert.strictEqual(ExtensionKey.parse('[email protected]'), null);
assert.strictEqual(ExtensionKey.parse('pub.extension-name-1.0.1')?.toString(), 'pub.extension-name-1.0.1');
- assert.strictEqual(ExtensionKey.parse('pub.extension-name-1.0.1-win32-x64')?.toString(), 'pub.extension-name-1.0.1-win32-x64');
+ assert.strictEqual(ExtensionKey.parse('pub.extension-name-1.0.1-win32-ia32')?.toString(), 'pub.extension-name-1.0.1-win32-ia32');
});
});
diff --git a/src/vs/platform/extensions/common/extensions.ts b/src/vs/platform/extensions/common/extensions.ts
index 822260b..dadab4a 100644
--- a/src/vs/platform/extensions/common/extensions.ts
+++ b/src/vs/platform/extensions/common/extensions.ts
@@ -287,6 +287,7 @@ export const enum ExtensionType {
export const enum TargetPlatform {
WIN32_X64 = 'win32-x64',
+ WIN32_IA32 = 'win32-ia32',
WIN32_ARM64 = 'win32-arm64',
LINUX_X64 = 'linux-x64',
diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts
index a2561be..f7f3243 100644
--- a/src/vs/platform/update/electron-main/updateService.win32.ts
+++ b/src/vs/platform/update/electron-main/updateService.win32.ts
@@ -100,7 +100,11 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
}
protected buildUpdateFeedUrl(quality: string): string | undefined {
- let platform = `win32-${process.arch}`;
+ let platform = 'win32';
+
+ if (process.arch !== 'ia32') {
+ platform += `-${process.arch}`;
+ }
if (getUpdateType() === UpdateType.Archive) {
platform += '-archive';
diff --git a/src/vs/workbench/contrib/extensions/test/electron-sandbox/extension.test.ts b/src/vs/workbench/contrib/extensions/test/electron-sandbox/extension.test.ts
index efdcd3a..aed014d 100644
--- a/src/vs/workbench/contrib/extensions/test/electron-sandbox/extension.test.ts
+++ b/src/vs/workbench/contrib/extensions/test/electron-sandbox/extension.test.ts
@@ -63,7 +63,7 @@ suite('Extension Test', () => {
});
test('extension is outdated when local and gallery are on same version but on different target platforms', () => {
- const extension = instantiationService.createInstance(Extension, () => ExtensionState.Installed, () => undefined, undefined, aLocalExtension('somext', {}, { targetPlatform: TargetPlatform.WIN32_ARM64 }), aGalleryExtension('somext', {}, { targetPlatform: TargetPlatform.WIN32_X64 }), undefined);
+ const extension = instantiationService.createInstance(Extension, () => ExtensionState.Installed, () => undefined, undefined, aLocalExtension('somext', {}, { targetPlatform: TargetPlatform.WIN32_IA32 }), aGalleryExtension('somext', {}, { targetPlatform: TargetPlatform.WIN32_X64 }), undefined);
assert.strictEqual(extension.outdated, true);
});
diff --git a/src/vs/workbench/services/search/node/rawSearchService.ts b/src/vs/workbench/services/search/node/rawSearchService.ts
index 916097b..b5fa9a8 100644
--- a/src/vs/workbench/services/search/node/rawSearchService.ts
+++ b/src/vs/workbench/services/search/node/rawSearchService.ts
@@ -84,7 +84,7 @@ export class SearchService implements IRawSearchService {
private getPlatformFileLimits(): { readonly maxFileSize: number } {
return {
- maxFileSize: 16 * ByteSize.GB
+ maxFileSize: process.arch === 'ia32' ? 300 * ByteSize.MB : 16 * ByteSize.GB
};
}