You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.
It seems that Electron v9 on Windows (tested on Win10) replaces child_process.exec with a promisified version of it. I could not find a reference to this behaviour in the electron repo.
This causes an error in function WindowsElevate, specifically with child.stdin.end();, as child is now a promise, and not a ChildProcess.
My temporary solution is to use child_process.execSync, which is not promisified.
Maybe this is all due to my setup, but I just thought I would report this, in case somebody else is experiencing the issue.
I am not sure this deserves a PR, so here is my replacement function :
functionWindowsElevate(instance,end){// We used to use this for executing elevate.vbs:// var command = 'cscript.exe //NoLogo "' + instance.pathElevate + '"';varcommand=[];command.push('powershell.exe');command.push('Start-Process');command.push('-FilePath');// Escape characters for cmd using double quotes:// Escape characters for PowerShell using single quotes:// Escape single quotes for PowerShell using backtick:// See: https://ss64.com/ps/syntax-esc.htmlcommand.push('"\''+instance.pathExecute.replace(/'/g,"`'")+'\'"');command.push('-WindowStyle hidden');command.push('-Verb runAs');command=command.join(' ');console.log('command',command)try{// Using execSync instead of exec because of an Electron bug where exec is promisified // (cannot find a reference in electron repo)require('child_process').execSync(command,{encoding: 'utf-8'});end();}catch(e){console.error(e)end(newError(PERMISSION_DENIED),"",e);}}
The text was updated successfully, but these errors were encountered:
It seems that Electron v9 on Windows (tested on Win10) replaces
child_process.exec
with a promisified version of it. I could not find a reference to this behaviour in the electron repo.This causes an error in function
WindowsElevate
, specifically withchild.stdin.end();
, aschild
is now a promise, and not a ChildProcess.My temporary solution is to use
child_process.execSync
, which is not promisified.Maybe this is all due to my setup, but I just thought I would report this, in case somebody else is experiencing the issue.
I am not sure this deserves a PR, so here is my replacement function :
The text was updated successfully, but these errors were encountered: