Don
Don

Reputation: 6882

Launch application from nodes

I am developing a nodejs application. From this application I would like to launch other desktop applications (windows and Mac) with command arguments. The only way I know this can be done for windows is as follows:

Child_process.exec("start someapp.exe arg1 arg2", {cwd: "directory containing someapp.exe"}, callback...)

Two problems: - this doesn't work on a Mac, "start" keyword doesn't work on a Mac (yes yes, there are no exes on macs) - the handle to the process returned by exec, is not the process of the application launched. I believe it is the handle to the cmd.exe application.

So, does anyone know a better way of launching apps from nodejs, with the UI. Please remember I need to launch a desktop application, and would like to see the app.

Next, does anyone know how this can be achieved on a Mac.

Finally, if this is at all possible can I somehow get the handle to the process or at least the process id of the process launched.

Thnaks

Upvotes: 0

Views: 128

Answers (1)

simon-p-r
simon-p-r

Reputation: 3751

Best option is to use this module to run applications, it is cross platform so will help you out on Mac.

Upvotes: 1

Related Questions