Visual Studio 2010的安装项目的64位创建注册表项问题注册表、项目、问题、Studio

2023-09-08 09:10:58 作者:=一枚奇葩奇葩男纸~~~

我有一个64位的安装项目在64位的Windows服务的EXE和DLL。在我的安装程序类我创建注册表项与此code:

I have a 64 bit setup project with a 64 bit windows service exe and dlls. In my installer class i create registry keys with this code:

using (typeKey = typeKey.CreateSubKey(@"SOFTWARE\Folder\Folder\Folder"))
        {
            typeKey.SetValue("Type", 0);
            typeKey.Close();
        }

但它一直在SOFTWARE \ WOW6432NODE \ SOFTWARE \文件夹\文件夹\文件夹中创建注册表项。 顺便说一句设置副本下的64位程序文件夹EXE和DLL。在复制文件夹到64位的文件夹没有问题。

But it keeps creating registry keys at SOFTWARE\WOW6432NODE\SOFTWARE\FOLDER\FOLDER\FOLDER. Btw setup copies exe and dlls under 64bit program files folder. No problem in copying folders to 64 bit folder.

你知道吗?

推荐答案

您使用的是.NET 4,使用新的 RegistryKey.OpenBaseKey()的方法,并通过RegistryView.Registry64

You are using .NET 4, use the new RegistryKey.OpenBaseKey() method and pass RegistryView.Registry64