2012-05-25 22 views
3

我部署一個Word添加使用WiX的,關於X84的目標平臺(至少在Office安裝必須是x86,從來不使用哪個操作系統平臺)的一切運作良好,我的Word互操作註冊的Word Add In工作和添加自動啓動的第一次我開始一個字我又安裝了Add In。64 Word 2010中添加在註冊使用WiX的

我做登記的東西以下注冊表(切從heat.exe的輸出)

我創建了一箇中間文件,使用此命令的熱量幫助我走出了COM互操作註冊:

"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平臺的一個部分標籤或互操作註冊選項?任何人都可以幫忙嗎?

回答

0

隨着威克斯你需要做兩件事情以禁用註冊表反射:

  1. 標記您的組件爲64位組件(屬性Win64中=「是」)(像你一樣)
  2. 建立你的包中64位軟件包(平臺= x64)

此軟件包在x86系統上不可用。所以你需要兩個包,一個用於x86,一個用於x64。對於這兩個軟件包,您可以使用相同的源文件,因爲x86軟件包會忽略Win64屬性。