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?
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.