fix(child-writer): Pass parent env during elevation (#1851)

Change-Type: patch
This commit is contained in:
Jonas Hermsmeier 2017-11-17 02:56:42 +01:00 committed by GitHub
parent 7ebff68506
commit 773ddb6e9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,19 +101,21 @@ permissions.isElevated().then((elevated) => {
// For debugging purposes
console.log(`Running: ${commandArguments.join(' ')}`)
const commandEnv = _.assign({}, process.env, {
ELECTRON_RUN_AS_NODE: 1,
IPC_SERVER_ID: process.env.IPC_SERVER_ID,
IPC_CLIENT_ID: process.env.IPC_CLIENT_ID,
// This environment variable prevents the AppImages
// desktop integration script from presenting the
// "installation" dialog.
SKIP: 1
})
return permissions.elevateCommand(commandArguments, {
applicationName: packageJSON.displayName,
environment: {
ELECTRON_RUN_AS_NODE: 1,
IPC_SERVER_ID: process.env.IPC_SERVER_ID,
IPC_CLIENT_ID: process.env.IPC_CLIENT_ID,
// This environment variable prevents the AppImages
// desktop integration script from presenting the
// "installation" dialog.
SKIP: 1
}
environment: commandEnv
}).then((results) => {
if (results.cancelled) {
process.exit(EXIT_CODES.CANCELLED)