感谢@vitaliy-zadorozhnyy,我能够想出一个我自己都不理解的奇怪代码。但它有效。
...
...
<Property Id="DBCHECK_INPROGRESS" Value="0" />
<Property Id="DBCHECK_NOTINPROGRESS" Value="0" />
...
...
<Control Id="{Id}" Type="{Type}">
<Condition Action="enable"><![CDATA[DBCHECK_INPROGRESS <> 1]]></Condition>
<Condition Action="disable"><![CDATA[DBCHECK_INPROGRESS = 1]]></Condition>
</Control>
{insert those conditions for any control you want to disable during action}
...
...
<Control Id="Next" Type="PushButton">
<Condition Action="enable"><![CDATA[DBCHECK_INPROGRESS <> 1]]></Condition>
<Condition Action="disable"><![CDATA[DBCHECK_INPROGRESS = 1]]></Condition>
<Publish Event="DoAction" Value="SetInProgress">1</Publish>
<Publish Property="TEMP_INPROGRESS" Value="[DBCHECK_INPROGRESS]">1</Publish>
<Publish Property="DBCHECK_INPROGRESS" Value="[TEMP_INPROGRESS]" />
<Publish Event="DoAction" Value="CheckDBConnection"/>
<Publish Event="DoAction" Value="SetNotInProgress">1</Publish>
<Publish Property="TEMP_NOTINPROGRESS" Value="[DBCHECK_NOTINPROGRESS]">1</Publish>
<Publish Property="DBCHECK_NOTINPROGRESS" Value="[TEMP_NOTINPROGRESS]" />
{other events}
</Control>
和自定义操作(JScript)很简单:
function SetInProgress_CA() {
Session.Property("DBCHECK_INPROGRESS") = "1";
}
function SetNotInProgress_CA() {
Session.Property("DBCHECK_INPROGRESS") = "0";
}