What exactly does \"Install Assembly\" do?

Got a problem you cannot solve? Try here.
wolbrink
Posts: 76
Joined: Wed Nov 17, 2004 3:00 pm

What exactly does \"Install Assembly\" do?

Postby wolbrink » Wed Oct 25, 2006 10:34 am

I've read what the help file says about "Install Assembly" and "Register Assembly", and I'm still not confident I get it. Here's what I think I understand:

"Install Assembly" is an MSI command that will optionally install the assembly into the GAC, and it will "regasm" the assembly for you to make it available for COM interop. Because it's MSI, it will automatically unregister the assembly when you unintall.

"Register Assembly" is just a wrapper around "regasm". It's not MSI, so it executes immediately. You are responsible to unregister your assembly during uninstall.

Does this sound right?

--Troy

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Oct 25, 2006 10:48 am

Install Assembly populates the MSI database tables for assemblies, in addition to creating the entries for the MSI database tables for files. It lets you put an assembly in the GAC or elsewhere on your system. It does not register the assembly - this is a seperate step/command.

Note that MSI will not automatically uninstall assemblies installed into the GAC, this is by design in MSI.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

wolbrink
Posts: 76
Joined: Wed Nov 17, 2004 3:00 pm

Postby wolbrink » Wed Oct 25, 2006 11:43 am

OK, "Install Assembly" makes perfect sense to me when installing into the GAC. I'm going use this for one of my shared assemblies.

But for local assemblies, "Install Assembly" seems equivalent to "Install Files". Maybe I don't understand the significance, in this context, of telling MSI what type of file this is. Why does MSI care that this file happens to be a local assembly?

I have one local assembly that I need to "regasm ..." for COM interop. I like how "Register Assembly" does this for me. But when I uninstall I should call "regasm /unregister ...". Will I have to resort to "Run Program" in this case? Or is there a nice wrapper for this I'm missing?

--Troy

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Oct 25, 2006 4:04 pm

I believe you'll need to call regasm manually to unregister, using Run Program.

To be honest, I'm not sure what difference it makes to use Install Assembly outside of the GAC compared to using Install Files.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

christal
Posts: 7
Joined: Tue Dec 26, 2006 11:40 am

Postby christal » Thu Jan 04, 2007 5:07 pm

I am trying to register a couple of VS 2005 (C#.NET) dlls for COM interop (regasm). I have tried Install Assembly to $COMMONFILES$\\Allenbrook and they don't register. I have tried using Install Files and then Register Assembly and they don't register. Any ideas? I am new to InstallAware and flying pretty blind right now.

I have enclosed a screen shot of my script.

File Attached:

InstallAwarePost_COM_REGASM.doc

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Jan 05, 2007 1:38 am

Tip: Use Ctrl+Shift+C to copy code to the clipboard in human readable form (so there is no need to take IDE screenshots).

As for the actual issue...try to enter the full target path of the assembly in the command, instead of the assembly name. The assembly name probably doesn't work because you aren't installing into the GAC with Install Assembly (and instead using Install Files). It might also be worth trying to use Install Assembly outside of the GAC - that will probably also help resolve the assembly name.

Either way, if you enter the full target path to the assembly, it will work for sure ($COMMONFILES$\\...).
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

christal
Posts: 7
Joined: Tue Dec 26, 2006 11:40 am

Postby christal » Fri Jan 05, 2007 4:16 pm

Still no luck with registering those DLLs for COM interop. I have attached a TXT file with the human readable script in it.

File Attached:

InstallAwarePost_COM_REGASM.txt

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Jan 05, 2007 6:29 pm

Script looks good. Try to register the assemblies manually on the command line and see if that works?
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

christal
Posts: 7
Joined: Tue Dec 26, 2006 11:40 am

Postby christal » Mon Jan 08, 2007 2:39 pm

It works manually. I did Start\\Run on my XP box and entered...

C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\regasm.exe "C:\\Program Files\\Common Files\\Allenbrook\\CQHPlugInProvider.dll"

File registered properly manually. Could InstallAware not be getting to the version 2.0 Regasm.exe and be running the version 1.1 Regasm?

If it is any help, I have the .InstallState and .InstallLog files created by the installer class of the dlls, when I run the install. I am including the log file text below and attaching the installstate file.

Installing assembly 'C:\\Program Files\\Common Files\\Allenbrook\\CQHPlugInInterface.dll'.
Affected parameters are:
assemblypath = C:\\Program Files\\Common Files\\Allenbrook\\CQHPlugInInterface.dll
=
logfile = C:\\Program Files\\Common Files\\Allenbrook\\CQHPlugInInterface.InstallLog
See the contents of the log file for the C:\\Program Files\\Common Files\\Allenbrook\\CQHPlugInInterface.dll assembly's progress.
The file is located at C:\\Program Files\\Common Files\\Allenbrook\\CQHPlugInInterface.InstallLog.
Committing assembly 'C:\\Program Files\\Common Files\\Allenbrook\\CQHPlugInInterface.dll'.
Affected parameters are:
logtoconsole =
assemblypath = C:\\Program Files\\Common Files\\Allenbrook\\CQHPlugInInterface.dll
=
logfile = C:\\Program Files\\Common Files\\Allenbrook\\CQHPlugInInterface.InstallLog

File Attached:

CQHPlugInInterface.InstallState


Return to “Technical Support”

Who is online

Users browsing this forum: Bing [Bot] and 187 guests