Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regedit.putValue():error:unsupported hive #109

Open
lister0701 opened this issue Jul 27, 2022 · 7 comments
Open

regedit.putValue():error:unsupported hive #109

lister0701 opened this issue Jul 27, 2022 · 7 comments

Comments

@lister0701
Copy link

lister0701 commented Jul 27, 2022

My Code:
image
image

Exception:
image

I feel very strange, clearly has been modified successfully
image

Brothers, please help me.

@gggscript
Copy link

At /lib/helper.js line 14 you need to patch the write function to

function write(m) {
  if (m) {
    var b = module.exports.encode(m)
    debug(b)
    return stream.write(b)
  }
  return false
}
function write(m) {
+  if (m) {
    var b = module.exports.encode(m)
    debug(b)
    return stream.write(b)
+  }
  return false
}
```

@gggscript
Copy link

Or if you want to support falsy values, change the whole function to:

module.exports.writeArrayToStream = function(arr, stream, optionalCallback) {
	function write(m) {
		if (m) {
      var b = module.exports.encode(m)
			debug(b)
			return stream.write(b)
    }
		return false
	}

	while (arr.length) write(arr.pop())

	if (arr.length === 0) {
		stream.write(WIN_EOL, optionalCallback)
		return
	}

	stream.once('drain', function() {
		module.exports.writeArrayToStream(arr, stream, optionalCallback)
	})
}

@filmerjarred
Copy link

reverting to 5.0.0 solved it for me :)

@kessler
Copy link
Owner

kessler commented Feb 19, 2023

@lister0701 please try version 5.1.2 and let me know if it solved your problem.

@Dufftwt
Copy link

Dufftwt commented Dec 11, 2023

@kessler Hi man, sorry for bringing this back up so late, but this is still a problem in 5.1.2, I'm using Win 11 and here's my current code, I just want to list apps that start up

const promisifiedRegedit = require('regedit').promisified;

async function main() {
    const listResult = await promisifiedRegedit.list('HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run');
    console.log(listResult);
}
  
main();
```

@kessler
Copy link
Owner

kessler commented Dec 11, 2023

will look into it.

@Namicici
Copy link

@kessler Hi man, sorry for bringing this back up so late, but this is still a problem in 5.1.2, I'm using Win 11 and here's my current code, I just want to list apps that start up

const promisifiedRegedit = require('regedit').promisified;

async function main() {
    const listResult = await promisifiedRegedit.list('HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run');
    console.log(listResult);
}
  
main();

replace 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run' to 'HKCU\Software\Microsoft\Windows\CurrentVersion\Run'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants