3

I'm using electron-builder to build an app from electronjs (To get installable .exe). Problem is after compiling and launching the program, in console I get this message:

C:\Users\User\anaconda3\python.exe: can't open file 
'C:\Users\User\Desktop\ProxyChecker\gui\dist\win-unpacked\resources\app.asar\ProxyChecker.py': [Errno 2] No such file or directory

My folder structure before building looks like this:

/node_modules
/linkers --> linker.js
.gui.html
.main.js
.package.json
.preload.js
.ProxyChecker.py
.renderer.js

As far as I understand problem is within package.json config. which looks like this:

{
  "name": "electron-quick-start",
  "version": "1.0.0",
  "description": "A minimal Electron application",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "build-installer": "electron-builder"
  },
  "build": {
    "extraResources": [
      {
        "from": "/",
        "to": "" 
      }
    ],
    "appId": "electron-quick-start",
    "win": {
      "target": ["nsis"]
    },
    "nsis": {
      "uninstallDisplayName": "electron-quick-start",
      "oneClick": false,
      "allowToChangeInstallationDirectory": true
    },
    "files": [
      "ProxyChecker.py",
      "**/*"
    ]
  },
  "repository": "https://github.com/electron/electron-quick-start",
  "keywords": [
    "Electron",
    "quick",
    "start",
    "tutorial",
    "demo"
  ],
  "author": "GitHub",
  "license": "CC0-1.0",
  "devDependencies": {
    "electron": "^11.2.1",
    "electron-packager": "^15.2.0"
  },
  "dependencies": {
    "python-shell": "^0.4.0"
  },
  "asar": true,
    "asarUnpack": [
      "ProxyChecker.py"
    ]
}

Things I've tried:

  • Adding "extraResources" to add the whole root directory or only "ProxyChecker.py" to "" (which is root as I understand)
  • I tried adding "files" (which you can see in my config).
  • I tried adding "extraFiles" and typing "ProxyChecker.py" in it.
  • I tried adding "asarUnpack": ["ProxyChecker.py"]

None of these helped.

Thanks for any help.

RTA
  • 79
  • 8

0 Answers0