简体   繁体   English

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

[英]Visual Studio 2010 Setup Project 64 bit create registry key issue

I have a 64 bit setup project with a 64 bit windows service exe and dlls. 我有一个64位安装项目与64位Windows服务exe和dll。 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();
        }

But it keeps creating registry keys at SOFTWARE\\WOW6432NODE\\SOFTWARE\\FOLDER\\FOLDER\\FOLDER. 但它一直在SOFTWARE \\ WOW6432NODE \\ SOFTWARE \\ FOLDER \\ FOLDER \\ FOLDER创建注册表项。 Btw setup copies exe and dlls under 64bit program files folder. 顺便说一下,在64位程序文件文件夹下复制exe和dll。 No problem in copying folders to 64 bit folder. 将文件夹复制到64位文件夹没问题。

Any idea? 任何的想法?

This happens because your custom action uses a 32-bit process. 发生这种情况是因为您的自定义操作使用32位进程。 Perhaps this article will help: http://blogs.msdn.com/b/heaths/archive/2006/02/01/64-bit-managed-custom-actions-with-visual-studio.aspx 也许这篇文章会有所帮助: http//blogs.msdn.com/b/heaths/archive/2006/02/01/64-bit-managed-custom-actions-with-visual-studio.aspx

Basically, you need to either make it use a 64-bit process or call a function that can write in the 64-bit registry hive. 基本上,您需要使其使用64位进程或调用可以在64位注册表配置单元中写入的函数。

您正在使用.NET 4,使用新的RegistryKey.OpenBaseKey()方法并传递RegistryView.Registry64

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM