简体   繁体   中英

How to get the directory of the .exe for a Node.js pkg executable?

To clarify, I want the Node.js program to know where the .exe file it is being run from is, to confirm it is correctly installed.

This in hopes of making a self-installing program, that doesn't require me to build an installed around it.

I might just have not picked it up, but I can't find an answer on either the pkg documentation or on another question here.

When it comes to the main script it's as simple as:

process.argv[1]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM