Skip to content

Instantly share code, notes, and snippets.

@TylerLeonhardt
Created February 12, 2020 23:46
Show Gist options
  • Save TylerLeonhardt/7deb5f39877a48ebb41a2f9b208cce65 to your computer and use it in GitHub Desktop.
Save TylerLeonhardt/7deb5f39877a48ebb41a2f9b208cce65 to your computer and use it in GitHub Desktop.
Works by running `node repro.js` but doesn't work in a VS Code extension
const spawn = require("child_process").spawn;
const msi = spawn("msiexec", ["/i", "C:\\Users\\tyleonha\\Downloads\\PowerShell-7.0.0-rc.2-win-x64.msi"], {
detached: true,
stdio: "ignore",
shell: false,
windowsHide: true,
});
msi.unref();
msi.on("close", (code) => {
console.log("we done");
});
@TylerLeonhardt
Copy link
Author

run this and close the terminal... the MSI should still be running.

@Tyriar
Copy link

Tyriar commented Feb 13, 2020

@deepak1556 any ideas why detached wouldn't be working properly in VS Code but it does in node(12)?

@TylerLeonhardt
Copy link
Author

Do people get notifications on gists, @Tyriar?

@Tyriar
Copy link

Tyriar commented Feb 18, 2020

Pinged in person.

@deepak1556
Copy link

I looked into this briefly, the issue doesn't repro with electron, I have to check how extension host is spawned which will answer the question.

@TylerLeonhardt
Copy link
Author

Thanks for the info @deepak1556. Let me know if I can help test anything for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment