【发布时间】:2013-04-26 13:04:56
【问题描述】:
我有两个自定义对话框(加上必需的ExitDlg、FatalErrorDlg 等),第一个使用 Edit 控件设置属性,第二个使用 Text 控件显示此属性。这是有意义的代码:
<Dialog Id="DialogA" ...>
<Control Id="ControlEdit" Type="Edit" Property="MY_PROPERTY" .../>
<Control Id="ControlNext" Type="PushButton" ...>
<Publish Event="EndDialog" Value="Return" /></Control>
</Dialog>
然后是第二个对话框:
<Dialog Id="DialogB" ...>
<Control Id="ControlText" Type="Text" Text="[MY_PROPERTY]" .../>
<Control Id="ControlBack" Type="PushButton" ...>
<Publish Event="EndDialog" Value="Return" /></Control>
<Control Id="ControlNext" Type="PushButton" ...>
<Publish Event="EndDialog" Value="Return" /></Control>
</Dialog>
以及动作顺序:
<InstallUISequence>
<Show Dialog="DialogA" Before="MyCustomAction" />
<Custom Action="MyCustomAction" Before="DialogB" />
<Show Dialog="DialogB" Before="ExecuteAction" />
</InstallUISequence>
自定义操作会更改MY_PROPERTY 的值。我的问题是如何使DialogB中的后退按钮返回DialogA。使用NewDialog 很简单,但是我无法在对话框之间执行自定义操作,或者我可以吗?
编辑 - 2013-05-02
在@caveman_dick 的回答之后,我几乎像他说的那样尝试更改DialogA,但我没有使用EndDialog,而是更改为Action="NewDialog" Value="DialogB"。但是现在没有调用自定义操作。如果我删除 Publish 事件以转到下一个对话框,则调用 CA。如果我像@caveman_dick 说的那样离开,我就无法从DialogB 回到DialogA。
编辑 - 2013-05-02
在WiX 3.6:Windows Installer XML 开发人员指南一书中搜索后,我发现了以下内容:“如果您有多个 Publish 事件,它们必须有条件语句作为其内部文本。否则,所有事件都不会发布。”
所以@caveman_dick 的答案是正确的,只是你需要更改为以下内容:
<Publish ...>1</Publish>
【问题讨论】:
标签: wix installation windows-installer custom-action