Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

signed electron app shell.openItem() fails

Tags:

macos

electron

I want my Electron app could open *.txt-files (generated by my app) with system default application (default text editor).

I use shell.openItem(path) to perform it - and it worked fine... until I've packed (mas) and signed the app. I suppose I have to add some entitlements when signing, but already tried bunch of them without success :(

Could anyone give me a hand with that?

like image 852
LtColumbo Avatar asked Sep 11 '26 17:09

LtColumbo


1 Answers

Unfortunately Electron disables the shell.openItem() API in Mac App Store builds. From their signing guide:

[shell.openItem()] will fail when the app is signed for distribution in the Mac App Store. Subscribe to #9005 for updates.


However, there is a work-around that will enable you to have the same functionality:

shell.openExternal('file://' + myFilePath);

This approach is also confirmed to pass the Apple Store Reviews (see here).

like image 152
Aᴄʜᴇʀᴏɴғᴀɪʟ Avatar answered Sep 14 '26 07:09

Aᴄʜᴇʀᴏɴғᴀɪʟ