Axosoft / nsfw

A super fast and scaleable file watcher that provides a consistent interface on Linux, OSX and Windows
MIT License
901 stars 113 forks source link

How to package NSFW with a notarized app? #180

Open jagthedrummer opened 1 year ago

jagthedrummer commented 1 year ago

I'm testing NSFW in an electron app and it works fantastically in development mode. But when I generate a self-contained .app file then try to start the app I get an error thrown when I try to require nsfw.

dlopen(/var/folders/fx/vmqbtyws34j1l88m16_9jy_00000gn/T/.com.electron.seshydevelopment.3nmfAN, 0x0001):
tried: '/var/folders/fx/vmqbtyws34j1l88m16_9jy_00000gn/T/.com.electron.seshydevelopment.3nmfAN'
(code signature in <83F8673B-BEAF-3E2A-9B12-66321A99F480> '/private/var/folders/fx/vmqbtyws34j1l88m16_9jy_00000gn/T/.com.electron.seshydevelopment.3nmfAN'
not valid for use in process:
mapped file has no Team ID and is not a platform binary
(signed with custom identity or adhoc?)),

Is there something special that I have to do to build, sign, and use NSFW for distribution with my app?

jagthedrummer commented 1 year ago

Found a change in forge.config.js that did the trick. Changed this line:

    "asar": true,

to this:

    "asar": {
      "unpack": "**/node_modules/nsfw/**/*.node",
    },