开发者

how to replace a error message (2753) with an pop up window (WIX)

开发者 https://www.devze.com 2023-01-26 22:24 出处:网络
I want to know how to replace a message error for a pop up window on Wix. I\'ve a Installer that have two different Features and when I don\'t select any option an error message appears:

I want to know how to replace a message error for a pop up window on Wix.

I've a Installer that have two different Features and when I don't select any option an error message appears: "The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2753."

<Feature Id="Complete" Title="App"
         Display="expand" Level="1" AllowAdvertise='no' InstallDefault='local'>

  <Feature Id="App1" Title="App1.exe" Level="1" AllowAdvertise='no' InstallDefault='local'>
    <Condition Level="0">INSTALL_GUEST_FEATURES = 0</Condition>

    <ComponentRef Id="App1Executable" />
  </Feature>

  <Feature Id="App2" Title="App2.exe" Level="1" All开发者_C百科owAdvertise='no' InstallDefault='local'>
    <Condition Level="0">INSTALL_HOST_FEATURES = 0</Condition>

    <ComponentRef Id="App2Executable" />

  </Feature>
</Feature>

<UIRef Id="WixUI_FeatureTree" />
<UIRef Id="WixUI_ErrorProgressText" />

Can I replace this message for a pop up window?

Thanks!


You can create a custom dialog box and pass the error message into it. See my code below.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <UI>
            <Dialog Id="InvalidDBConnDlg" Width="260" Height="120" Title="[ProductName]">
                <Control Id="OK" Type="PushButton" X="102" Y="90" Width="56" Height="17" Default="yes" Cancel="yes" Text="OK">
                    <Publish Event="EndDialog" Value="Return">1</Publish>
                </Control>
                <Control Id="Text" Type="Text" X="48" Y="22" Width="194" Height="60" Text="[DBCONNERR]" />
                <Control Id="Icon" Type="Icon" X="15" Y="15" Width="24" Height="24" ToolTip="Information icon" FixedSize="yes" IconSize="32" Text="WixUI_Ico_Info" />
            </Dialog>
        </UI>
    </Fragment>
</Wix>

From your custom action you need to set the value of DBCONNERR and call this dialog box if certain condition are not met

0

精彩评论

暂无评论...
验证码 换一张
取 消