electron-builder

Electron - Not allowed to load local resource

拈花ヽ惹草 提交于 2019-12-03 11:33:20
问题 Evening, I'm looking into using electron to package an existing angular2 build. I thought I had a dry run working but the actual packaging seems to be failing (see final step below) and I want to understand why. Here's what I'm doing... Create Project Use angular-cli to start a new project ng new electron-ng2-cli --style=scss Install electron and electron-builder Edit package.json Make the following additions... "main": "main.js" "build": { "appId": "com.electrontest.testapp", "mac": {

Run python script in Electron app

孤人 提交于 2019-12-03 02:26:40
问题 I have a Electron project which executes some python script using NodeJS's child_process module. My python script is in the root folder of my project. Here's how I call the python script: let py = spawn('python',['ResolvePosition.py', obsFilePath, navFilePath]) py.stdout.on('data', data => console.log('data : ', data.toString())) py.on('close', ()=>{ // Python ends, do stuff }) This works fine if I run my electron app with npm start When I build an executable for Windows using the npm module

How to launch my electron app from a website

青春壹個敷衍的年華 提交于 2019-12-02 23:10:30
We have an electron crypto app that signs transactions (among other things). We want other websites to have the ability to have a button that opens that electron app, pre-filled with some params (the transaction information). flow is: user clicks "make transaction" on some-crypto-site.com electron app opens up with pre-filled params user clicks "sign transaction" in electron app electron app does stuff behind the scenes electron app closes and sends a message to some-crypto-site.com This could be done at runtime, or install time. What I tried (linux, chrome) calling app

How to reduce Electron package size that exceeds more than 600 mb

会有一股神秘感。 提交于 2019-12-02 18:50:12
问题 I see this is because of node-modules and application is packaged with some unwanted stuffs for running. Current file size is 600 mb but I want it to be less than 200 mb. I suspect --no-prune populates all the node-modules in package that is built, but I need only specifies node-modules in the package that is built I tried removing unwanted packages in package.json, it doesn't help me either after refactoring "bundledDependencies": [ "fs", "os", "path", "regedit", "request", "start", "xml2js"

Run python script in Electron app

眉间皱痕 提交于 2019-12-02 17:21:54
I have a Electron project which executes some python script using NodeJS's child_process module. My python script is in the root folder of my project. Here's how I call the python script: let py = spawn('python',['ResolvePosition.py', obsFilePath, navFilePath]) py.stdout.on('data', data => console.log('data : ', data.toString())) py.on('close', ()=>{ // Python ends, do stuff }) This works fine if I run my electron app with npm start When I build an executable for Windows using the npm module electron-builder and run the executable from dist/win-unpacked/my-app.exe , this won't work, it seems

How to reduce Electron package size that exceeds more than 600 mb

点点圈 提交于 2019-12-02 09:50:33
I see this is because of node-modules and application is packaged with some unwanted stuffs for running. Current file size is 600 mb but I want it to be less than 200 mb. I suspect --no-prune populates all the node-modules in package that is built, but I need only specifies node-modules in the package that is built I tried removing unwanted packages in package.json, it doesn't help me either after refactoring "bundledDependencies": [ "fs", "os", "path", "regedit", "request", "start", "xml2js", "util", "replace", "process", "fs", "console" ], **before refactoring** "bundledDependencies": [

How to add secret variable as task environment variable in VSTS

寵の児 提交于 2019-12-01 17:23:43
This documentation states that secret variables are Not decrypted into environment variables. So scripts and programs run by your build steps are not given access by default. One of my build tasks require that an environment variable be set that is stored in a secret variable. Does this mean it's impossible to do this using secret varaibles in VSTS? If not, how do I do this? For further background, I'm trying to code sign my electron app using electron-builder. It requires that two environment variables be set: CSC_LINK and CSC_KEY_PASSWORD . One of these is the password to a code signing

How to run and pack external executable using Electron?

喜你入骨 提交于 2019-11-30 21:54:19
For example, I have a compiled binary cudaDeviceQuery which returns a list of devices as JSON. Here's a piece of code: export default function cudaDeviceQuery(): Promise<CollectorResponse> { const throwError = () => { throw new Error("Unfortunately your platform isn't yet unsupported"); }; const file = __DARWIN__ ? path.join(__dirname, 'darwin', 'cudaDeviceQuery') : __WIN32__ ? path.join(__dirname, 'win', 'cudaDeviceQuery.exe') : throwError(); const descriptor = spawn(file); return new Promise((resolve, reject) => { let outerData = ''; descriptor.stdout.on('data', data => { outerData += data;

How to run and pack external executable using Electron?

江枫思渺然 提交于 2019-11-30 18:10:40
问题 For example, I have a compiled binary cudaDeviceQuery which returns a list of devices as JSON. Here's a piece of code: export default function cudaDeviceQuery(): Promise<CollectorResponse> { const throwError = () => { throw new Error("Unfortunately your platform isn't yet unsupported"); }; const file = __DARWIN__ ? path.join(__dirname, 'darwin', 'cudaDeviceQuery') : __WIN32__ ? path.join(__dirname, 'win', 'cudaDeviceQuery.exe') : throwError(); const descriptor = spawn(file); return new

How to add folders and files to electron build using electron-builder

岁酱吖の 提交于 2019-11-30 17:02:13
问题 I am creating an electron which running react generated from create-react-app. Then i add nedbjs(a persistence database) and camojs(ODM for nedb) as dependency. To connect react with nedb i use electron ipc. Here is my project structure: And here is my package.json: "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject", "electron-dev": "concurrently \"cross-env BROWSER=none yarn start\" \"wait-on