Skip to content
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

Electron shell cant open __static folder files in production #300

Closed
sanch941 opened this issue May 30, 2019 · 1 comment
Closed

Electron shell cant open __static folder files in production #300

sanch941 opened this issue May 30, 2019 · 1 comment

Comments

@sanch941
Copy link

Describe the bug
I use electron shell to open file from public folder via __static variable. In development this works but when i build project and install it there is no files from public folder

To Reproduce
create file in public
open it in main process via electron shell
import { shell } from 'electron'
import path from 'path'

const dir = path.join(__static, 'myElectronFile.exe' )
shell.openItem(dir)

Expected behavior
start exe file in production

Additional context
Add any other context about the problem here.

@nklayman
Copy link
Owner

The issue is that your app is packaged into an asar archive. openItem only works if the file is in an uncompressed directory. Follow these instructions to package a file outside of the asar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants