为什么regasm/regfile看起来不完整? [英] Why does regasm /regfile seem incomplete?

查看:109
本文介绍了为什么regasm/regfile看起来不完整?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.NET程序集,我需要在安装时进行注册.我注意到直接使用regasm与通过regasm的注册表脚本进行安装时,注册表有细微的差别.

I have a .NET assembly I need to register at install time. I'm noticing that the registry has subtle differences when regasm is used directly versus being installed via regasm's registry script.

这是我的考试:

我导出原始的HKCR配置单元,然后运行:regasm my.dll

I export the original HKCR hive, then run: regasm my.dll

从那里,我导出后续的HKCR配置单元,并比较差异.

From there, I export the subsequent HKCR hive and performance a diff.

然后我将该差异与regasm my.dll /regfile

有一些非常重要的条目是通过regasm my.dll添加的,这些条目永远不会与regasm命令的注册表文件输出一起添加. 为什么?

There are a couple very important entries that get added via regasm my.dll that will never get added with the registry file output from the regasm command. Why?

从安装的角度来看,我非常讨厌在安装过程中调用regasm.我宁愿只运行此.reg脚本.我现在正在使用InstallShield,它在后台也缺少额外的注册表项(似乎它嵌入了用/regfile标志输出的注册表更改).

From an install point-of-view, I'd very much hate to call regasm during the install process. I'd rather just run this .reg script. I'm using InstallShield now, which under the hood is also missing the extra registry entries (it seems like it embeds the registry changes outputted with the /regfile flag).

推荐答案

您可以使用/regfile选项来生成一个.reg文件,其中包含 注册表项,而不是直接对注册表项进行更改 注册表.您可以通过导入以下文件来更新计算机上的注册表: .reg文件与注册表编辑器工具(Regedit.exe).请注意 .reg文件不包含可以通过以下方式进行的任何注册表更新 用户定义的寄存器功能.请注意,仅/regfile选项 发出托管类的注册表项.该选项不发光 TypeLibID或InterfaceID的条目.

You can use the /regfile option to generate a .reg file that contains the registry entries instead of making the changes directly to the registry. You can update the registry on a computer by importing the .reg file with the Registry Editor tool (Regedit.exe). Note that the .reg file does not contain any registry updates that can be made by user-defined register functions. Note that the /regfile option only emits registry entries for managed classes. This option does not emit entries for TypeLibIDs or InterfaceIDs.

InstallShield具有一个名为".NET COM Interop"的设置,该设置基本上告诉构建引擎执行regasm/regfile并将结果转换为注册表表,然后再构建MSI.您可以根据需要继续执行此操作,但必须静态添加额外的内容.

InstallShield has a setting called ".NET COM Interop" that basically tells the build engine to perform a regasm /regfile and transform the results into the registry table before building the MSI. You can keep doing this if you want but you'll have to add the extra stuff statically.

这篇关于为什么regasm/regfile看起来不完整?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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