簡體   English   中英

如何使用 Installshield 將 dll 注冊到 GAC

[英]How to register a dll into GAC with Installshield

我有 installshield 2016 premier,我有一個使用 com dll 的.Net dll。 我的應用程序是一個插件,所以主 exe(它不是我的 exe)在 Windows 中查找 mydll,即使 myplugin 在程序文件中。 當我使用“gacutil.exe -i mydll.dll”時手動運行。 然后 dll 不需要在 windows 文件夾中。

所以我也嘗試了 regasm,但沒有用。 所以我必須以某種方式將 mydll 注冊到 gac 中。 目標機器沒有 gacutil.exe 所以我基本上不能從命令調用。

我查看了 installshield 如何做到這一點,但效果不佳。 我檢查了“self register”和“com extract at build”是的,但是沒有用,我在安裝時遇到了錯誤(因為它不是一個純 com dll,它只引用了一個嵌入互操作類型的 com dll)。 當我選擇 .Net Com Interop settings 時,然后 installshield 它不會構建我的安裝文件。

那么無論如何要在安裝期間/結束時注冊這個 dll 嗎?

更新:當我執行“構建和掃描依賴項”時,它找不到任何東西!

使用 InstallShiled 的“支持文件”功能並將 gacUtil 或 installUtil 放入“支持文件”文件夾,並在安裝結束時運行該實用程序。 這可能有助於解決問題。 這與從命令提示符運行一樣。 有關詳細信息,請參閱鏈接

安裝盾 2019

它支持GAC注冊。 這是自動的。

Com Interop 和 InstallShield

與 Com interop 相關,您必須公開方法:當您注冊 COM Interop 時,您的用戶

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

你得到一個注冊文件。 必須使用 InstallShield 創建此 reg 文件才能正確安裝 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}]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM