kessler / node-regedit

Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host
MIT License
279 stars 45 forks source link

module not working when electron app launched at windows startup #74

Closed nikhell86 closed 2 years ago

nikhell86 commented 4 years ago

We are using npm-regedit module to read/write registry in Windows. We are using it in an electron app. Normally when we run the application it works fine but when we set the app to run automatically at startup the regedit module fails when app starts at startup. We get the following error on reading "HKCU/SOFTWARE": Error: Command failed: cscript.exe //Nologo D:\CodeLathe\Workspace\cl-fc-client\clouddrive2service\ui\dist_electron\win-unpacked\resources\app.asar\vbs\regList.wsf A HKCU\SOFTWARE

Opening the app manually after startup works fine

technicallyty commented 4 years ago

Strange, my app did this as well, but it didn't stop when opening it manually. Did you perhaps miss this?:

https://www.npmjs.com/package/regedit#a-note-about-electron

zhangkaixuan commented 3 years ago

ah... my app did this as well.... how to fix it?

kessler commented 2 years ago

did the note about electron helped?

nikhell86 commented 2 years ago

no the note on electron did not help .. We stopped using this module due to this issue

kessler commented 2 years ago

I see. Do you want us to debug this together or are you happy with your other solution? (in which case I will proceed to close this issue)

nikhell86 commented 2 years ago

I am happy with my solution. If you want to debug it, it's easy to recreate, we just need a minimal electron app which runs at Windows startup. We need to try doing operations with this module in app.on('ready') event.. If you need any help I could try to find some time out to help

kessler commented 2 years ago

@nikhell86 if you want to create a repo with a minimal app and a script that installs it on a windows machine to launch at startup it will be a tremendous help

HwangTaehyun commented 2 years ago

Same problem in window service. I changed my code that always use externalVBSLocation and always use setExternalVBSLocation function in dev and prod electron app

kessler commented 2 years ago

@HwangTaehyun we will need a minimal recreation of the problem in order to help.

A-ANing commented 11 months ago

https://github.com/ironSource/node-regedit/issues/60#issuecomment-1635270787

this

A-ANing commented 11 months ago

We are using npm-regedit module to read/write registry in Windows. We are using it in an electron app. Normally when we run the application it works fine but when we set the app to run automatically at startup the regedit module fails when app starts at startup. We get the following error on reading "HKCU/SOFTWARE": Error: Command failed: cscript.exe //Nologo D:\CodeLathe\Workspace\cl-fc-client\clouddrive2service\ui\dist_electron\win-unpacked\resources\app.asar\vbs\regList.wsf A HKCU\SOFTWARE

Opening the app manually after startup works fine

Hi, I used Electron, just like your situation. Which plugin did you switch to and access the registry