通过 WiX 3 检测程序集是否位于 GAC 中?
我想在 WiX 3 中检测(最好通过条件)特定程序集是否在 GAC 中。 我知道该程序集的名称、版本和公钥令牌。 有没有内置的方法可以做到这一点,或者我必须编写一个 CustomAction 来做到这一点? 我该如何设置 CustomAction? (这将是在安装开始之前。)
I'd like to detect in WiX 3 (preferably via a Condition) whether a particular assembly is in the GAC. I know the name, version, and public key token of said assembly. Is there any built in way to do this, or will I have to write a CustomAction to do it? And how would I go about setting up that CustomAction? (This would be before the install begins.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 FileSearch 来搜索 %windir%\ assembly\ 中的文件GAC(如果您知道所有其他值)有点老套但有效。
完整的文件路径将存储在一个属性中,您可以在安装开始之前使用该属性。
You can use FileSearch to search for the file in %windir%\assembly\GAC (If you know all the other values) a bit hacky but works.
The full file path will be stored inside a property which you can use in condition before the install start.
需要小心。 程序集不仅可以安装在 %windir%\Assembly\GAC 文件夹中。 我的程序集通常安装在%windir%\ assembly \ GAC_MSIL中。 只需搜索%windir%\ assembly \就可以了。
Need to be careful. Assemblies can be installed in more than just the %windir%\assembly\GAC folder. My assemblies are most often installed in the %windir%\assembly\GAC_MSIL. Just search the %windir%\assembly\ and you should be ok.