Not sure if I'm just missing something, but I have a COM class written in C# which I am unable to get the installer to register. I'm trying to get it to extract the registration information but it gives an error every time. My non C# classes register fine. I have both a dll and tlb file that need to be registered, are .NET classes not yet supported ? or am I missing something ?
This is given when I try to set the Registration to "extract registration info"
.NET COM objects are not registered in the same manner as other com objects. When the object is built you get a seperate type library file from which the details are extracted. the .NET objects do not have the normal self-register DLL entry point.
You can register a Type Library(*.tlb) in the "COM" page. In the next release AI will automatically detect the necessary information used to register a COM object.
Does anyone know if this feature has been added yet? I've also got a .net dll and type library that when I check the 'register' checkbox I get the same error. I'm using version 4.4.1. I'm DYING to get off of InstallShield. This is my last product to convert and it does COM Interop....
Thanks. For those that are interested, here's how I did it, it's pretty easy to do, but not so intuitive to sift through the details:
1. Create a file search for RegAsm.exe, this will be used to register. Make the name REGASM, Use path=[WindowsFolder]Microsoft.Net\Framework, Set depth=5. Set the Min and Max Version to the runtime you want, I'm using 2.0 so I set min and max to 2.0. You need this for computers that have 1.0, 1.1, and 2.0 installed.
2. Create a new custom action of type "EXE with path given by propert" in the install commit. Set the property name to [REGASM] from above. Set the the command line to "[#yourfile.dll]" /tlb /codebase (be sure to use the quotes).
I'm not sure the absolute correct way, but I chose Synchronous execution ignore return code. Commit.
3. Do another custom action similar to 2 above, but put it in the Uninstall. This will be good for your installer to do to clean things up as step 2 creates a type library that won't be removed by uninstall without this step. In the Command line of the unistall action put "[#yourfile.dll]" /unregister
You'll also want to make sure that the installer either checks for or installs the appropriate .Net runtime or regasm won't be there.
Thanks for the instructions, they were very helpful. One question, do you know if there is a way to hide the DOS window from popping up during the Custom Action install? I think it takes away from the general impression that people will get when they see these things popping up during an install or uninstall.
Boy, if you figure out how to not get the DOS window to pop up, please let me know. I've got three of them popping up and would love for them to go away. They're all .NET commandline applications. I was starting to ponder making them a .NET dll and call into functions within them?
The previous thread doesn't work for me, the DOS window pops up. I'm not running batch files, I'm running exe files (regasm.exe is one). Does anyone know of a way to hide the DOS window that calls REGASM.EXE when registering a dll like this?
Thanks. Doing this through a vbs like this, I don't understand how this works for you? I've tried this on many different computers and it doesn't work.
I'm thinking you must have included regasm.exe in your installation? Calling a vbs or a batch file like this will only work if regasm.exe is in the current folder where this vbs is being executed from.
The way this should work is to set up an environment variable on the computer (ie, %dotnetfolder%) and then use that in the vbs
RegAsm.exe is part of the .NET Framework runtime. You should be able to path this out to "%WINDIR%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe". Assuming you are using 2.0 framework.
In my case, I have to also use gacutil.exe which is not part of the runtime so I was forced to install regasm.exe and gacutil.exe in my msi.