electron

Exclude some folders, while doing electron-packager . --asar

我是研究僧i 提交于 2019-12-19 10:44:20
问题 I use 'electron-packager . --asar' command to package my project folder. but there are some folders which must not be included while packaging. Is it possible to exclude some of folders? If so, I would like to include those folders in exe file path so that the user can manage their files. Is there any way to do this? Thank you in advance! 回答1: Is it possible to exclude some of folders? Yes, you can do it with ignore You can use --ignore to ignore files and folders via a regular expression

Module version mismatch with headless browser and desktop Node

只谈情不闲聊 提交于 2019-12-19 10:09:20
问题 I'm getting a "Module version mismatch error" when I try to use a headless browser with a desktop Node shell. I've tried Zombiejs and Phantomjs with both nw.js and atom-shell; in both cases as soon as the headless browser comes into play the application crashes with a module mismatch error. Here's the error with Phantomjs and atom-shell: Uncaught Exception: Error: Module version mismatch. Expected 41, got 14. at Error (native) at Object.module.(anonymous function) (ATOM_SHELL_ASAR.js:118:20)

Electron and serial ports

好久不见. 提交于 2019-12-19 09:55:44
问题 I have tried everything to try to get Electron to work with the PCs serial port. Followed all instructions for the serialport (even tried building native modules) without luck. Has anyone had any luck getting Electron to work with serial ports? If so please share your wisdom. 回答1: Here are the commands we run after doing npm install (or after upgrading electron or node-serial). on Mac rm -rf node_modules/serialport/build/* node_modules/.bin/electron-rebuild -w serialport -f ls node_modules

How to use html templates in electron framework?

。_饼干妹妹 提交于 2019-12-19 09:21:39
问题 I need to build a cross platform app with multiple windows. So I would like to know how to use html templates in electron. 回答1: Based on a similar question and what I've seen, there's no built in html template language in Electron, which is actually great because it allows you to use any other template language. I'm currently playing with ejs in Electron. Below is my index.ejs template file: <html lang="en"> <head> <title>The Index Page</title> </head> <body> <h1>Welcome, this is the Index

Require nodejs “child_process” with TypeScript, SystemJS and Electron

不想你离开。 提交于 2019-12-19 05:57:38
问题 I'm working on a simple nodejs electron (formerly known as atom shell) project. I'm writing it using angular 2, using the project the same project setup as they recommend in the documentation for typescript: tsc: { "compilerOptions": { "target": "es5", "module": "system", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": false }, "exclude": [ "node_modules", "typings/main", "typings/main.d.ts

Electron : Create a window above all the others (even fullscreen) and hide taskbar

被刻印的时光 ゝ 提交于 2019-12-19 04:45:14
问题 As the title of my question may be sufficiently understandable, I'll explain anyway. I'm working on a personal project with Electron, and I'm facing a frustrating issue which is : I'd like to create a small window (50x50 px) which would be above every other window, even when those are fullscreen. I mean, even if I'm on Youtube with Chrome and I enter fullscreen, my window would stay on top of it. Basically, I've succeeded in making my window above all the others, a simple setAlwaysOnTop(true)

Accessing filesystem in Angular 2 app using Electron

╄→гoц情女王★ 提交于 2019-12-18 15:51:45
问题 I know that Angular 2 is run on a web browser, which does not have access to the file system. However, I'm using Electron as my front-end, and also running the app via electron: "build-electron": "ng build --base-href . && cp src/electron/* dist", "electron": "npm run build-electron && electron dist" Therefore, I run it with npm run electron which at the very end runs electron dist . Since I'm running through electron and not ng I would think that I should be able to access the filesystem.

Vuex & Websockets

徘徊边缘 提交于 2019-12-18 12:29:27
问题 So currently I am working with VueJS 2 and I am very new with it. Now I was getting some help with some other people, but I am still stuck. Here is what I want to achieve (example - closely linked to what I want): I have a NodeJS application that listens on WebSockets. The application listens for connections via WebSocket and will take JSON data, with a command and then a data object with any content needed for that command. The command for example could be login, and the data be username and

How can I get the path that the application is running with typescript?

被刻印的时光 ゝ 提交于 2019-12-18 12:19:19
问题 I am trying to create a desktop application with electron, angular2, typescript and neDB.In order to be able create a 'file' database with neDB I want the path to my project.How can I get this with typescript ? 回答1: Use app.getAppPath() Typescript is a superset of javascript so you could do it in the same way you would do it with javascript, though you may want to declare typings, or use other typescript features when you do so. Example: const remote = require('remote'), app = remote.require(

How to get the original path of a portable Electron app?

℡╲_俬逩灬. 提交于 2019-12-18 11:57:54
问题 I have an Portable Electron App (packed with: electron-builder + asar, portable build) on Windows. I try to get the application path but it returns a path within the user\temp folder rather than the actual '.exe' file Is there any way to get the original app.exe path? I've tried the following: app.getAppPath() __dirname require.main.filename app-root-path and a few node modules The path I'm getting from my tests: C:\Users\xxx\AppData\Local\Temp\xxxxxx.tmp\app the actual .exe Path (where the