如何使用InstallShield在没有管理员权限的情况下为每个用户注册interop .net程序集 [英] How to register interop .net asssembly per user Without Administrator Privileges using InstallShield

查看:342
本文介绍了如何使用InstallShield在没有管理员权限的情况下为每个用户注册interop .net程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在执行一项任务,即在使用instalshield安装过程中注册.net程序集时,不提示普通用户弹出窗口(UAC)批准安装Windows Addin应用程序。在Windows XP上,它可以正常工作,但是在Vista和Windows 7上安装期间,弹出窗口需要批准。按照要求,它不应该来。如果打开了UAC并在没有管理员权限的情况下为每个用户注册了程序集,是否有任何方法可以绕过Vista和Windows 7上的弹出窗口?

I am working on a task not to prompt a normal user a popup(UAC) for approval to install windows Addin application while registering a .net assembly during installation using instalshield. On windows xp, its working fine but during installation on vista and windows 7, a popup comes up for approval. As per the requirement, it shouldnt come. Is there any way to bypass this pop up on vista and windows 7 if UAC is on and registered the assembly per user without administrator privileges?

请帮助吗?

谢谢。

推荐答案

实际上,COM可以按用户或按每个用户注册。 -machine as HKEY_CLASSES_ROOT是从HKEY_CURRENT_USER\软件\类和HKEY_LOCAL_MACHINE\软件\类派生的视图。如果运行regasm /regfile:foo.dll,则可以生成一个regfile,然后更改键名中的所有引用以使其对当前用户而言是本地的。

Actually, COM can be registered per-user or per-machine as HKEY_CLASSES_ROOT is a view derived from both HKEY_CURRENT_USER\Software\Classes and HKEY_LOCAL_MACHINE\Software\Classes. If you run regasm /regfile:foo.dll you can generate a regfile and then change all the references in the key names to make it local to the current user.

在生成的.reg文件中,所有的reg键添加项都将添加到HKEY_CLASSES_ROOT中。您需要用 HKEY_CURRENT_USER\Software\Classes替换它们。

In the .reg file that gets generated, all the reg key additions will be to HKEY_CLASSES_ROOT. You need to replace these with "HKEY_CURRENT_USER\Software\Classes".

此外,如果您需要COM注册才能使用32位应用程序并且正在运行x64 ,然后添加HKEY_CLASSES_ROOT\CLSID,则需要在CLSID令牌之前插入 \Wow6432Node。

Also if you need the COM registration to work with 32 bit applications and you're running x64, then for additions to HKEY_CLASSES_ROOT\CLSID, you'll need to insert "\Wow6432Node" before the CLSID token like.

要清楚,添加 HKEY_CLASSES_ROOT CLSID成为 HKEY_CURRENT_USER软件类 Wow6432Node CLSID。要使其在x86上运行,您只需要对CLSID条目进行此更改。

To be clear, additions to "HKEY_CLASSES_ROOT\CLSID" become "HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID". To make it work on x86 you only need to make this change for CLSID entries.

此外,在某些情况下,您可以考虑通过以下方式使用免费注册COM互操作: EXE的清单文件,它消耗COM服务器以使EXE可以使用ProgID / ClassID,而无需将注册信息实际写入注册表。

Also, in certain situations, you can consider making use of Registration Free COM Interop by creating a manifest file for the EXE that consumes the COM server to make the ProgID/ClassID's available to the EXE without actually writing the registration information to the registry.

这篇关于如何使用InstallShield在没有管理员权限的情况下为每个用户注册interop .net程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆