question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NSIS install for all users (program files), childProcess requires (spawn) run as administrator by Windows

See original GitHub issue

I have created a nsis installer for my electron app using the following build:

"build": {
        "appId": "my.app.id",
        "asar": false,
        "win": {
            "icon": "icon.png",
            "publisherName": "company inc"
        },
        "directories": {
            "buildResources": "src/electron/build",
            "output": "dist/electron",
            "app": "src/electron"
        },
        "publish": {
            "provider": "generic",
            "url": "my url",
            "channel": "latest"
        },
	"nsis": {            
            "perMachine": true,
            "allowToChangeInstallationDirectory": true,
            "allowElevation": true,
            "oneClick": false
        }
    }

When I try to install, windows shows the UAC dialog, and installs the app under “Program Files” folder. When I open the app, electron window shows up and the content is just fine, however the childProcess that I create using “spawn” in the main process does NOT run unless I open the app as “administrator” once. After that all is good, any ideas?

Electron Version: 1.8.4 Electron Builder Version: 20.8.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

1reaction
freddy-danielcommented, Sep 2, 2019

But how to make app data for all users instead of user profile?

0reactions
Hari-Muniganticommented, Oct 20, 2020

I am facing same issue. when i run the application as admin it is working fine. But when i run as non-admin user it is not working as expected. In my case it is creating folder and file in C:\Program Files (x86)\app where app folder is created. It is giving following errors Uncaught Error: EPERM: operation not permitted, open Uncaught Error: EPERM: operation not permitted, mkdir

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fork not working with Electron's NSIS installer
I'm running the program on Windows as administrator. The logs when running the installed app: Script to be ran: C:\Program Files\electron-app\ ...
Read more >
Multi-User Header File (MultiUser.nsh)
The execution level determines the privileges of the installer application. For example, to install hardware drivers, administrator privileges are required.
Read more >
gyp env: python: no such file or directory
If you're using Windows you can now install all node-gyp dependencies with single command (NOTE: Run As Admin in Windows PowerShell):.
Read more >
UAC and launching an exe on Finish - NSIS Forums
Currently, when I run the exe through command line by choosing "Run as administrator", the application works fine, the web service starts ...
Read more >
How to create a windows installer for an application built ...
Developers just need to provide a package for a distribution, each distribution then has a way to install this package and this way...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found