2
votes

I've found that by adding KeyPath="yes" and Assembly=".net" to a DLL component in my Wix XML file, that after I build the installer, and run it, it does indeed install the DLLs I've specified with those properties into the GAC. It also still installs them to my local program folder. I was under the assumption that if they are installed to the GAC, then there is no need to also have them in the program folder. Is having the DLLs in both locations a problem, and if it is, is there a way to prevent their install into the program folder?

1
@Rob Mensching - Thanks for the post. I had reverse engineered my .wxs file with Dark, and it had included an AssemblyManifest and AssemblyApplication entry for each of my DLLs. When I remove those properties (like what you have in your code below), then it installs the DLLS only into the GAC. I think this will work fine for me.Russ Clark
Yeah, those attributes will prevent installation to the GAC.Rob Mensching

1 Answers

5
votes

I cannot reproduce what you are seeing. If I create an MSI that has only one Component in it that looks like:

<Component Directory="SomeFolderUnderProgramFiles">
   <File Source="path\to\my\strongnamedsigned.dll" Assembly=".net" KeyPath="yes" />
</Component> 

Then I only get the "strongnamedsigned.dll" in the GAC. My directory tree (rooted in ProgramFilesFolder) does not get created at all.

Do you perhaps another copy of the file in your .wxs files somewhere without the Assembly=".net" attribute on it? There isn't anything wrong with doing that (smart cab'ing will even kick in and keep your cabinet size small) but it would be good to understand what causes the file to be installed in two places.