dark.exe(来自 WiX)是从 MSI 中提取信息的可靠方法吗?
...如果是,为什么我不能使用 SelfRegCost="0"
?
所以这可能有点哲学性;)
基本问题是:我必须在安装过程中注册 ShellExtension DLL。当使用普通的旧 VS2008 部署时,我有一个自定义操作,它在我的 dll 上运行 regsvr32。然后在我的 WiX 设置中我做了同样的事情,即使在卸载时取消注册 (/u)。这很好用。
直到有一天,我遇到了一些第三方 DLL 在卸载 Visual Studio 安装程序后丢失注册的问题。我发现安装覆盖了 DLL 的默认位置。我发现可以将 Register
属性从 vsdrfCOMSelfReg
更改为 vsdrfDoNotRegister
,现在我的安装程序不再覆盖默认位置。
这让我想到我可以使用相同的属性来注册我的 ShellExtension DLL。因此,让我们在 VS 设置中使用 dark 并查看 vsdrfCOMSelfReg
的翻译是什么。我发现唯一的区别是 File
标记中的属性 SelfRegCost="0"
。
但根据这篇文章( How do you register a Win32 WiX 3 中的 COM DLL 文件?)使用 SelfRegCost 太糟糕了,很多事情都会出错。可能吧。
现在我的推理是:要么
a) dark.exe 不是从 MSI 中提取信息的可靠方法,要么
b) 使用 SelfRegCost="0"
并不像每个人假装的那么糟糕,因为 Visual工作室从那时起就这样做了吗?
... and if yes, why can't I use SelfRegCost="0"
?
So this might get a little philosophical ;)
The basic problem is: I have to register a ShellExtension DLL during a setup. When using plain old VS2008 deployment, I had a custom action which ran a regsvr32 on my dll. Then in my WiX setup I did the same, even with an unregister (/u) on uninstall. This works fine.
Until the other day I had a problem with some third-party DLLs loosing their registration after uninstalling a Visual Studio Setup. I found the installation had overwritten the default location of the DLLs. I discovered the possibility to change the Register
Property from vsdrfCOMSelfReg
to vsdrfDoNotRegister
, and now my Setup did not overwrite the default location any more.
This made me thinking that I can use the same Property to register my ShellExtension DLL. So lets use dark on the VS Setup and see what the translation of the vsdrfCOMSelfReg
is. And I found the only difference is the attribute SelfRegCost="0"
in the File
tag.
But according to this article ( How do you register a Win32 COM DLL file in WiX 3?) using SelfRegCost is baaad, lots of things go wrong. Possibly.
Now my reasoning is: either
a) dark.exe is not a realiable way to extract information from an MSI or
b) the use of SelfRegCost="0"
is not as bad as everybody pretends, since Visual Studio does it eversince?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Dark 旨在反编译回源代码,但并不旨在通过编译器往返返回。它是一个有用的起点,可以清理代码并进行任何所需的重构,然后重新构建它。
Dark is meant to decompile back to source but it isn't intended to be round tripped back via the compiler. It's meant to be a useful starting point to clean up the code and do any needed refactoring then build it back up.
Visual Studio 正在公开功能;这并不意味着使用它是个好主意。自注册是不好的,应该通过使用 Class 和 ProgId 等 WiX 元素显式创作 COM 注册来避免。
Visual Studio is exposing functionality; that doesn't mean it's a good idea to use it. Self-registration is bad and should be avoided by explicitly authoring COM registration using WiX elements like Class and ProgId.