我已关注Fragment
来定义我的CustomAction
(实际上我的CA项目中有两种方法)
<Fragment>
<Binary Id="FooAssembly"
SourceFile="Foo.CA.dll" />
<CustomAction Id="Action1"
BinaryKey="FooAssembly"
DllEntry="Action1" />
<CustomAction Id="Action2"
BinaryKey="FooAssembly"
DllEntry="Action2" />
</Fragment>
我的Action1
看起来像这样:
[Microsoft.Deployment.WindowsInstaller.CustomAction]
public static ActionResult Action1(Microsoft.Deployment.WindowsInstaller.Session session)
{
session["value1"] = "some value";
session["value2"] = "some value";
return ActionResult.Success;
}
现在我需要在显示对话框时运行此CustomAction
并将值value1
绑定到Edit
- 控件如下:
<Dialog Id="FooDlg">
<Control Id="FooEdit"
Type="Edit"
Text="[value1]"
Property="value1"
Disabled="yes" />
</Dialog>
我的InstallUISequence
看起来像这样
<InstallUISequence>
<Show Dialog="FooDlg"
After="CostFinalize" />
</InstallUISequence>
我在这里使用Edit
- 控件,因为我需要一些边框 - Text
缺少 - 因此我需要填充属性Property
。
我怎样才能做到这一点?
答案 0 :(得分:0)
我通过改编InstallUISequence
喜欢
<InstallUISequence>
<Custom Action="Action1"
After="CostFinalize" />
<Show Dialog="FooDlg"
After="Action1" />
</InstallUISequence>