PDA

View Full Version : Registering .net DLL's


JoeDul
08-01-2005, 11:18 AM
Is there a way to register .net Dll's with SF7???

Also is there a Crystal module???


Thanks

Joe

JoeDul
08-02-2005, 02:09 PM
Anyone?
Help....
Please.......

HMMurdock
08-02-2005, 02:24 PM
I haven't personally worked with the .net stuff, but I believe those .dlls can be registered just like the old VB .dlls. The simplest was is to include those .dlls in you install, and make sure the "register com interfaces" is checked on the advanced tab of the file properties window for the .dlls in question.

I've been working on making a Crystal Runtime, but haven't had much time lately to devote to it. I've got something working in my project, but Crystal's licensing is such that I can distribute the files with my project, but not to you (as a developer). That means I need to make a project to distribute to developers that will build another project from the runtimes on the development machine, than you can then distribute to your clients... so its a bit of a pain.

Adam
08-02-2005, 03:11 PM
The .NET dlls should register fine through Setup Factory 7.0.

As far as Crystal Reports goes, if it were strait forward we would have created a module. The licensing on this technology is quite a hassle. Plus different files are needed depending on different features of Crystal that you used.

Adam Kapilik

JoeDul
08-02-2005, 03:16 PM
Thanks for the help.

I'll give it try.

bnkrazy
08-03-2005, 11:11 AM
Just a side note, most .NET assemblies will never need to be "registered" like the dlls of old. They should be installed into the application folder (xcopy) just like any other file in your SF7 project...I specifically turn off the register as a dll option. .NET assemblies can be registered as previous dlls were because you can support COM interop but there are specific requirements of the assembly to achieve this previous functionality. (link) (http://support.microsoft.com/default.aspx?scid=kb;en-us;817248#6)

In the case of more than one application sharing a single assembly(dll), it should be placed in the GAC (global assembly cache) and there are specific steps that must be taken to achieve this. (link) (http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=106)

I have not run into the need to add an assembly to the GAC as of yet so I am not sure if SF7 has the option to install an assembly to the GAC (using the gacutil command).

JoeDul
08-04-2005, 04:41 PM
SF7 built in function for registering .NET Dll's does not work.
I had my fingers crossed.

any other suggestions?

I going to look into some more tomorrow.

bnkrazy
08-04-2005, 05:50 PM
One of the beauties of .NET is the ability to xcopy your application to a machine and it will run. You do not need to register a .NET assembly unless it is going to the GAC.

If you give me a description of the error(s) you are getting after installing your app, I will see if I can point you in the right direction.

JoeDul
08-05-2005, 09:14 AM
Yes it is goin to the Gac.

I am currently not getting an error. It's just not Registering.

JoeDul
08-05-2005, 09:18 AM
I guess this in the way to do it. I was hoping that SF7 would have a built in function or command.

UNREGISTER:

"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\RegAs m" "DLL_PATH_HERE\DLL_NAME_HERE.dll" /Unregister


REGISTER:

"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\RegAs m" " DLL_PATH_HERE\DLL_NAME_HERE.dll"

JoeDul
08-08-2005, 10:21 AM
This is what I ended up doing. So far it seems to work. I need to do some more testing to know for sure.

--UNREGISTER:
File.Run(SessionVar.Expand("\"%WindowsFolder%\\Microsoft.NET\\Framework\\v1.1.43 22\\RegAsm\" \"%ConsoleFolder%\VMIApp\\MaxQ_VMI_Agent_InvtTransac tions.dll\ /Unregister\""), "", "", SW_SHOWNORMAL, false);

--REGISTER:
File.Run(SessionVar.Expand("\"%WindowsFolder%\\Microsoft.NET\\Framework\\v1.1.43 22\\RegAsm\" \"%ConsoleFolder%\VMIApp\\MaxQ_VMI_Agent_InvtTransac tions.dll\""), "", "", SW_SHOWNORMAL, false);

dibyendra
08-11-2005, 05:52 AM
I have used the following command command in bat file to register the dll silently :
regsvr32 %systemroot%\system32\somedll.dll /s

later I executed the reg.bat file by file.run() method.

Hope this might solve the problem.

regards,
Dibyendra

bnkrazy
08-12-2005, 08:49 AM
The only thing with hard coding the patch is that it limits your installer to a single version of the runtime. I found a few more interesting links and some code to install and remove assemblies from the GAC.

Here is a MS KB article that lists some GAC APIs not documented in the .NET SDK: KB Article (http://support.microsoft.com/default.aspx?scid=kb;en-us;317540)

And here is a simple code sample to install/remove an assembly to the GAC using managed code:


System.EnterpriseServices.Internal.Publish foo = new System.EnterpriseServices.Internal.Publish();
foo.GacInstall("AssemblyPath\myassembly.dll");
foo.GacRemove("AssemblyPath\myassembly.dll");


System.EnterpriseServices.Internal.Publish Class (http://www.winfx247.com/247reference/System/EnterpriseServices/Internal/Publish/__members)

I would write a simple command-line 'GAC Manager' using the above class that I could pass in my assembly locations to be installed in the GAC and use the managed code. You could call the 'GAC Manager' app from SF and pass in the assemblies to be installed in the GAC and remove them the same way during uninstall.