- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
CodeProject 有一个很棒的 Windows shell extension tutorial .
编译,运行Regasm.exe CSShellExtContextMenuHandler.dll/codebase
,shell扩展就可用了,效果很好。
但是要求用户运行 Regasm
对用户来说并不友好,所以我编写了下面的小 WiX 脚本。 (刚刚复制了 heat
的输出,以及我想要使用的依赖项 DLL)。
问题:当我安装生成的 MSI 时,外壳扩展不会出现(在 Windows 资源管理器中,右键单击文件不会显示我的项目,尽管它与 Regasm 一起使用
)
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='HelloWorld Shell Extension' Id='2afd44ab-16d7-40f4-8741-69ad546cb7cf' UpgradeCode='c5139d19-21ba-43c6-a17d-68760331f332'
Language='1033' Codepage='1252' Version='0.4.4' Manufacturer='Me'>
<Package Id='*' Keywords='Installer' Description="HelloWorld Shell Extension Setup" Manufacturer='Me'
InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='HelloWorldShellExtension.cab' EmbedCab='yes' DiskPrompt='HelloWorld CAB' />
<Property Id='DiskPrompt' Value="HelloWorldShellExtension Bundle CAB Installation" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='INSTALLDIR' Name='HelloWorldShellExtension'>
<Component Id="cmpB0970E4FB9610FC20E1C6B6B2D45C606" Guid="7044db96-17d3-4d4f-93b0-135b89b042c8">
<Class Id="{CE43A2AB-B457-49BF-C83F-4306208D438B}" Context="InprocServer32" Description="CSShellExtContextMenuHandler.FileContextMenuExt" ThreadingModel="both" ForeignServer="mscoree.dll">
<ProgId Id="CSShellExtContextMenuHandler.FileContextMenuExt" Description="CSShellExtContextMenuHandler.FileContextMenuExt" />
</Class>
<File Id="fil5B7C752C5541C807852A6781921F95AB" KeyPath="yes" Source="bin\CSShellExtContextMenuHandler.dll" />
<RegistryValue Root="HKCR" Key="*\shellex\ContextMenuHandlers\{ce43a2ab-b457-49bf-c83f-4306208d438b}" Value="CSShellExtContextMenuHandler.FileContextMenuExt Class" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32\1.0.0.0" Name="Class" Value="CSShellExtContextMenuHandler.FileContextMenuExt" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32\1.0.0.0" Name="Assembly" Value="CSShellExtContextMenuHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=73df467e0a99a326" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///[#fil5B7C752C5541C807852A6781921F95AB]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32" Name="Class" Value="CSShellExtContextMenuHandler.FileContextMenuExt" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32" Name="Assembly" Value="CSShellExtContextMenuHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=73df467e0a99a326" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{CE43A2AB-B457-49BF-C83F-4306208D438B}\InprocServer32" Name="CodeBase" Value="file:///[#fil5B7C752C5541C807852A6781921F95AB]" Type="string" Action="write" />
</Component>
<Component Id='Libraries' Guid='f982a0bb-824d-4835-921d-e51b47b8598b'>
<File Id='dependency.dll' Name='dependency.dll' Source='bin\dependency.dll' DiskId='1' />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='HelloWorldShellExtensionFeature' Title='HelloWorld' Description='HelloWorld' Level='1' AllowAdvertise='no'>
<ComponentRef Id="cmpB0970E4FB9610FC20E1C6B6B2D45C606" />
<ComponentRef Id="Libraries" />
</Feature>
<UI>
<UIRef Id="WixUI_InstallDir" />
</UI>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
</Product>
</Wix>
我尝试将 Root="HKCR"Key="[...]"
更改为 Root="HKLM"Key="SOFTWARE\Classes\[...]"
,模仿 Regasm 实际安装的按键,但这也不起作用。
最佳答案
首先,您使用的 CLSID 与原始示例源不同。也许您对其进行了编辑以使其成为您自己的。确保您使用的值与 FileContextMenuExt
类上的属性相同。
WiX 的 heat.exe 似乎不支持代码库元素。也许假设是,由于您正在计算机范围内注册 COM 程序集,因此您也可以将其放在计算机范围的程序集位置(即 GAC)中。如果这样做,则不需要代码库。
heat file ...
将生成除代码库元素之外的所有内容,但我明白,您已经手动输入了它。您还拥有其他必需的注册条目,*\shellex\ContextMenuHandlers
。它是特定于应用程序的元素,因此无法生成。但是,您也是手动输入的。
最后,安装程序和 explorer.exe 必须具有相同的“位数”。否则,安装程序可能会为 32 位 explorer.exe 创建注册表项,而 64 位 explorer.exe 将看不到它们。要部署该产品,您必须拥有 x86 和 X64 版本的安装程序。您可以在 Wix/Product/Package
元素中显式设置包的平台。
除此之外,您的 Product.wxs
“可以在我的机器上运行。”
关于WiX 相当于 "Regasm.exe my.dll/codebase"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16646934/
我有一个适用于 32 位和 64 位架构的 COM 可见 dll,我用它来将菜单项添加到 Windows 资源管理器上下文菜单。使用“regasm myassembly.dll/codebase”我注
我可以使用 .Net4 RegAsm.exe 对 .NET 2 dll 执行 RegAsm 吗? 我的机器上只安装了 .NET 4,我需要对 .NET 2 文件执行 RegAsm。 最佳答案 是的,你
我输入这个: regasm COMTest.dll /tlb:COMTest.tlb /codebase COMTest 我收到以下错误: An error occurred while regist
我编写了一个 .NET 程序集并使用 Regasm 在我的本地机器上成功注册了它,但是当我尝试在目标服务器中执行此操作时,出现以下错误。 Regasm:错误 RA0000:无法找到输入程序集“完整 d
我有一个 C# COM 组件需要被推出并注册到远程计算机。有谁知道这是否可以通过 Regasm 实现? 最佳答案 你应该试试 psexec/pstools。这是一个链接:http://technet.
如果我想让 .NET 程序集可用作 COM 服务器,我必须添加一组属性,然后使用 regasm将其注册为 COM 服务器。 如果程序集没有使用强名称签名 regasm当使用 /codebase 运行时
我正在 Visual Studio 中构建新类。这些最终生成 DLL 文件,这些文件通过 VS IDE 自动注册。 这些相同的 DLL(只有 DLL 没有 TLB)被传送到客户端,在那里它们通过 RE
我的同事正在尝试通过 RegAsm.exe 注册一些 COM 组件(我编写的),它说他需要管理员权限。他的帐户具有管理员权限,但他没有以管理员身份登录。有没有办法使用他的常规用户帐户并成功完成此任务?
我有一个用 C# 编写的 COM 可见 DLL,我想在 VB6 应用程序中使用它。我有 DLL 的两个主要用例,我想知道 /codebase 选项何时适用以及何时最好在 GAC 中注册。 用例: DL
我在使用批处理文件在网络驱动器上的框架 4 上调用 Regasm 时遇到问题。当 dll 位于本地驱动器上时,它可以正常工作。 消息是无法加载文件或程序集 filename.dll 或其依赖项之一。不
我使用 regasm 在开发计算机上注册了我的一个 dll,如下所示(ASP 应用程序) 在 cmd 提示符下,我导航到C:\WINDOWS\Microsoft.NET\Framework\v2.0.
我们有一个托管 C++ DLL,当用 regasm 注册时,它似乎会向注册表添加一些垃圾类型。在 Blah 类中,任何使用 MyTeam.ManagedAutoPtr 的私有(private)变量都会
好吧,我知道这很具体,但我花了一整天的时间在这上面,所以我真的需要一些合理的解释,这样我的老板和我的妻子就不会解雇我 根据 MSDN : /regfile 开关“为程序集生成指定的 .reg 文件”
我正在尝试使用 RegAsm 注册一个 .dll。它是一个 .NET 2.0 dll。所有类都是公开的,ComVisible 为真。我仍然收到 RA0000:没有注册类型错误。下面是代码和程序集信息。
我们有一个基于spicIE的IE插件,目的是连接一些外部设备。 为了连接到这些外部设备,另一家公司开发了他们的 token 和 DLL。我们需要一些 ActiveX 和 DLL 来通过 token 进
我有一个 .NET 程序集,需要在安装时注册。我注意到注册表在 regasm 时有细微差别直接使用而不是通过 regasm 安装的注册表脚本。 这是我的测试: 我导出原来的HKCR hive,然后运行
简而言之,我构建了一个 C# 类库,它既是 COM 可见的,又是为 COM 互操作而注册的。我已经编译了库,从而生成了 .dll 和 .tlb 文件。 我有另一台运行 VB6 应用程序的机器。因此,我
我想知道是否可以在不使用 RegAsm tool 的情况下注册类型库.这是我的情况,这有望解释我为什么要这样做: 我正在 .NET 中开发一个程序集,它将为我们旧的 VB6 应用程序提供一些现代功能。
部署和注册 .Net 时Excel.dll在另一台计算机上,我收到错误 Can't add a reference to the specified file尝试添加对 DLL 的引用时在 VBA编辑
我有以下问题:.NET 程序集是否可以同时注册到 Regasm 和 Regsvcs?谢谢 最佳答案 这是对该问题的超时回复。但让我解释一下我所意识到的差异。 为了理解这一点,您必须想出 COM 和 C
我是一名优秀的程序员,十分优秀!