1

I use Inno Setup for creating my setup. All works fine, but I run into the problem: how to register the .NET DLL to make it accessable by COM+. As we all know .NET brings RegSvcs.exe for that so I checked the Inno Setup documentation and only found gacinstall which is for Assembly registration, but not use for COM+ interactions. So I added this in the [Run] section

; register .Net components for com+
Filename: {win}\Microsoft.NET\Framework\v4.0.30319\RegSvcs.exe; Parameters: "{app}\bin\Common.dll"; Description: Component registration; WorkingDir: {app}\bin; StatusMsg: Component registration...; Flags: waituntilterminated

But by testing the setup this line is just skipped. The DLL is copied to the target before in the [Files] section and is available. After setup I can manually run RegSvcs.exe from command line as well without a problem.

9
  • 1
    Just a hint (not a solution to your problem), you can use the {dotnet40} constant in your file path to get .NET 4.0 path depending on what mode the setup runs (32-bit or 64-bit), or use {dotnet4032} to get 32-bit .NET 4.0 path or {dotnet4064} for 64-bit. It removes your path hardcoding.
    – TLama
    Aug 14, 2012 at 8:50
  • But what you're describing is strange, from a first look at it I can't see anything wrong (maybe I would remove the WorkingDir, but it shouldn't be a problem I think). Anyway what version of Windows are you using, Vista up ? If so, are you running your setup elevated as admin ?
    – TLama
    Aug 14, 2012 at 9:19
  • The target platform are normally win 2008 R2 systems. Setup always runs with admin priviledges.
    – YvesR
    Aug 14, 2012 at 9:24
  • I was asking because I'm suspecting your library was registered, but to a different registry node - not under user's root. Maybe you can try to add the runasoriginaluser flag to your run entry, but it's still just a guess...
    – TLama
    Aug 14, 2012 at 9:27
  • 1
    I run into this issue when my target application popup with an error that said it can't create a object of my dll. So I found out it wasn't registered at all. Same system, same user register the component from cmd-line works. I make some modifications you suggested and try again, stay tuned :)
    – YvesR
    Aug 14, 2012 at 9:41

1 Answer 1

1

Inno Setup does it work as intended!

Problem in my case is: RegSvcs.exe install the component with wrong credentials. It install the COM+ with security interactive user but as I call it from a service there is no user, so I need SYSTEM as credentials.

Solution: Write a small pice of code that modify the security credentials after registering. I didn't find any option flags to tell regsvcs.exe it directly. Found a post here http://www.carlosag.net/articles/configure-com-plus how to do it and will now adapt the ideas from there to write a small program to do the job.

3
  • +1, maybe you could mention to check the proper registry entries to verify the registering by RegSvcs.exe succeeded.
    – TLama
    Aug 27, 2012 at 8:18
  • Well, the COM+ modification will need to init with finding the correct app by CLSID. So if this fails, the component is not registered correct before. But you gave me an idea. My piece of code can then try to register (I know the path of files where to look already) and redo again...
    – YvesR
    Aug 27, 2012 at 8:31
  • Ah, now I completely got that. The registration failed due to security settings of your application. Good to know!
    – TLama
    Aug 27, 2012 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.