如何在Wix安装程序中显示带警告消息的对话框?

时间:2016-06-22 09:28:44

标签: wix

如果安装了firefox维护服务,我需要在运行安装程序时显示警告消息。 为此,我添加了一个注册表搜索属性,然后在wix中添加了对话框的代码:

    <Property Id="MAINTENANCESERVICEINSTALLED">
  <RegistrySearch Id="MSID" Root="HKLM" Key="SOFTWARE\Mozilla\MaintenanceService" Name="Installed" Type="raw"/>
</Property>
    <UI>
  <Dialog Id="MaintenanceServiceWarningDialog" Width="284" Height="73" Title="Warning" NoMinimize="yes">
    <Control Id="Text" Type="Text" X="38" Y="8" Width="240" Height="40" TabSkip="no">
      <Text>Firefox Maintenance is installed on your system. Disable it to prevent compatibility issues. Click OK to proceed.</Text>
    </Control>
    <Control Id="OK" Type="PushButton" X="114" Y="52" Width="56" Height="17" Default="yes"  Cancel="yes" Text="OK">
      <Publish Event="EndDialog" Value="Return">1</Publish>
    </Control>
  </Dialog>  
<InstallUISequence>
  <Show Dialog="MaintenanceServiceWarningDialog" Sequence="1"> <![CDATA[NOT Installed AND MAINTENANCESERVICEINSTALLED]]></Show>
</InstallUISequence>
</UI>

我用来显示对话框。上面的代码在&#34; Product&#34;标签。 我正在解决这个问题,如下所示。当我将UI代码移动到Fragment时,安装程​​序不会显示任何内容。不确定是什么错误。

1 个答案:

答案 0 :(得分:0)

您的InstallUISequence元素位于UI元素内。