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