使用wix安装Shell Extension x64并将扩展程序集放在GAC中

时间:2014-08-29 19:04:41

标签: wix installer windows-installer

我创建了一个shell扩展库。如果我使用regasm x64将其注册到codebase开关,它可以正常工作。我现在正试图将其放入要部署的包中。

我在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>

1 个答案:

答案 0 :(得分:0)

如果要向GAC添加dll,可以试试这个吗?这将在选择功能时将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>