如何使用Installshield将dll注册到GAC [英] How to register a dll into GAC with Installshield

查看:89
本文介绍了如何使用Installshield将dll注册到GAC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有installshield 2016 Premier,并且我有一个使用com dll的.Net dll。我的应用程序是一个插件,因此主要exe文件(不是我的exe文件)正在Windows中查找mydll,即使myplugin位于程序文件中。当我使用 gacutil.exe -i mydll.dll时,它可以手动运行。那么dll不需要放在Windows文件夹中。

I have installshield 2016 premier and I have a .Net dll that uses a com dll. My application is a plugin so the main exe (its not my exe), is looking mydll in windows even myplugin is in program files. Manually when I use "gacutil.exe -i mydll.dll" it works. Then the dll is not need to be in windows folder.

所以我也尝试了重新加气,但是没有用。所以我必须以某种方式将mydll注册到gac中。
目标计算机没有gacutil.exe,因此我基本上不能从命令中调用。

So I tried also regasm but it did not work. So i have to register mydll into gac somehow. The target machine has not gacutil.exe so i cannot call basically from command.

我研究了installshield如何做到这一点,但效果不佳。我检查了自我注册和在构建时提取COM,但是没有用,并且在安装时出现错误(因为它不是纯com dll,它仅引用了具有嵌入式互操作类型的com dll)。当我选择.Net Com Interop设置是,然后installshield不能建立我的安装文件。

I looked at how installshield can do that but it did not work as well. I checked "self register" and "com extract at build" yes but did not work and i got an error while installing (because its not a pure com dll, it has only referenced a com dll with embed interop type). When I choose .Net Com Interop settings Yes, then installshield it not build my setup file.

那么在安装过程中/安装结束时是否有要注册该dll的信息?

So Is there anyway to register this dll during/end of installation?

更新:当我执行构建和扫描依赖项时,找不到任何东西!

Update: When i do "build and scan dependencies", it cannot find anything!

推荐答案

InstallShield 2019



它支持GAC注册。这是自动的。

InstallShield 2019

It support GAC registration. This is automatic.

与Com interop有关,您必须公开该方法:
当您注册COM Interop时,您的用户

Related to Com interop, you have to expose the method: When you register a COM Interop you users


C:\WINDOWS\Microsoft.NET\Framework\ v4.0.30319\RegAsm.exe /代码库%System32%\YourComInterop.dll /regfile:\"YourComInterop.reg

"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" /codebase "%System32%\YourComInterop.dll" /regfile:"YourComInterop.reg"

您得到一个reg文件。必须使用InstallShield创建此reg文件,以便正确安装通讯互操作。

You get a reg file. This reg file have to be created with InstallShield in order to intall properly the comm interop.

    REGEDIT4

    [HKEY_CLASSES_ROOT\Your.Com.Interop.Namespase]
    @="Your.Com.Interop.YourFunction"

    [HKEY_CLASSES_ROOT\Your.Com.Interop.Namespase\CLSID]
    @="{42532EFE-D9FF-4135-A9A7-677E54024A81}"

    [HKEY_CLASSES_ROOT\CLSID\{42532EFE-D9FF-4135-A9A7-677E54024A81}]
    @="Your.Com.Interop.YourFunction"

    [HKEY_CLASSES_ROOT\CLSID\{42532EFE-D9FF-4135-A9A7-677E54024A81}\InprocServer32]
    @="mscoree.dll"
    "ThreadingModel"="Both"
    "Class"="Your.Com.Interop.YourFunction"
    "Assembly"="YourComInterop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b1eedcf58a40cdb8"
    "RuntimeVersion"="v4.0.30319"
    "CodeBase"="file:///C:/Windows/System32/YourComInterop.dll"

    [HKEY_CLASSES_ROOT\CLSID\{42532EFE-D9FF-4135-A9A7-677E54024A81}\InprocServer32\1.0.0.0]
    "Class"="Your.Com.Interop.YourFunction"
    "Assembly"="YourComInterop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b1eedcf58a40cdb8"
    "RuntimeVersion"="v4.0.30319"
    "CodeBase"="file:///C:/Windows/System32/YourComInterop.dll"

    [HKEY_CLASSES_ROOT\CLSID\{42532EFE-D9FF-4135-A9A7-677E54024A81}\ProgId]
    @="Your.Com.Interop.Namespase"

    [HKEY_CLASSES_ROOT\CLSID\{42532EFE-D9FF-4135-A9A7-677E54024A81}\Implemented Categories\{62C8FE65-4EBB-45E7-B440-6E`enter code here`39B2CDBF29}]

这篇关于如何使用Installshield将dll注册到GAC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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