祸祸祸殃。为什么Wix使安装.NET程序集SOOOOOO困难!Wix!(bind.AssemblyFullName.fileId)仅适用于GACed程序集?
我正在安装一个在.NET中实现的COM Inprocess Server,在我的Wix安装中我需要为它创建注册表项。我不想这样做,我宁愿维克斯有相当于RegAsm,但他们让我做手动。我厌倦了认为这有点神秘,因此我放弃了,试图用声明的方式来做,就像一个好孩子。所以,这里是我的注册表的东西现在看起来像:
<File Id="filDriverAssembly" Source="$(var.TiGra.Astronomy.AWRDriveSystem.TargetPath)" KeyPath="yes" Vital="yes" Assembly=".net">
<!--<Class Context="InprocServer32" Description="$(var.InstallName)" Id ="$(var.DriverGuid)" ThreadingModel ="both" >
<ProgId Description="$(var.InstallName)" Id ="$(var.DriverId)" />
</Class>-->
</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>
<!-- Wow6432Node for x86 compatibility, installed only on x64 systems -->
<!-- HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node -->
<?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是为懦夫,呃?无论如何,请注意我需要获取程序集全名来创建一些注册表项。我正在使用绑定变量,具体来说,是Value="!(bind.AssemblyFullName.filDriverAssembly)"
。
但是,这不起作用,除非我添加属性Assembly=".net"
到文件条目。如果我不添加属性,或者如果我使用Assembly="no"
,然后我得到
错误2未解决的绑定时间变量 !(bind.AssemblyFullName.filDriverAssembly)。
当我添加Assembly=".net"
到文件的项目,然后粘结剂变量工作得很好,但维克斯把我组装成全局程序集缓存,这是不我想要的!天啊。
如果Wix项目没有进入GAC,是不是可以在Wix项目中查询程序集的全名?为什么这两件事互相依赖?
我不知道这是如何从文档工作,你能提供一个例子吗?该属性似乎只在NativeAssembly键上有效,这会强制NGEN生成本地程序集。我不想NGEN的大会;这是同样的问题,一切都有两个含义。我只想从程序集中获取元数据以用于安装过程的另一部分。 –
此外,我的程序集是一个通用项目,将被许多应用程序加载,其中一些应用程序尚不存在。我如何指定“将加载此程序集的应用程序”? –
我正在谈论File/@ AssemblyApplication属性。 –