【发布时间】:2010-10-12 19:19:40
【问题描述】:
我遇到了关于 wix 和托管自定义操作的问题:我已经管理它以创建托管自定义操作并从我的安装程序中调用它(在安装日志文件中验证它)。我现在的问题是我没有设法将数据传递给自定义操作。 Afaik 如果我选择在这么晚的阶段运行自定义操作,我必须将该操作标记为“延迟”。有了这个限制,就只能访问 CustomActionData 属性吗?为什么这在我的情况下不起作用? (据我所见,我从样本中正确采用了一切?)
这是我已经尝试过的:
自定义操作:
public class CustomActions
{
[CustomAction]
public static ActionResult RegisterDflHelp(Session session)
{
session.Log("Begin CustomAction1");
session.Log("Before Access to customactiondata");
//string helpdir = session["HELP_DIR"];
string cad = session["CustomActionData"];
Debugger.Break();
session.Log("Help dir is: " + helpdir);
session.Log("Custom Action Data is: " + cad);
return ActionResult.Success;
}
}
调用自定义操作的合并模块:
<CustomAction Id='RegisterDflHelp' BinaryKey='RegisterDflHelpDll' DllEntry='RegisterDflHelp' Execute='deferred' />
<CustomAction Id="HELP_DIR.SetProperty" Return="check" Property="HELP_DIR" Value="Teeest" />
<Property Id='HELP_DIR' Secure='yes'/>
<InstallExecuteSequence>
<Custom Action='HELP_DIR.SetProperty' After='InstallFiles' />
<Custom Action='RegisterDflHelp' After='HELP_DIR.SetProperty' />
</InstallExecuteSequence>
<Directory Id="TARGETDIR" Name="SourceDir">
</Directory>
<ComponentGroupRef Id="HelpGroup"/>
包含帮助合并模块的产品:
<Product....>
<Package....>
...
<Directory>
<!--Directory which gets the help folder--!>
<Merge Id ="DflHelpInstaller" SourceFile="DflHelpInstaller.msm" Language="1033" DiskId="1" />
任何人的想法?提前致谢!!
丹尼尔
顺便说一句:还有什么有趣的事情要知道:在安装过程的哪个阶段必须将操作标记为延迟?如果我设法在这个阶段之前调用我的自定义操作。有什么好处?
【问题讨论】:
标签: wix windows-installer wix3