Electron - How to add external files?

前端 未结 4 1799
感动是毒
感动是毒 2020-12-05 05:42

I have an Electron app. I try to make the app open an .exe file. I created a directory in the root folder named lib and placed the .exe file there. In developme

4条回答
  •  一向
    一向 (楼主)
    2020-12-05 06:06

    there I found a new solution, using electron-packager on Windows do not add the files into the resources folder at the end of the process.

    So I added this command into the package.json

    "build-win": "electron-packager . --platform=win32 --asar --prune --arch=ia32 --extra-resource=./extraResources/documents/QuickStartGuideWN-H1.pdf --extra-resource=./extraResources/MAC_drivers/MacOS10.14/ --icon=assets/alfa_a.ico --out ./dist --overwrite",
    

    And now the files are insied the resource fodlder just add

    --extra-resource=./extraResources/file
    

提交回复
热议问题