首先,我应该澄清,我是一个新手,一直在努力理解WIX格式,但是通过拼凑在线找到的例子,我现在有了安装良好的文件,所以接下来我需要注册我的DLL。
我使用这里的示例作为起点:How to deploy a SharpShell-based shell extension via WiX?,但是SharpShell工具srm.exe似乎没有在安装时被调用。
如果我按下面的方式手动调用srm.exe,它就会像希望的那样工作,即注册DLL,我的shell扩展也能工作。
srm install MyExtension.dll -codebase我还可以看到,通过SharpShell附带的Server应用程序,注册已经成功。
我还可以手动卸载以下内容--并不是这与我的问题特别相关,但至少可以确认手动方法是有效的:
srm uninstall MyExtension.dll这里是我的WXS文件的一个片段。运行结果MSI时,将安装文件,但未注册DLL;请通过SharpShell的服务器管理器确认。我哪里出问题了?
</Component>
<Component Id="SRMexe" Guid="C17BB61F-6471-46F9-AA87-2D14D2456632">
<File Id='srm' Name='srm.exe' DiskId='1' Source='..\MyExtension\packages\SharpShellTools.2.2.0.0\lib\srm.exe' KeyPath='yes'>
</File>
</Component>
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
</ComponentGroup>
</Fragment>
<Fragment>
<CustomAction Id="InstallShell" FileKey="srm"
ExeCommand='install "[INSTALLFOLDER]\MyExtension.dll" -codebase'
Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="UninstallShell" FileKey="srm"
ExeCommand='uninstall "[INSTALLFOLDER]\MyExtension.dll"'
Execute="deferred" Return="check" Impersonate="no" />
<InstallExecuteSequence>
<Custom Action="InstallShell"
After="InstallFiles">
NOT Installed
</Custom>
<Custom Action="UninstallShell"
Before="RemoveFiles">
(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")
</Custom>
</InstallExecuteSequence>
</Fragment>发布于 2022-04-13 00:03:05
看起来没有任何带有CustomAction定义的片段的引用,因此它们没有链接到最终的输出MSI中。
从Product中添加一个CustomActionRef来创建引用。
https://stackoverflow.com/questions/71843579
复制相似问题