diff --git a/gulpfile.js b/gulpfile.js index a700a1779..5aa570b71 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -118,7 +118,7 @@ gulp.task('package:offline', ['clean'], () => { var packageName = name + '.' + version; var packages = []; - packages.push(new PlatformInformation('win32', '64-bit')); + packages.push(new PlatformInformation('win32', 'x86_64')); packages.push(new PlatformInformation('darwin', 'x86_64')); packages.push(new PlatformInformation('linux', 'x86_64', new LinuxDistribution('centos', '7'))); packages.push(new PlatformInformation('linux', 'x86_64', new LinuxDistribution('debian', '8'))); diff --git a/package.json b/package.json index 560a4d6d1..25bbb0eba 100644 --- a/package.json +++ b/package.json @@ -111,8 +111,7 @@ "win32" ], "architectures": [ - "x86", - "32-bit" + "x86" ] }, { @@ -123,8 +122,7 @@ "win32" ], "architectures": [ - "x86_64", - "64-bit" + "x86_64" ] }, { diff --git a/src/platform.ts b/src/platform.ts index 35569075f..b4067e415 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -172,7 +172,15 @@ export class PlatformInformation { if (architecture) { let archArray: string[] = architecture.split(os.EOL); if (archArray.length >= 2) { - return archArray[1].trim(); + let arch = archArray[1].trim(); + + // Note: This string can be localized. So, we'll just check to see if it contains 32 or 64. + if (arch.indexOf('64') >= 0) { + return "x86_64"; + } + else if (arch.indexOf('32') >= 0) { + return "x86"; + } } } @@ -204,8 +212,8 @@ export class PlatformInformation { switch (platform) { case 'win32': switch (architecture) { - case '32-bit': return 'win7-x86'; - case '64-bit': return 'win7-x64'; + case 'x86': return 'win7-x86'; + case 'x86_64': return 'win7-x64'; } throw new Error(`Unsupported Windows architecture: ${architecture}`); diff --git a/test/platform.tests.ts b/test/platform.tests.ts index 8d69bb055..83c21a94b 100644 --- a/test/platform.tests.ts +++ b/test/platform.tests.ts @@ -38,13 +38,13 @@ suite("Platform", () => { }); test("Compute correct RID for Windows 32-bit", () => { - const platformInfo = new PlatformInformation('win32', '32-bit'); + const platformInfo = new PlatformInformation('win32', 'x86'); platformInfo.runtimeId.should.equal('win7-x86'); }) test("Compute correct RID for Windows 64-bit", () => { - const platformInfo = new PlatformInformation('win32', '64-bit'); + const platformInfo = new PlatformInformation('win32', 'x86_64'); platformInfo.runtimeId.should.equal('win7-x64'); })