Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / January 2005

Tip: Looking for answers? Try searching our database.

Installing CCW Assembly on User Machines

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Strong - 15 Jan 2005 18:01 GMT
Hi All,

I have a .NET component that is callable by a COM application that has
worked well, been distributed, for a couple years. The app used the typelib
import build into VS.NET that automagically created the Interop.* assembly.
Again this has worked as a private application where the .NET files are
installed into the same directory as the COM .exe file.

Now I need to make this component publicaly available so other utilities can
access it. From my reasarch, this means adding the CCW component to the GAC
and to add to the GAC, all associated assemblies ned to be strong named. I
have successfully done this but am having troubles with the install built by
VS.NET.

VS.NET has an option to register files (vsdrpCOM) that the documentation
says will register the component on the user machine where the install is
taking place. This seems to work for a COM component written with VS6 but it
does not seem to register the CCW assembly correctly. Also, if I install the
CCW assembly to the GAC, it also does not appear to correctly register with
COM.

If I run RegAsm on the assembly, it seems to register correctly on the user
machine and if I run GacUtil on the user machine I can get the CCW assembly
reference into the GAC with a CodeBase of the directory where the CCW
component is located and everything works fine.

Problem is, I can't find a way to have the installer with VS.NET do this on
its own. Does anyone know if it is possible/how to get the VS.NET installer
to put a CCW assembly on a user machine, RegAsm it so it is registered with
the COM system, and put a reference to it in the GAC so it is visible
globally on the machine?

Currently, the only way I can get this to work is to have the installer
place a copy of the CCW assembly into the GAC, have the installer place a
copy of the CCW into a directory, and place a small utility in the same
directory that is run by a "Custom Action" after the main install is complete
that runs RegAsm against the CCW assembly. This works but does not provide a
clean way to uninstall the components if that is required and seems like a
kludge - the installer should be able to do all of this.

Any help/thoughts would be greatly appreciated.

Thanks - Bill Strong
Rafał Grzybowski - 15 Jan 2005 21:16 GMT
Try to add Installer class to the project containing Your component You
wish to register with regasm and add code to register/unregister it
(RegCode namespace as far as I know). Setup during installation process
will use this custom code to register Your assemblies.

I hope it'll help
Bill Strong - 17 Jan 2005 14:53 GMT
Hi Rafał,

Thanks for your reply. I tried you suggestion of adding an installer class
to the project that creates the CCW component. Based on its event structure,
it seems perfect to use the After_Install event to shell a RegAsm command to
register the component and the Before_Uninstall event to unregister the
component.

My first attempts were unsuccessful - the install behaved like it was not
running the code in the installer class I added to the CCW component project.
Also, it was not clear to me how I could get a reference to the instal
directory when I execute the Shell command. I assume I'm mising something and
will continue to research it. If you or anyone else has suggestions on where
to look for info on this, I'd sure appreciate it.

Thanks again - Bill Strong

> Try to add Installer class to the project containing Your component You
> wish to register with regasm and add code to register/unregister it
> (RegCode namespace as far as I know). Setup during installation process
> will use this custom code to register Your assemblies.
>
> I hope it'll help

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.