How to register a .NET DLL using Inno Setup

前端 未结 2 1631
野的像风
野的像风 2021-02-20 17:50

I have written a class library using Visual Studio 2010 C# to read hardware information of a Computer (e.g. HDD/SSD). I will use this dll to create an installer using InnoSetup

相关标签:
2条回答
  • 2021-02-20 17:55

    Though its more than a year, I recently had the same problem and was able to rectify using the below script.

    [Run]
    Filename: "{dotnet20}\RegAsm.exe"; Parameters: /codebase YourDLL.dll; WorkingDir: {app}; StatusMsg: "Registering Controls..."; Flags: runminimized
    

    If the file has be registered at initialize step, we can use one of the Inno setup's support functions.

    function Exec(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;

    More Info can be found in: Inno Setup Help

    0 讨论(0)
  • 2021-02-20 18:00

    To do this, you MUST..

    1) make sure that .net 4.0 is installed (not by default on most machines yet)

    2) extract and register the DLL (you need to call regasm.exe on the extracted DLL)

    This is a lot to do just to "GetDiskDriveInformation" as the very first step of the install.

    It is far better to get the information natively in Inno or call a native DLL that doesn't have the prerequisites.

    0 讨论(0)
提交回复
热议问题