electron / electron

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
https://electronjs.org
MIT License
113.53k stars 15.27k forks source link

Could not get code signature for running application when running locally for auto updater testing #8204

Closed wangxiexe closed 7 years ago

wangxiexe commented 7 years ago

running well locally

Actual behavior

get this error: Uncaught Exception: Error: Could not get code signature for running application at Error (native) at autoUpdate (/Users/wangxi/workspace/micloud-pc/app/main.js:475:15) at Object. (/Users/wangxi/workspace/micloud-pc/app/main.js:62:1) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at loadApplicationPackage (/Users/wangxi/workspace/micloud-pc/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js:280:12) at Object. (/Users/wangxi/workspace/micloud-pc/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js:322:5) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Object. (/Users/wangxi/workspace/micloud-pc/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/browser/init.js:171:8)

How to reproduce

Just run autoUpdate() in main.js and in autoUpdate, I did things like set feed url and also attach some update related events

Similar issue can be found here:

https://discuss.atom.io/t/testing-auto-update-could-not-get-code-signature-for-running-application/35029

MarshallOfSound commented 7 years ago

Squirrel.Mac only works when your application is signed. This is documented.

http://electron.atom.io/docs/api/auto-updater/#macos

Note: Your application must be signed for automatic updates on macOS. This is a requirement of Squirrel.Mac.