@@ -314,29 +314,30 @@ VisualStudioFinder.prototype = {
314
314
getSDK : function getSDK ( info ) {
315
315
const win8SDK = 'Microsoft.VisualStudio.Component.Windows81SDK'
316
316
const win10SDKPrefix = 'Microsoft.VisualStudio.Component.Windows10SDK.'
317
+ const win11SDKPrefix = 'Microsoft.VisualStudio.Component.Windows11SDK.'
317
318
318
- var Win10SDKVer = 0
319
+ var Win10or11SDKVer = 0
319
320
info . packages . forEach ( ( pkg ) => {
320
- if ( ! pkg . startsWith ( win10SDKPrefix ) ) {
321
+ if ( ! pkg . startsWith ( win10SDKPrefix ) && ! pkg . startsWith ( win11SDKPrefix ) ) {
321
322
return
322
323
}
323
324
const parts = pkg . split ( '.' )
324
325
if ( parts . length > 5 && parts [ 5 ] !== 'Desktop' ) {
325
- this . log . silly ( '- ignoring non-Desktop Win10SDK :' , pkg )
326
+ this . log . silly ( '- ignoring non-Desktop Win10/11SDK :' , pkg )
326
327
return
327
328
}
328
329
const foundSdkVer = parseInt ( parts [ 4 ] , 10 )
329
330
if ( isNaN ( foundSdkVer ) ) {
330
331
// Microsoft.VisualStudio.Component.Windows10SDK.IpOverUsb
331
- this . log . silly ( '- failed to parse Win10SDK number:' , pkg )
332
+ this . log . silly ( '- failed to parse Win10/11SDK number:' , pkg )
332
333
return
333
334
}
334
- this . log . silly ( '- found Win10SDK :' , foundSdkVer )
335
- Win10SDKVer = Math . max ( Win10SDKVer , foundSdkVer )
335
+ this . log . silly ( '- found Win10/11SDK :' , foundSdkVer )
336
+ Win10or11SDKVer = Math . max ( Win10or11SDKVer , foundSdkVer )
336
337
} )
337
338
338
- if ( Win10SDKVer !== 0 ) {
339
- return `10.0.${ Win10SDKVer } .0`
339
+ if ( Win10or11SDKVer !== 0 ) {
340
+ return `10.0.${ Win10or11SDKVer } .0`
340
341
} else if ( info . packages . indexOf ( win8SDK ) !== - 1 ) {
341
342
this . log . silly ( '- found Win8SDK' )
342
343
return '8.1'
0 commit comments