Notarization success but staple of @electron/notarize/src/staple.ts fails probably because of executable in assets
gregoiregentil opened this issue · 1 comments
I have an Ionic capacitor electron app. I can electron-build and notarize it.
Inside my electron app, I have another executable which is spawn and run by Electron at run-time. This app is located in electron/app/assets so during the electron build, it becomes dist/mac/myapp.app/Contents/Resources/app/assets/executable-that-will-be-spawn
This executable is signed with signcode. I can notarize it in the afterSign hook leveraging @electron/notarize. Apple accepts it.
But then, electron-build gets the following error:
Error: Failed to staple your application with code: 66.
Stapler is incapable of working with Document files.
Error at .../node_modules/@electron/notarize/src/staple.ts:16:11
The issue seems to come from the fact that this spawn executable in the resources assets folder and staple might seems to think that it's a document file.
How can I overcome this problem? I still need to have this spawn executable outside of the asar so somewhere around the assets folder.
It seems that notarizing such "internal" "spawn" executable doesn't make sense because the "internal' "spawn" executable is part of the notarized app. As the notarization on Apple server is a black box, it's difficult to understand what is tested and what needs to be done.