Woe, woe and thrice woe. Why does Wix make assembling .NET assemblies of SOOOOOO difficult!
I install the Inprocess COM server, which is implemented in .NET, in my Wix installation I need to create registry entries for it. I DO NOT WANT to do this, I would prefer Wix to have the RegAsm equivalent, but they force me to do this manually. I was tired of the flames to suggest that it was a secret secret, so I gave up and tried to do it declaratively, like a good boy. So, here is what now looks in my registry:
<File Id="filDriverAssembly" Source="$(var.TiGra.Astronomy.AWRDriveSystem.TargetPath)" KeyPath="yes" Vital="yes" Assembly=".net"> </File> <RegistryKey Root="HKCR" Key="$(var.DriverId)" Action="createAndRemoveOnUninstall"> <RegistryValue Type="string" Value="$(var.DriverTypeName)"/> <RegistryKey Key="CLSID"> <RegistryValue Type="string" Value="$(var.DriverGuid)" /> <RegistryKey Key="$(var.DriverGuid)"> <RegistryValue Type="string" Value="$(var.DriverTypeName)"/> <RegistryKey Key="InprocServer32"> <RegistryValue Type="string" Value="mscoree.dll" /> <RegistryValue Type="string" Name="ThreadingModel" Value="Both"/> <RegistryValue Type="string" Name="Class" Value="$(var.DriverTypeName)"/> <RegistryValue Type="string" Name="Assembly" Value="!(bind.AssemblyFullName.filDriverAssembly)"/> <RegistryValue Type="string" Name="RuntimeVersion" Value="2.0.50727"/> <RegistryValue Type="string" Name="CodeBase" Value="file:///[#filDriverAssembly]" /> <RegistryKey Key="!(bind.fileVersion.filDriverAssembly)" > <RegistryValue Type="string" Name="Class" Value="$(var.DriverTypeName)"/> <RegistryValue Type="string" Name="Assembly" Value="!(bind.AssemblyFullName.filDriverAssembly)"/> <RegistryValue Type="string" Name="RuntimeVersion" Value="2.0.50727"/> <RegistryValue Type="string" Name="CodeBase" Value="file:///[#filDriverAssembly]" /> </RegistryKey> </RegistryKey> <RegistryKey Key="ProgId"> <RegistryValue Type="string" Value="$(var.DriverId)" /> </RegistryKey> <RegistryKey Key="Implemented Categories"> <RegistryKey Key="{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" /> </RegistryKey> </RegistryKey> </RegistryKey> </RegistryKey> <?if $(var.Win64) = "yes" ?> <RegistryKey Root="HKCR" Key="Wow6432Node" Action="createAndRemoveOnUninstall"> <RegistryKey Key="CLSID"> <RegistryValue Type="string" Value="$(var.DriverGuid)" /> <RegistryKey Key="$(var.DriverGuid)"> <RegistryValue Type="string" Value="$(var.DriverTypeName)"/> <RegistryKey Key="InprocServer32"> <RegistryValue Type="string" Value="mscoree.dll" /> <RegistryValue Type="string" Name="ThreadingModel" Value="Both"/> <RegistryValue Type="string" Name="Class" Value="$(var.DriverTypeName)"/> <RegistryValue Type="string" Name="Assembly" Value="!(bind.AssemblyFullName.filDriverAssembly)"/> <RegistryValue Type="string" Name="RuntimeVersion" Value="2.0.50727"/> <RegistryValue Type="string" Name="CodeBase" Value="file:///[#filDriverAssembly]" /> <RegistryKey Key="!(bind.assemblyVersion.filDriverAssembly)" > <RegistryValue Type="string" Name="Class" Value="$(var.DriverTypeName)"/> <RegistryValue Type="string" Name="Assembly" Value="!(bind.AssemblyFullName.filDriverAssembly)"/> <RegistryValue Type="string" Name="RuntimeVersion" Value="2.0.50727"/> <RegistryValue Type="string" Name="CodeBase" Value="file:///[#filDriverAssembly]" /> </RegistryKey> </RegistryKey> <RegistryKey Key="ProgId"> <RegistryValue Type="string" Value="$(var.DriverId)" /> </RegistryKey> <RegistryKey Key="Implemented Categories"> <RegistryKey Key="{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" /> </RegistryKey> </RegistryKey> </RegistryKey> </RegistryKey> <?endif ?>
RegAsm is for wimps, huh? In any case, note that I need to get the fully qualified name of the assembly to create some registry keys. I use binder variables, in particular, Value="!(bind.AssemblyFullName.filDriverAssembly)" .
This, however, does not work unless I add the Assembly=".net" attribute to the file entry. If I do not add this attribute or use Assembly="no" , then I get
Error 2 Unresolved bind-time variable! (Bind.AssemblyFullName.filDriverAssembly).
When I add Assembly=".net" to the file element, the binder variables work just fine, but Wix puts my assembly in the global assembly cache, which is NOT what I want! Oh man.
Is it not possible to query the fully qualified name of an assembly in a Wix project if it is not part of the GAC? Why do these two things depend on each other?
source share