x64 Word 2010使用WiX添加注册

时间:2012-05-25 10:29:04

标签: ms-word wix vsto com-interop

我正在使用WiX部署Word添加,关于x84目标平台(至少Office安装必须是x86,从来没有使用过哪个OS平台)一切正常,我的COM Interop注册了Word Add在工作和添加自动启动我第一次开始单词我安装了添加。

我正在注册注册表内容(从heat.exe的输出中删除)

我已经创建了一个中间文件,帮助我使用这个加热命令进行COM Interop注册:

"C:\Program Files\Windows Installer XML v3.5\bin\heat.exe" file MyAddin.dll -ag -template fragment -out MyAddin.wxs 

interesst的输出看起来像:(我知道使用这种方式使用RegistryValue已被弃用)

<Class Id="{10BC65F1-32C0-3ED4-98A0-17661A8C4455}" Context="InprocServer32" Description="MyAddin.MyAddinClass" ThreadingModel="both" ForeignServer="mscoree.dll">
    <ProgId Id="MyAddin.MyAddinClass" Description="MyAddin.MyAddinClass" />
</Class>
<File Id="filCC4172BEC1312562EDEF49648E45AE0D" KeyPath="yes" Source="..\MyAddin\bin\Debug\MyAddin.dll" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32\1.0.0.0" Name="Class" Value="MyAddin.MyAddinClass" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32\1.0.0.0" Name="Assembly" Value="MyAddin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///[#filCC4172BEC1312562EDEF49648E45AE0D]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32" Name="Class" Value="MyAddin.MyAddinClass" Type="string"Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32" Name="Assembly" Value="MyAddin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32" Name="CodeBase" Value="file:///[#filCC4172BEC1312562EDEF49648E45AE0D]" Type="string" Action="write" />

包含此内容的组件将Win64Flag标记设置为yes。因此我认为事情将被写入注册表的x64部分。在此之前,我阅读了关于registry reflection的以下文章:

  

例如,32位InprocServer32密钥与64位应用程序无关,因此InprocServer32密钥不会反映到64位注册表视图。

此外:

  

但是,64位应用程序可以使用32位LocalServer32密钥并反映LocalServer32密钥。

但是我已经尝试使用LocalServer32而不是InprocServer32,但是这样做,不会让我在两个平台上都加入。

我是否必须使用RegAsm Tool的电话,或者我错过了x64平台的某些标签或互操作注册选项?有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

使用wix,你需要做两件事来禁用注册表反射:

  1. 将您的组件标记为64位组件(属性Win64 =“是”)(正如您所做的那样)
  2. 将您的软件包构建为64位软件包(Platform = x64)
  3. 此软件包在x86系统上不可用。所以你需要两个包,一个用于x86,另一个用于x64。您可以对两个包使用相同的源文件,因为x86包将忽略Win64属性。