
Signature
Phil Wilson
[MVP Windows Installer]
> Thanks for the link to that thread. After reading that thread I am not sure
> if this is the same problem.
[quoted text clipped - 48 lines]
> custom
> > action called twice" in platformsdk.msi, starting 3/16/2004.
> A couple of thoughts:
> I think the issue isn't so much MSI or InstallUtilLib.Dll, it's just that
> the LoadLibrary API ends up not loading the "same" DLL into the process no
> matter which piece of code calls it, most likely because each is not loaded
> using a unique full path. If you LoadLibrary("x.dll") twice, the second call
> won't load another copy. That's my guess at why this might be happening.
Could be. The loading rules for .net are very different then for win32. I'm
reserving the right to disagree later on :-)
> Regarding the fusion stuff, I don't think it's heavily involved. You can see
> the parameters passed to the ManagedInstall call, and none of them specify a
> strong name or version of the custom action assembly, so I'm guessing that
> locating the assembly isn't using strong names or assemblyversions.
If the assembly wasn't signed then all that is needed is the simple name. If
the assembly was signed with a strong name but the parameters used to invoke
the custom action did not specify a full name (simple name, strong name,
culture, and version) then this would be a major flaw. It should be possible
to install two assemblies, each with the same simple name, but both signed
with a strong name and of a different version, and invoke custom actions in
each (they would need to be in different folders to avoid naming conflicts
with the file system). I say "should" because I haven't tried this with MSI,
but this loading two assemblies of the same simple name but with different
full names is definitely supported in .net itself.
I would think that if the target of the custom action then MSI would defer
all assembly loading to the InstallUtilLib.Dll, which should have been smart
enough to handle this. But there I go assuming again...
> You're probably right that the assembly stays loaded in the process even
> though the file has been removed, so the custom action called from the new
> install doesn't load the new assembly DLL that has the same name.
Yah, that's pretty scary :-) I wonder how they pulled that one off...
Thanks for the feedback. If I learn anything further from MSFT I'll post
what I find out up here.
Phil Wilson - 11 Apr 2004 18:56 GMT
I think MSI *does* defer assembly loading to InstallUtilLib, but
InstallUtilLib doesn't know anything about the sn or version of the assembly
it should load. I think it's basically a shim to host the runtime and use
the AssemblyInstaller class, passing the command line.

Signature
Phil Wilson
[MVP Windows Installer]
>
> > A couple of thoughts:
[quoted text clipped - 39 lines]
> Thanks for the feedback. If I learn anything further from MSFT I'll post
> what I find out up here.