2014-08-29 53 views
0

我創建了一個shell擴展庫。如果我使用regasm x64將其註冊到代碼庫開關,它可以正常工作。我現在試圖將它放入一個包中進行部署。使用wix安裝Shell Extension x64並將擴展程序集放入GAC中

我在VS2010中創建了一個用於x64的Wix項目。產品平臺是x64。現在我正在將這個文件放入GAC中。

<Fragment> 
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
    <!-- MYAppConnect.dll --> 
    <Component Id="com_MYAppContextMenu.dll" Guid="*" Win64="yes"> 
    <File Id="file_MYAppContextMenu.dll" Name="MYAppContextMenu.dll" 
      Assembly=".net" Source="..\..\MYAppContextMenu\MYAppContextMenu.dll" 
      KeyPath="yes"/> 
    </Component> 
</ComponentGroup> 

然後我用Heat.exe得到產生這個我的註冊表的東西。文件在GAC中 - 以下注冊表設置處於預期位置 - 不在wow64配置單元中。

所以我認爲我做錯了什麼。有人能給我一些提示,評論或指導如何做。

<Fragment> 
<DirectoryRef Id="TARGETDIR"> 
    <Directory Id="dir29DD73560741DA307F10310D0631A50A" Name="MYAppContextMenu" /> 
</DirectoryRef> 
</Fragment> 
<Fragment> 
<DirectoryRef Id="dir29DD73560741DA307F10310D0631A50A"> 
    <Component Id="cmp322F9BBA6F4BF4E5180AB10BED5E416D" Guid="*" Win64="yes"> 
    <Class Id="{3E9DE1E3-7B57-43A6-AA05-6CAF8018F450}" Context="InprocServer32" Description="MYAppContextMenu.FileContextMenuExt" ThreadingModel="both" ForeignServer="mscoree.dll"> 
     <ProgId Id="MYAppContextMenu.FileContextMenuExt" Description="MYAppContextMenu.FileContextMenuExt" /> 
    </Class> 
    <File Id="filCCBAC28E458283F290F1DB9F69EC2BF1" KeyPath="yes" Source="..\..\MYAppContextMenu\MYAppContextMenu.dll" /> 
    <RegistryValue Root="HKCR" Key=".asc\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".csv\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".doc\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".docm\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".docx\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".gif\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".jpeg\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".jpg\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".log\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".msg\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".ods\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".odt\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".ott\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".pdf\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".png\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".ppt\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".pptm\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".pptx\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".raw\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".rtf\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".tif\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".tiff\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".wps\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".xlm\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".xls\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".xlsm\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".xlsx\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".xps\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key=".zip\shellex\ContextMenuHandlers\{3e9de1e3-7b57-43a6-aa05-6caf8018f450}" Value="MYAppContextMenu.TDBSContextMenu Class" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{3E9DE1E3-7B57-43A6-AA05-6CAF8018F450}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{3E9DE1E3-7B57-43A6-AA05-6CAF8018F450}\InprocServer32\1.0.0.0" Name="Class" Value="MYAppContextMenu.FileContextMenuExt" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{3E9DE1E3-7B57-43A6-AA05-6CAF8018F450}\InprocServer32\1.0.0.0" Name="Assembly" Value="MYAppContextMenu, Version=1.0.0.0, Culture=neutral, PublicKeyToken=448edde23f8b5bbd" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{3E9DE1E3-7B57-43A6-AA05-6CAF8018F450}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{3E9DE1E3-7B57-43A6-AA05-6CAF8018F450}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/MYAppContextMenu/v4.0_1.0.0.0__448edde23f8b5bbd/MYAppContextMenu.dll" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{3E9DE1E3-7B57-43A6-AA05-6CAF8018F450}\InprocServer32" Name="Class" Value="MYAppContextMenu.FileContextMenuExt" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{3E9DE1E3-7B57-43A6-AA05-6CAF8018F450}\InprocServer32" Name="Assembly" Value="MYAppContextMenu, Version=1.0.0.0, Culture=neutral, PublicKeyToken=448edde23f8b5bbd" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{3E9DE1E3-7B57-43A6-AA05-6CAF8018F450}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{3E9DE1E3-7B57-43A6-AA05-6CAF8018F450}\InprocServer32" Name="CodeBase" Value="file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/MYAppContextMenu/v4.0_1.0.0.0__448edde23f8b5bbd/MYAppContextMenu.dll" Type="string" Action="write" /> 
    </Component> 
</DirectoryRef> 
</Fragment> 
+0

爲什麼要將此文件安裝到GAC?順便說一下,你已經通過設置Assembly =「。net」來安裝到GAC,根據我所知,不需要設置GAC目錄。我會在GAC之外安裝它以避免它的特性。我對x64註冊並不熟悉,但作爲註冊的一部分,InprocServer32看起來很奇怪?也許試試[這個建議](http://stackoverflow.com/a/11276203/129130)。 – 2014-08-29 23:33:16

+0

因爲至少強烈推薦。 – darbid 2014-08-30 07:12:59

回答

0

如果你想添加一個DLL到GAC,你可以試試這個嗎?這將複製dll到GAC當功能被選中。

功能定義

<Feature Id="Feature1" Title="Deploy dlls" Level="1"> 
    <ComponentGroupRef Id="InfragisticsRunTime" /> 
</Feature> 

目錄定義

<Directory Id="TARGETDIR" Name="SourceDir"> 
    <Directory Id="CompanyName" Name="Some Company Name"> 
    <Directory Id="INSTALLLOCATIONCONFIG" Name="Some Files"> 
    </Directory> 
    <Directory Id="GAC" Name="GAC"> <!--Just a refrence--> 
    </Directory> 
</Directory> 
</Directory> 

ComponentGroup定義

<Fragment> 
     <ComponentGroup Id="InfragisticsRunTime"> 
      <ComponentRef Id="cmp79447E1633608740D07286A035DEFFB3" /> 
     </ComponentGroup> 
</Fragment> 

組件定義

<Fragment> 
<Component Id="cmp79447E1633608740D07286A035DEFFB3" Directory="GAC" Guid="*"> 
<File Id="filB48E30816BA7EF62BABB08A480F1E6BB" KeyPath="yes" 
     Source=".\Infragistics\Infragistics2.Documents.Core.v12.1.dll" 
     Assembly=".net" /> 
</Component> 
</Fragment> 
+0

謝謝。但這並沒有改變我的情況。文件位於GAC中,外殼擴展的註冊表「看上去」非常完美。但沒有菜單。 – darbid 2014-08-29 20:22:18

+0

手動使它顯示菜單,你會做什麼? – Dev 2014-08-30 13:21:16

+0

建議:1.使用/ regfile選項在您的dll上運行regasm,只是爲了與您在WiX中進行比較,這是一項完整性檢查。 2.使用CreateObject(「progid」)或CLSID對您的Dll執行COM調用,看看會發生什麼情況,請使用Fusion Log Viewer來查看失敗的原因。 3. Regasm還創建了類型庫接口註冊表項,所以您可能需要創建一個tlb文件並加熱以獲取Interface註冊表項。 – PhilDW 2014-08-30 18:07:16

相關問題