0

I have a command-line program, say "myprogram.exe" installed in the resources directory of my nodejs-electron application.

I run my electron application via "npm start" with no problem: the nodejs function execPromise finds myprogram.exe and runs fine.

When I try to package my app using electron-forge command "npm run make", the file "myprogram.exe" is not copied into the out/myprogram-win32-x64/resources directory.

I added the following lines inside package.json:

  "build": {
    "appId": "myapp",
    "directories": {
      "buildResources": "resources"
    },
    "files": [
      "resources/**/*"
    ]
  }

and I have added to forge.config.js the following lines:

module.exports = {
  packagerConfig: {
    asar: true,
    extraFiles: ['resources/myprogram.exe'],
  },

but myprogram.exe is nowhere in the out/** directories... Any idea?

1 Answer 1

0
I finally managed to make it work by
- storing myprogram.exe in the root directory,
- keeping the original file package.json, and
- adding in forge.config.js:
module.exports = {
  packagerConfig: {
    asar: true,
    extraResource: ['myprogram.exe']
  },

Note that there is no final "s" in ExtraResource

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.