@@ -118,8 +118,7 @@ Please set the PATH to a dotnet host that matches the architecture ${requirement
118118 return [ ] ;
119119 }
120120
121- const findSDKsCommand = await this . setCodePage ( ) ? CommandExecutor . makeCommand ( `chcp` , [ `65001` , `|` , `"${ existingPath } "` , '--list-sdks' ] ) :
122- CommandExecutor . makeCommand ( `"${ existingPath } "` , [ '--list-sdks' ] ) ;
121+ const findSDKsCommand = CommandExecutor . makeCommand ( `"${ existingPath } "` , [ '--list-sdks' ] ) ;
123122
124123 const sdkInfo = await ( this . executor ! ) . execute ( findSDKsCommand , { dotnetInstallToolCacheTtlMs : DOTNET_INFORMATION_CACHE_DURATION_MS } , false ) . then ( ( result ) =>
125124 {
@@ -144,13 +143,6 @@ Please set the PATH to a dotnet host that matches the architecture ${requirement
144143 return sdkInfo ;
145144 }
146145
147- private async setCodePage ( ) : Promise < boolean >
148- {
149- // For Windows, we need to change the code page to UTF-8 to handle the output of the command. https://github.com/nodejs/node-v0.x-archive/issues/2190
150- // Only certain builds of windows support UTF 8 so we need to check that we can use it.
151- return os . platform ( ) === 'win32' ? ( await this . executor ! . tryFindWorkingCommand ( [ CommandExecutor . makeCommand ( 'chcp' , [ '65001' ] ) ] , { dotnetInstallToolCacheTtlMs : SYS_CMD_SEARCH_CACHE_DURATION_MS } ) ) !== null : false ;
152- }
153-
154146 public stringVersionMeetsRequirement ( availableVersion : string , requestedVersion : string , requirement : IDotnetFindPathContext ) : boolean
155147 {
156148 const availableMajor = Number ( versionUtils . getMajor ( availableVersion , this . workerContext . eventStream , this . workerContext ) ) ;
@@ -256,7 +248,7 @@ Please set the PATH to a dotnet host that matches the architecture ${requirement
256248
257249 private stringArchitectureMeetsRequirement ( outputArchitecture : string , requiredArchitecture : string | null | undefined ) : boolean
258250 {
259- return ! requiredArchitecture || outputArchitecture === '' || FileUtilities . dotnetInfoArchToNodeArch ( outputArchitecture , this . workerContext . eventStream ) === requiredArchitecture ;
251+ return ! requiredArchitecture || ! outputArchitecture || FileUtilities . dotnetInfoArchToNodeArch ( outputArchitecture , this . workerContext . eventStream ) === requiredArchitecture ;
260252 }
261253
262254 private allowPreview ( availableVersion : string , requirement : IDotnetFindPathContext ) : boolean
@@ -275,8 +267,7 @@ Please set the PATH to a dotnet host that matches the architecture ${requirement
275267 return [ ] ;
276268 }
277269
278- const findRuntimesCommand = await this . setCodePage ( ) ? CommandExecutor . makeCommand ( `chcp` , [ `65001` , `|` , `"${ existingPath } "` , '--list-runtimes' ] ) :
279- CommandExecutor . makeCommand ( `"${ existingPath } "` , [ '--list-runtimes' ] ) ;
270+ const findRuntimesCommand = CommandExecutor . makeCommand ( `"${ existingPath } "` , [ '--list-runtimes' ] ) ;
280271
281272 const windowsDesktopString = 'Microsoft.WindowsDesktop.App' ;
282273 const aspnetCoreString = 'Microsoft.AspNetCore.App' ;
0 commit comments