Skip to content
⌘ NSIS Forum Archive

How to copy a registry key?

8 posts

bluenet#

How to copy a registry key?

ReadRegStr and WriteRegStr only copy REG_SZ.How to detect a entry is String,DWORD or Binary?.
Joost Verburg#
A certain value of an application always has a certain type.

You can browse the registry and view all types using the Windows registry editor.
bluenet#
It is useful in files ASSOC.Such as "HKCR\.mp3",it originality default value is "foobar2000.mp3",and "HKCR\foobar2000.mp3" contain some context menu "HKCR\foobar2000.mp3\shell\enqueue", "HKCR\foobar2000.mp3\shell\play".
If I change "HKCR\.mp3" default value to Winamp.file,the context menu will be lost.
So I want to copy the whole key "HKCR\foobar2000.mp3" to "HKCR\Winamp.file" and then doing FileAssoc.
This would keep the context menu.
These is a instance in ACDSee 3.1 SR1's FileAssoc.
Or somebody may a plugins like
CopyReg::Copy SRC_ROOT_KEY SRC_SUB_KEY DEST_ROOT_KEY DEST_SUB_KEY£¿
Joost Verburg#
You can create a NSIS plug-in using this code:



(this site doesn't seem to work right now, so you may want to use the Google cache)
iceman_k#
Try the attached nsh file. There is an example script as well.
This has been tested with Windows 2000 and Windows XP. I don't know if it will work with Win9x or WinNT, which is why I haven't uploaded to the archive.