automation-stack / electron-sudo

Electron subprocesses with administrative privileges, prompting the user with an OS dialog if necessary.
MIT License
383 stars 55 forks source link

Fix elevate.exe not found on Windows #47

Closed ppoffice closed 7 years ago

ppoffice commented 7 years ago

I start a new project using the examples in readme, and got this error: 20170228103727 And if I restart it, an empty elevate.exe will be created under my temp folder, so I have to delete it before repeat this error.

Test code:

var Sudoer = require('electron-sudo').default;
var sudoer = new Sudoer();
sudoer.spawn('echo', ['%PARAM%'], {env: {PARAM: 'VALUE'}}).then(function (cp) {
    cp.on('close', () => {
        console.log(cp.output.stdout.toString());
    });
});
ppoffice commented 7 years ago

Duplicate #37

ppoffice commented 7 years ago

I'm sorry. I am testing something and it end up showing here 😭