1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-16 08:13:30 +00:00

Modified, so 32-bit PowerShell is used from SysWow64 on 64-bit windows, to work around issue where PowerShell will respawn itself

This commit is contained in:
Bryan Roe
2019-07-24 22:11:05 -07:00
parent bd0bf102cd
commit cbc183bfdb

View File

@@ -133,9 +133,16 @@ function windows_terminal() {
}
this.PowerShellCapable = function()
{
if (require('os').arch() == 'x64')
{
return (require('fs').existsSync(process.env['windir'] + '\\SysWow64\\WindowsPowerShell\\v1.0\\powershell.exe'));
}
else
{
return (require('fs').existsSync(process.env['windir'] + '\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'));
}
}
this.StartEx = function Start(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT, terminalTarget)
{
@@ -219,9 +226,16 @@ function windows_terminal() {
return (this.StartEx(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT, process.env['windir'] + '\\System32\\cmd.exe'));
}
this.StartPowerShell = function StartPowerShell(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT)
{
if (require('os').arch() == 'x64')
{
return (this.StartEx(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT, process.env['windir'] + '\\SysWow64\\WindowsPowerShell\\v1.0\\powershell.exe'));
}
else
{
return (this.StartEx(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT, process.env['windir'] + '\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'));
}
}
this._stop = function () {
if (this.stopping) { return (this.stopping); }