karaggeorge / macos-audio-devices

Get, set and configure the Audio Devices on macOS
MIT License
166 stars 17 forks source link

Unable to use in Electron build with asar #18

Closed has-n closed 3 years ago

has-n commented 3 years ago

The package works fine in development builds but not production builds unless asar is turned off.

I'm using electron-builder, if it matters. Pretty standard configuration.

chinarui-na commented 3 years ago

Is it resolved?

has-n commented 3 years ago

The issue is upstream: https://github.com/sindresorhus/electron-util/issues/53#issue-981786403

chinarui-na commented 3 years ago

The issue is upstream: https://github.com/sindresorhus/electron-util/issues/53#issue-981786403

How to fix it ?

has-n commented 3 years ago

You can set asarUnpack to point to this module in your electron builder configuration.

chinarui-na commented 3 years ago

You can set asarUnpack to point to this module in your electron builder configuration.

i use electron-builder and i set it in my configuration

"asarUnpack": [
          "**/node_modules/macos-audio-devices/**/*"
],

i can see app.asar.unpacked who include /node_modules/macos-audio-devices/ but also got error

Command failed with ENOTDIR
/Contents/Resources/app.asar/audio-devices list --output --json

i know the path is error,but dont know how to fix it. can you help me ? thanks.

has-n commented 3 years ago

Use the latest build of electron-util : https://github.com/sindresorhus/electron-util/releases/tag/v0.17.2