我试图用Dialog
来制作Control
,当我点击PushButton
时,它会破坏所有instalator:
<Control Id="Cancel" Type="PushButton" X="304" Y="100" Width="56" Height="17" Default="yes" Text="Exit">
<Publish Event="Finish" Value="Return">1</Publish>
</Control>
当我按下它时,我的安装程序返回代码2812
.
如何在Dialog
上编写Control
,这将关闭安装程序而不会出现任何错误?
法典:
...
<UI >
<Dialog Id="InstallDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
<Text>Ready to Install</Text>
</Control>
<Control Id="Install" Type="PushButton" X="304" Y="243" Width="56" Height="17" Default="yes" Text="Install">
<Publish Event="EndDialog" Value="Return" />
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="100" Width="56" Height="17" Default="yes" Text="Exit">
<Publish Event="Finish" Value="Return">1</Publish>
</Control>
</Dialog>
</UI>
...
<Upgrade Id="!(loc.UpgradeCode)">
<UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND'
Minimum='1.0.1' IncludeMinimum='no' />
</Upgrade>
...
<InstallUISequence>
<Show Dialog="InstallDlg" After='FindRelatedProducts' >NEWERFOUND</Show>
</InstallUISequence>
我假设您不希望使用确认对话框来避免意外退出。将该按钮的代码更改为:
<Control Id="Cancel" Type="PushButton" X="304" Y="100" Width="56" Height="17" Cancel="yes" Text="Exit">
<Publish Event="EndDialog" Value="Exit">1</Publish>
</Control>