Skip to content

Path to Microsoft.JavaScript.NodeApi.DotNetHost.dll in electron binary is incorrect #332

Open
@sumeet-singh04

Description

@sumeet-singh04

When electron apps are packaged with ASAR enabled, all binaries get placed inside app.asar archive, but when accessed those need to be accessed via app.asar.unpacked directory if the node module does not use path or fs to resolve file names.

For now I am doing the below inside init.js to get things working on my end, but it would be nice to have this handled within the node-api-dotnet library.

let managedHostPath = __dirname + `/${targetFramework}/${assemblyName}.DotNetHost.dll`
  managedHostPath = managedHostPath.indexOf('app.asar.unpacked') < 0 ? 
    managedHostPath.replace('app.asar', 'app.asar.unpacked') : managedHostPath;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions