15

I have an installation project that needs to add 1 simple string to the registry, and the built in Registry Editor in the Setup Project doesn't seem to work at all. It puts a base key HKEY_LOCAL_MACHINE\Software\[Manufacturer] by default into the install project, and that doesn't even work.

Here are the steps I used to add the key.

  • Right click setup project: View --> Registry
  • A mock Registry is displayed and I drill down creating keys as needed.
  • I create HKEY_LOCAL_MACHINE\Software\[Manufacturer]\[ProductName]
  • Run the installer. No errors are reported, but keys do NOT exist.

EDIT: Take a look at figure 5 on this webpage. It shows you kinda of what I see except in what looks like a much older version of visual studio.

I don't see how this could fail, it should be so simple. I've even tried simple keys and it just won't create anything, or at least throw an error. I've seen this solution but its ridiculous to add a post build step to manually edit the registry when there is built in functionality to do it. That post indicates that the feature is just broken, so don't use it.

Community
  • 1
  • 1
Ultratrunks
  • 2,464
  • 5
  • 28
  • 48

1 Answers1

21

If you have a 32-bit installer the keys will be redirected under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ key

More details you can find here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa384232(v=vs.85).aspx

Bogdan Mitrache
  • 10,536
  • 19
  • 34
Ciprian
  • 3,533
  • 1
  • 18
  • 22
  • 2
    You know, I actually new about this, it just didn't pop into my head. Now I'm embarrassed about the rage it put me in yesterday for 2 hours. – Ultratrunks Jun 26 '12 at 16:22
  • My scenario does not add the key to either 32/64 bit tree folder. My setup is like the poster details. – Veverke Jun 20 '17 at 07:41
  • Adding to the answer: You can just change the TargetPlatform property under the Setup properties to x64 if needed. – ojonasplima Oct 17 '22 at 20:54