Page 1 of 1

What exactly does \"Install Assembly\" do?

Posted: Wed Oct 25, 2006 10:34 am
by wolbrink
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

Posted: Wed Oct 25, 2006 10:48 am
by MichaelNesmith
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.

Posted: Wed Oct 25, 2006 11:43 am
by wolbrink
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

Posted: Wed Oct 25, 2006 4:04 pm
by MichaelNesmith
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.

Posted: Thu Jan 04, 2007 5:07 pm
by christal
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

Posted: Fri Jan 05, 2007 1:38 am
by MichaelNesmith
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$\\...).

Posted: Fri Jan 05, 2007 4:16 pm
by christal
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

Posted: Fri Jan 05, 2007 6:29 pm
by MichaelNesmith
Script looks good. Try to register the assemblies manually on the command line and see if that works?

Posted: Mon Jan 08, 2007 2:39 pm
by christal
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