Quantcast
Channel: electron - Atom Discussion
Viewing all 523 articles
Browse latest View live

Electron silent install for Windows

$
0
0

Hi guys. I’m using Electron builder (v22.7.0) for the packaging of the Electron app. In order to support changing the install location through the installer (UI) for the Windows user, nsis flag allowToChangeInstallationDirectory is set to true in the build configuration:

nsis: {
   allowToChangeInstallationDirectory: true,
   oneClick: false,
   perMachine: false
}

If I try to install the app in silent mode using a terminal, the assist window for choosing the install location will be shown. The command that I’m using is:

cd %USERPROFILE%\Downloads\ & {app-name}.exe /sd /currentuser

Question: How to hide that window only in the silent mode?

1 post - 1 participant

Read full topic


How does the chrome.runtime.sendMessage work?

$
0
0

Hello,

I am loading chrome extensions into my electron application. A lot of extensions use the “chrome.runtime.sendMessage” (and related) API to exchange messages between the different scripts.

I have implemented a popup (“browser action”) mechanism for the extension, however the messages exchanged between the parts of the extension do not succeed and give an error message of “Error: Could not establish connection. Receiving end does not exist.”.

How can I “connect” the parts of the extension?

On https://www.electronjs.org/docs/api/extensions, the docs mention that this API is suppositely implemented, but I can’t find any additional information on that and how I can register the receiving end.

1 post - 1 participant

Read full topic

How do i Add a Custom Right Click Menu

$
0
0

I want to add a Custom Menu for when a User Right Click
(for Context I am Making a Game And i want to Remove the drop-down Menu I have Set Up ( i am using it as a Debug menu) and use a Right Click menu as the game’s Menu I am Open to using Anything
just be Clear if you link a Guide please let it be Recent and have it refer to Electron version 10.1.2 as well as it being Detailed but simple

Thanks in Advance

1 post - 1 participant

Read full topic

Problems with the "Squirrel" installer

Gem build fictional-disco.gemspec

Can openPath API open file without using default app?

$
0
0

I can use openPath API to open file, for example, I opened a jpg file and openPath API called Photos application as my image viewer because it is my default application to view image in Windows10.

If I want to use Paint to view image instead of using Photos and don’t want to adjust the default viewer’s setting from Windows10, how can I achieve this goal by using Electron?

Is there any Electron API can use or any workaround?

2 posts - 2 participants

Read full topic

TypeError: Cannot read property **** of undefined

$
0
0

I need help. This has eaten my time now for days. I have been facing issues with “TypeError: Cannot read property **** of undefined” while using sessions and dialogs. I believe the issue flows on to other APIs I haven’t needed just yet…

tryinging this
session.defaultSession.cookies.get({}) for example results to: “TypeError: Cannot read property ‘defaultSession’ of undefined”

1 post - 1 participant

Read full topic

Electron and thermal printe

$
0
0

Somebody knows a library or something tools to have connection between electron and thermal printer?

1 post - 1 participant

Read full topic


Error using Electron 10 with requirejs

$
0
0

Could use help with the following:
I have been using requirejs (latest) with Electron, but since Electron 10 it returns the following error:

node_modules/requirejs/bin/r.js:1
(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { #!/usr/bin/env node

                                                                                                                                                           ^
SyntaxError: Invalid or unexpected token
    at new Script (vm.js:88:7)
    at createScript (vm.js:261:10)
    at Object.runInThisContext (vm.js:309:10)
    at wrapSafe (internal/modules/cjs/loader.js:1047:15)
    at Module._compile (internal/modules/cjs/loader.js:1108:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
    at Module.load (internal/modules/cjs/loader.js:992:32)
    at Module._load (internal/modules/cjs/loader.js:885:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12694)
    at Module.require (internal/modules/cjs/loader.js:1032:19)

1 post - 1 participant

Read full topic

Building for Apple Silicon only wants to build x64

$
0
0

I have an existing electron app that I’m tryin to build for Apple Silicon. Running on my new M1 based computer, I have gotten everything to work… other than when it comes to actually build it says the following:

Making for the following targets: zip, dmg

:heavy_check_mark: Making for target: zip - On platform: darwin - For arch: x64

:heavy_check_mark: Making for target: dmg - On platform: darwin - For arch: x64

To be clear, it is running electron 11, the native modules build, the app signs and it runs. But it just is on x64.

This is using electron forge as the original template. My build configuration is in this file:

let baseConfig = {

packagerConfig: {
icon: “./src/icons/icon.icns”,
appBundleId: “com.bensresearch.assessmentdisaggregation”,
appCategoryType: “public.app-category.education”,
osxSign: {
identity: process.env.APPLE_CERT,
hardenedRuntime: true,
entitlements: “entitlements.plist”,
“entitlements-inherit”: “entitlements.plist”,
“gatekeeper-assess”: false
},
osxNotarize: {
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEID_PASSWORD
}
},
makers: [{
name: “@electron-forge/maker-squirrel”,
config: {
certificateFile: process.env.WINDOWSCERT,
certificatePassword: process.env.WINDOWSPASSWORD,
},
platforms: [
“win32”
]
},
{
name: “@electron-forge/maker-zip”,
platforms: [
“darwin”,
“darwin-arm64”
]
},
{
name: “@electron-forge/maker-dmg”,
config: {
name: “Assessment Disaggregation”,
icon: “./src/icons/icon.icns”
},
platforms: [
“darwin”,
“darwin-arm64”
]
},
{
name: “@electron-forge/maker-deb”,
config: {
options: {
maintainer: ‘Ben Smith’,
homepage: ‘https://www.assessmentdisaggregation.org/’,
icon:"./src/icons/icon.png",
name: “Assessment-Disaggregation”
}
}
},
{
name: “@electron-forge/maker-rpm”,
config: {}
}
],
publishers: [{
name: ‘@electron-forge/publisher-github’,
config: {
repository: {
owner: ‘tazzben’,
name: ‘Assessment-Disaggregation’
},
authToken: process.env.GITHUB_TOKEN
}
}]
};

I added the darwin arm64 items based on the blog post here:

Any ideas?

1 post - 1 participant

Read full topic

Need help to understand test under electron

$
0
0

Hi,

I joined a team that is currently working on an electron app. I have no skill in test (unitest, functionnal test, etc) and there are a couple of thing that i understand.

For example : testing ipc it’s unit or functionnal ? In unit test currently in place they test IPC with an eventEmitter, but how doing if i want to use the invoke / handle method of ipcMain / ipcRenderer ?

For correctly test ipc, if i have understand, we need to use spectron ? Someone have time and skills for chat a little about all of this ?

Thansk a lot to anyone

1 post - 1 participant

Read full topic

Using Electron 10 with Requirejs returns an error

$
0
0

(topic withdrawn by author, will be automatically deleted in 24 hours unless flagged)

1 post - 1 participant

Read full topic

How can i see changes i made from frappe App API in Atom

$
0
0

HI ATOM
please help in this
i am working on Frappe FrameWork For customization i chose ATOM as my Text editor
now i want to see any change i make from the browser with frappe UI i want see how the code changed from ATOM >
thank you for response

1 post - 1 participant

Read full topic

Electron PDF Viewer Open Params

$
0
0

Greetings everyone!

Im facing a problem. I am trying an display an PDF File insider my electron application. The PDF can be displayed. Now i would like to disable every kind of button/toolbar/navigaton. I found an document about the opening parameters but im not sure if its outdated:

I am opening the PDF with the following Parameters:

“#view=Fit&scrollbar=0&toolbar=0&navpanes=0&statusbar=0”

“statusbar=0” and “view=Fit” are the only params that are working and im wondering why?

Screenshots below.

As you can see there are still some buttons to change the zoom and the scrollbar appears aswell. I would expect no buttons and no scrollbar, due to the param im using to open the pdf.

If anyone has some ideas or a hint, that would be awesome!

Simon!

code|690x492

view

1 post - 1 participant

Read full topic

Migrating from electron-builder/electron-webpack to electron-forge

$
0
0

I’ve mostly migrated my application from electron-webpack (which uses electron-builder under the hood) to electron-forge, and I’m seeking any advice or suggestions on how best to handle migrating the users of my application, which is using electron-updater to new versions of the app built with electron-forge.

For the existing users, they are using, for macOS a DMG artefact being built and published onto GitHub releases. For Windows users, it is using NSIS.

With electron-forge, I can build a DMG for macOS and Squirrel.Windows for Windows and then use the GitHub publisher to upload to a GitHub release.

I’m assuming though that perhaps both the macOS and Windows releases will not auto-update to the corresponding artefacts built by electron-forge - perhaps the DMG for macOS? But likely not NSIS -> Squirrel.Windows?

Any support or advice would be much appreciated.

1 post - 1 participant

Read full topic


I can't seem to find out - how do apps such as Messenger and Discord manage to hide their database details and keep their account system safe?

$
0
0

So, I wouldn’t call myself an experienced programmer yet, so I still can’t understand how is this magic trick done. As far as I know, Electron does not hide your source code - anyone can get their hands on it. How do these big companies manage to keep themselves and their users safe? The only thing that comes to my mind is some kind of a request to their servers that validate the user’s input and retrieve the needed information for their session. But even with that concept in my head, I’m not sure with what exactly can it be done.

4 posts - 4 participants

Read full topic

indexDb data deleting on electron autoupdate

$
0
0

we have encountered a strange issue in our app. For some of our users the app data files were deleted when the electron app updated to a new version using autoupdater in electron.

We are not maintaining the index Db in our application root folder. But we do not know why this issue was occurred . please provide a solution to this as the users data is important for the application.

Note : path of the app is “C:\Users<User name>\AppData\Local<Application name>”
path of the indexdb and other local storage files is “C:\Users<User name\AppData\Roaming<Application Name>\IndexedDB”

1 post - 1 participant

Read full topic

Bug when moving from Electron 9.3.2 to 11.0.3

$
0
0

Hello,
My app works fine with Electron’s version 9.3.2, but with 11.0.3:
There are slowdowns in the game on Windows 10 32-bit (2Go RAM).
The splash screen gif is not visible on every Windows versions.
My GitHub repository :
https://github.com/Lob2018/Choux-Win
I don’t understand why

1 post - 1 participant

Read full topic

Electron Forge Webpack Externals

$
0
0

How can you use tthe plugin @electron-forge/plugin-webpack without it bundling every module? The modules that I import in the main process do not support being bundled with webpack. I saw the module webpack-node-externals but it does not include the modules in a node_modules folder.

1 post - 1 participant

Read full topic

How to configure in forge.config.js two different renderer processes?

$
0
0

I need to open a second electron browserWindow in an Electron-React-Typescript app which I’m building using Electron-Forge,
and I tried to configure in forge.config.js two different renderer processes:

/* eslint-disable @typescript-eslint/no-var-requires */
// Forge Configuration
const path = require('path');
const rootDir = process.cwd();

module.exports = {
  // Packager Config
  packagerConfig: {
    // Create asar archive for main, renderer process files
    asar: true,
  },
  // Forge Makers
  makers: [
    {
      // Squirrel.Windows is a no-prompt, no-hassle, no-admin method of installing
      // Windows applications and is therefore the most user friendly you can get.
      name: '@electron-forge/maker-squirrel',
      config: {
        name: 'trial_ipc_2020',
      },
    },
    {
      // The Zip target builds basic .zip files containing your packaged application.
      // There are no platform specific dependencies for using this maker and it will run on any platform.
      name: '@electron-forge/maker-zip',
      platforms: ['darwin'],
    },
    {
      // The deb target builds .deb packages, which are the standard package format for Debian-based
      // Linux distributions such as Ubuntu.
      name: '@electron-forge/maker-deb',
      config: {},
    },
    {
      // The RPM target builds .rpm files, which is the standard package format for
      // RedHat-based Linux distributions such as Fedora.
      name: '@electron-forge/maker-rpm',
      config: {},
    },
  ],
  // Forge Plugins
  plugins: [
    [
      // The Webpack plugin allows you to use standard Webpack tooling to compile both your main process code
      // and your renderer process code, with built in support for Hot Module Reloading in the renderer
      // process and support for multiple renderers.
      '@electron-forge/plugin-webpack',
      {
        // Main process webpack configuration
        mainConfig: path.join(rootDir, 'tools/webpack/webpack.main.js'),
        // Renderer process webpack configuration
        renderer: {
          // Configuration file path
          config: path.join(rootDir, 'tools/webpack/webpack.renderer.js'),
         // Entrypoints of the application
          entryPoints: [
            {
              // React Hot Module Replacement (HMR)
              rhmr: 'react-hot-loader/patch',
              // HTML index file template
              html: path.join(rootDir, 'src/index.html'),
              // Renderer
              // https://www.electronjs.org/docs/tutorial/quick-start#main-and-renderer-processes
              // https://github.com/electron-userland/electron-webpack/issues/47
              //js: path.join(rootDir, 'src/renderer.ts'),
              js: path.join(rootDir, ['src/renderer.ts', 'src/renderer-2.ts']),
              // Main Window
              name: 'main_window',
              // Preload
              preload: {
                js: path.join(rootDir, 'src/preload.ts'),
              },
            },
          ],
        },
      },
    ],
  ],
};

Got this error:

(base) marco@pc01:~/webMatters/electronMatters/trial-ipc$ yarn start
yarn run v1.22.5
$ cross-env NODE_ENV=development electron-forge start
✔ Checking your system
✔ Locating Application
Failed to load: /home/marco/webMatters/electronMatters/trial-ipc/tools/forge/forge.config.js

An unhandled rejection has occurred inside Forge:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array
    at validateString (internal/validators.js:121:11)
    at Object.join (path.js:1039:7)
    at Object.<anonymous> (/home/marco/webMatters/electronMatters/trial-ipc/tools/forge/forge.config.js:66:24)

So… I have two questions:
is it feasible to open two browserWindow using electron-forge as tool for creating and managing the electron app?
And how to properly do it?

Looking forward to your kind help

2 posts - 2 participants

Read full topic

Viewing all 523 articles
Browse latest View live