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

Access is denied #71

Closed sheinin closed 4 years ago

sheinin commented 4 years ago

When running build of installer app this following error results:

Error: access is denied

at Object.<anonymous> (C:\Users\ServoyPC\AppData\Local\BizmanualzOnPolicy\app-1.0.0\resources\app.asar\node_modules\regedit\errors.js:29:13)
at Object.<anonymous> (C:\Users\ServoyPC\AppData\Local\BizmanualzOnPolicy\app-1.0.0\resources\app.asar\node_modules\regedit\errors.js:553:3)
at Module._compile (module.js:642:30)
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (module.js:586:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\MyPC\AppData\Local\Biz\app-1.0.0\resources\app.asar\node_modules\regedit\index.js:6:14)

it works when running the app with npm or packaged app. Perhaps electron-winstaller blocks access to registry.

rewasa commented 4 years ago

I've the same Problem. I need elevated privilege to do my entry. With this component I could do this: https://www.npmjs.com/package/sudo-prompt

Like so: const options = { name: "Test" }; sudo.exec("reg add HKCU\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAUShutdownOption /t REG_DWORD /d 0x00000001", options, (error:any) => { error && console.log(error); } );

Maybe it helps Someone

sheinin commented 4 years ago

Found a solution with "windows-elevate".