Add winpty support for Windows agents#297
Conversation
|
i will have to ask @Ylianst to have a look at is for me, |
|
Ok thanks! For clarification: The dll (and The installation routine in But I'm also not exactly happy with the design to have the dll and winpty-agent.exe as binary resource. So ideas are welcome. |
|
@MartinMa oh right ok! got you! side note: |
|
Is it possible to integrate this? I have a few Windows Server 2016 systems and can't really use PowerShell on them. |
|
@PacGyver it requires a lot of testing first and would require yet another meshagent update |
This pull request adds winpty support to MeshAgent and is open for discussion.
Closes Ylianst/MeshCentral#4327
winpty provides functionality similar to Windows Pseudo Console (ConPTY), when ConPTY is not available.
See https://github.com/rprichard/winpty
In order for it to work,
winpty.dllandwinpty-agent.exeare installed alongside the agent binary. I included pre-built versions these two files as Visual Studio resources that are compiled into the meshagent binary, which are installed duringMeshServer_ConnectExusingdeployWinPtyDependencies(seemodules/service-manager.js). The files are taken from the Microsoft VSCode release bundle, because it ships with these files too.The most important changes are in
modules/service-manager.js(installation of winpty deps) andmodules/win-terminal.js(agent plugin replacement).Some thoughts: Due to the fact, that the winpty dependencies are compiled into the agent binary, the overall file size of
MeshService64.exeincreases. Another idea would be to make a "legacy Windows MeshAgent" binary with winpty support and a smaller one without (that uses ConPTY). Another idea would be that MeshCentral sends these dependencies over the network after installation if needed to keep the file size small.Note: We successfully tested this solution on Windows 10, version 1607 (64-bit). It should work on 32-bit Windows systems as well. I included the 32-bit binaries of winpty. But that still needs testing!