junlarsen / league-connect

:electric_plug: Node.js HTTP/1.1, HTTP/2.0 and WebSocket interface to the League of Legends Client APIs
https://www.npmjs.com/package/league-connect
MIT License
156 stars 24 forks source link

feat: implement options for forcing use of WMIC and Cmd on Windows #68

Closed xiaowuyaya closed 2 years ago

xiaowuyaya commented 2 years ago

Add win7 judgment on the original basis.

if (os.release().indexOf('6.1') != -1){
  // it means win7
}

and we use wmic.

67

junlarsen commented 2 years ago

Do you think it'd be possible to just add another parameter to AuthenticationOptions such as "useWmicCommand" instead of using os.release()? I think it's better to have the caller have some more control over what is being called.

xiaowuyaya commented 2 years ago

Do you think it'd be possible to just add another parameter to AuthenticationOptions such as "useWmicCommand" instead of using os.release()? I think it's better to have the caller have some more control over what is being called. Sorry, I don't know about this, where is the documentation to let me know about ‘useWmicCommand’

junlarsen commented 2 years ago

I was thinking we could add another property to this type https://github.com/matsjla/league-connect/blob/master/src/authentication.ts#L31 which would act as an option to use WMIC+Cmd instead of Get-CimInstance+PowerShell

junlarsen commented 2 years ago

I've went ahead and implemented it with two new options, useDeprecatedWmic and windowsShell which will allow you to use WMIC and Cmd by passing the options to authenticate()

junlarsen commented 2 years ago

I'll do a minor release soon.