agracio / electron-edge-js-quick-start

Electron quick start using `electron-edge-js` module on .NET Core
MIT License
40 stars 20 forks source link

How do I package electron-edge-js-quick-start using electron-forge make? #18

Closed Julio-de-Leon closed 6 months ago

Julio-de-Leon commented 6 months ago

I've been tinkering with the electron-edge-js-quick-start since yesterday, but I'm unable to create a package. This is what I do:

  1. I clone this repository (electron-edge-js-quick-start)
  2. npm install
  3. dotnet build src/QuickStart.sln
  4. npm start (and It works) electronedge

My next step is to package the application. I followed the instructions on electron js website. https://www.electronjs.org/docs/latest/tutorial/tutorial-packaging

  1. npm install --save-dev @electron-forge/cli
  2. npx electron-forge import
  3. npm run make

It doesn't work and it stops without error log. It always stop on preparing native dependencies. make e

windows 10 dotnet version: 7.0.408 node version: 20.12.2 npm version: 8.12.1

Any help is appreciated. Thank you so much.

agracio commented 6 months ago

Take a look at electron-edge-js readme, there are some examples for packaging as well as references to similar issues that people had.

Julio-de-Leon commented 6 months ago

I tried to use electron-builder to package the application, but I still can't make it work. After generating the .exe I double click it and after the installation it produces an error. installation2

I'm not sure what I'm doing wrong. This is my package.json

{
  "name": "electron-edge-js-quick-start",
  "version": "1.0.0",
  "description": "Minimal Electron application using `electron-edge-js` with .NET",
  "main": "main.js",
  "scripts": {
    "start": "electron --core .",
    "start:core": "electron --core .",
    "start:standard": "electron --standard .",
    "app:dir": "electron-builder --dir",
    "app:dist": "electron-builder",
    "postinstall": "electron-builder install-app-deps"
  },
  "keywords": [
    "Electron",
    "quick",
    "start",
    "tutorial",
    "demo",
    "Edge",
    "Edge.js"
  ],
  "license": "MIT",
  "devDependencies": {
    "electron": "^30.0.2",
    "electron-builder": "^24.13.3"
  },
  "build": {
    "appId": "your.id"
  },
  "dependencies": {
    "electron-edge-js": "^30.0.1"
  }
}

This is my QuickStart.Core.csproj

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
    <PackageReference Include="Microsoft.CodeAnalysis" Version="4.9.2" />
    <PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
    <PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
    <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="EmailSender_Outlook">
      <HintPath>.\bin\Debug\net7.0\EmailSender_Outlook.dll</HintPath>
      <Private>true</Private>
    </Reference>
  </ItemGroup>

  <ItemGroup> 
    <Reference Include="EdgeJs">
      <HintPath>..\..\node_modules\electron-edge-js\lib\bootstrap\bin\Release\net6.0\EdgeJs.dll</HintPath>
      <Private>true</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="..\shared\LocalMethods.cs">
      <Link>LocalMethods.cs</Link>
    </Compile>
  </ItemGroup>
</Project>
agracio commented 6 months ago

Did you take a look at packaging instructions that I linked electron-edge-js?