executing exe from CEP panel by clicking a CEP button
Dear PPro fellows,
Here is the code which runs CEP panel concurrently with my exe file (index.js file):
var csInterface = new CSInterface();
const exec = require('child_process').exec;
exec("myPath\\myApp.exe", function(err, stdout, stderr) {});
This code works just fine.
However, I'd like to start my myApp.exe after the user clicks a button.
What I tried to do is as follows:
I added:
var openButton = document.querySelector("#open-button");
openButton.addEventListener("click", openDoc);
function openDoc() {
const exec = require('child_process').exec;
exec("D:\\Yaroslav2021\\anytex\\anytex.exe", function(err, stdout, stderr) {});
}This doesn't work.
As far as I now understand node.js functions don't work in buttons so straighforwardly. Could you hint me what to do? May be a single code line can solve this problem?
Yaroslav.
