如何在基于WIX安装程序的条件下注册COM dll [英] How to register a COM dll on condition based in WIX Installer

查看:115
本文介绍了如何在基于WIX安装程序的条件下注册COM dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在运行命令以在WIX​​安装程序中使用以下代码注册dll

Am running a Command to register a dll using the below code in WIX installer

 <CustomAction Id='comReg' Directory='INSTALLLOCATION'  Impersonate='no' Execute='deferred'
                ExeCommand='"[NETFRAMEWORK40CLIENTINSTALLROOTDIR]regasm.exe" "[INSTALLLOCATION]myProduct.dll"  /codebase' Return='check' /> 

  <CustomAction Id='comUnreg' Directory='INSTALLLOCATION' Impersonate='no'  Execute='deferred' ExeCommand='"[NETFRAMEWORK40CLIENTINSTALLROOTDIR]regasm.exe" /u "[INSTALLLOCATION]myProduct.dll"  /codebase' Return='check' />

用于注册表项及其正常工作,我的设置也很不错。但是现在我需要在基于条件的情况下(即在我的安装程序中)注册此程序,我已经给出了一个复选框,如果已选中则需要注册dll,否则无需注册。

for registry entry and its working fine and my setup is also working cool. But now i need to register this in condition based (ie) in my installer i have given a checkbox ,if its checked then need to register the dll else no need to register.

我已经通过使用< Condition> INSTALLADDIN< / Condition> 将条件用于其他用途,但它仅在< Component>内部工作。 < / Component> ,但是我的命令位于< Product>< / Product> 内,如何设置上述条件。 ??

I have used conditions for other uses by using <Condition>INSTALLADDIN</Condition> but its working only inside a <Component> </Component> but my command was inside <Product></Product> , how to set the condition for the above mentioned.??

,如果我按以下方式使用

and if i used as below

<条件消息=' EA-Addin未安装'> INSTALLADDIN< / Condition>

在该代码上方,它显示该消息并被终止。如果我没有设置消息属性显示错误消息,指出消息是必需属性。如何解决此问题。?

above that code it shows that message and getting terminated.If i didnt set the message property it shows an error that message is a required property.How to overcome this problem.?

推荐答案

您需要一个条件根据您所处情况的自定义操作,我假设您已将其添加到执行序列中的某处,但没有任何条件。

You need a condition on the custom action in your situation, I assume you've added it to the execute sequence somewhere but there's no condition on it.

话虽如此,但这并不是真正的注册方式。使用Heat将其提取到带有DLL的组件中。您可能需要两个组件,一个组件带有文件+注册,另一个组件仅带有文件,使它们互斥,并在属性上使用记住属性模式。根据条件调节适当的组件。

Having said that, that's not really the way to do registration. Use Heat to extract it into a component with the Dll. You'd probably need need two components, one with the file+registration and one with just the file, make them mutually exclusive, and use the remember property pattern on the property. Condition the appropriate component on the condition.

到处都有条件-看来您正在将启动条件(条件消息...)与组件条件和自定义操作条件相混淆。

There are conditions everywhere - it looks like you are confusing launch conditions (Condition Message...) with component conditions and custom action conditions.

这篇关于如何在基于WIX安装程序的条件下注册COM dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆