-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notarize app for macOS #3870
Comments
I have users on OSX 10.14.5 reporting that the electron app can't be opened anymore. Running
It would be great if we have some option to notarize the app with |
ticket #3908 mentions running |
Also, this is blocked by #3504, otherwise you could roll your own with |
Yeah this is a big issue :( all our Mac installs started breaking. Trying to figure out how we can do notarization using electron builder on a ci server (Travis) if anyone figures it out let me know! |
I have a fix in #3912, once that lands you can call |
You're a a hero, I'm excited. |
There's a few more things that need to happen, it seems. The DMG is also signed by electron-builder and anything that gets signed needs to be notarized or it won't be allowed to install. So we need one of two options:
|
@develar is this something you could help coordinate? |
electron-builder should use |
For DMG currently updates files are not used by electron-updater. |
That would be the best! It also means when the afterSign fix is released, we have a complete story for notarizing (albeit manually)
… On 25 May 2019, at 10:23, Vladimir Krivosheev ***@***.***> wrote:
electron-builder should use electron-notarize under the hood and user should not configure some hooks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
We're tracking an issue in #3828 that's preventing regular users from installing from an electron-builder generated dmg even though it is notarized. |
The signing and notarizing of the app works with 20.42.0 using However, the dmg itself can only be opened by holding cmd, or right-clicking and selecting open. Additionally, users are greeted with an ominous message about malicious software. For Google-ability, this is the text in the image:
This is less than ideal. @martani found out that it's the "open" type assessment of the dmg is not being notarized, and we suspect that's the issue. |
Solution foundWhen the DMG is not codesigned and not notarized, but the app inside it is, Gatekeeper accepts it. So for the complete story regarding notarization with electron-builder we need two additional things:
@develar I'll make a PR for point 1 and 2. |
Awesome, thanks @Kilian! I can confirm your solution is working as expected. |
And here's the guide on how to Notarize your app using electron-builder: https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/ |
@Kilian thanks for the post, just a small note about |
@Kilian Thanks for the PR and the blogpost summarizing this.
|
Hmm, it should be there: https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/src/options/macOptions.ts#L192 @develar any idea? |
@Kilian Thanks for the blog post. May I suggest that you change the recommendation of storing the |
@will-stone Thanks, I've added a reference to https://github.com/electron-userland/electron-notarize#safety-when-using-appleidpassword |
Thanks @Kilian for the guide ! It's really good. Just a little thing, there is a little mistake into the notarize.js script (you declare electronPlatformName after using it). |
@Kilian , great guide! We tried it, but it didn't work for us. We also tried disabling dmg signing and tried with no notarization, but then still get the unverified developer message. We used |
Does anyone know how to trigger afterSign just for mac? I have a multi platform build Trying to put it inside the mac block results in an error
Error:
I am running 22.4.0 of electron-builder and as per the docs, I can add common configuration items inside mac. |
You can bail out of the script if it’s not being run for Mac (darwin) artifacts. See https://github.com/irccloud/irccloud-desktop/blob/master/scripts/afterSign.js#L7 |
Thanks. That is how I’ve set it up for now. Would have preferred a cleaner way but good for now. |
|
Have you successfully updated the blockmap? I'm not sure how to do that part. |
I'm only notarizing the app and dmg, not the blockmap. Updates are working fine. |
Have you tested this on macOS 10.14.5? I'm still running into the "Apple cannot check it for malicious software" message when trying to open a signed, notarized .dmg on that os version. and I'm tempted to go with Kilian's suggestion of not signing/notarizing the .dmg, but also worried this will break in future os versions :'( |
It worked for me on Mojave and it's working on Catalina. I'm using this (Note that for the dmg I'm not stapling the file, and using https://github.com/hugozap/electron-notarize-dmg) This runs in the afterAllArtifactBuildHook return await notarize({
appBundleId: config.build.appId,
dmgPath: dmgPath,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
staple: false
}); ( Note: The dmg was created with an already notarized .app bundle - The .app bundle was notarized with the default electron-notarize package ) |
@hugozap gotcha, thanks! It looks like the critical piece for me is to not .zip the .dmg, as electron-notarize does by default (and as you show in your fork). 👍🤩 I assume the reason for that is because Apple's notary service then assumes that the .zip is the top-level package you will distribute in (in which case you should still be able to distribute the .zip without issue?) IN any case, thanks for the help! |
@Kilian blog post works for our project. We are now missing the app icon, however. |
Since adding notarization, my MAS app is immediately exiting with no error message on MacOS versions older than Catalina. Detail here electron/electron#24423 |
Can you show file package.json? |
Anyone facing issues on 10.15.7? I have app signed / notarized which works on 10.13.6 and 10.15.6, but on 10.15.7 it gives the message of:
|
I have managed to notarize, sign and build .dmg by using electron-builder by following this guide: |
@stakauskas i experience the same problem now. Did you manage to resolve this issue? |
We have an electron app containing other binaries and working from 10.3 to 11.0 (big sur). An important step was to use https://gist.github.com/harshitsilly/a1bd5a405f93966aad20358ae6c4cec5 Also copying the zip via scp to another computer was maybe an issue (I'm not sure of this), but passing via an http hosting was fine. Last: the binary contained in our app had to be signed via command line , not in xcode. We use electron-notarize v 1.0.0, good luck |
Unfortunately - no. Still looking for a solution. Will check what @thomasdarde suggested. |
Notarization seems to fail for me due to extra python .so files . Any ideas as to why, I assume they're not being picked up by electron builder. We've binarised our python files using Pyinstaller and included them in the Resources/main
|
@maitham did you try to sign manually the .so files before notarizing the whole folder ?
|
I'm trying to build a .pkg for "mas".
|
I hope this will work. #!/bin/bash APP="Test Electron Desktop App" APP_PATH="dist/mas/$APP.app" RESULT_PATH="dist/mas/$APP-mac_store.pkg" APP_KEY="3rd Party Mac Developer Application: My Company Name (*******)" PARENT_PLIST="build/entitlements.mas.plist" codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Libraries/libvk_swiftshader.dylib" codesign -s "$APP_KEY" --options runtime -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/ReactiveCocoa.framework/Versions/A/ReactiveCocoa" codesign -s "$APP_KEY" --options runtime -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Test Electron Desktop App Helper (Renderer).app/Contents/MacOS/Test Electron Desktop App Helper (Renderer)" codesign -s "$APP_KEY" --options runtime -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Electron Framework" codesign -s "$APP_KEY" --options runtime -f --entitlements "$CHILD_PLIST" "$RESOURCES_PATH/app.asar.unpacked/node_modules/electron-builder-squirrel-windows/node_modules/app-builder-bin/mac/app-builder" codesign -s "$APP_KEY" --options runtime -f --entitlements "$CHILD_PLIST" "$APP_PATH/Contents/MacOS/$APP" codesign -s "$APP_KEY" -f --entitlements "$PARENT_PLIST" "$APP_PATH" productbuild --component "$APP_PATH" /Applications --sign "$INSTALLER_KEY" "$RESULT_PATH" |
I added a wee script to my build
and an entry to my package.json
I set APPLEID and APPLEIDPASS in my environment. |
Closing this issue. There are so many resources/articles available on how to notarize the app through a simple Google search for "electron-notarize" or for writing a custom script yourself, electron-notarize also being a 3rd-party module, and the |
I too have this issue with two different electron apps. Successful building + notarization but still unable to open because the developer cannot be verified. |
@Kilian @develar After following Kilian's blog, I am able to successfully sign and notarize my app. Now, I want to distribute .pkg instead of .dmg Currently, when my users tries to open .pkg, they get this error: |
Is there any way to notarize app using electron builder?
Looks like Apple is going to force it soon. see link below
https://developer.apple.com/news/?id=04102019a
There is one npm module available but it will be nice this is supported by electron-builder.
https://github.com/electron-userland/electron-notarize
The text was updated successfully, but these errors were encountered: