简体   繁体   中英

Wix Custom Installer dialog throws error

I would like to create a wix install package. The requirements: a welcome dialog and a dialog to insert the username and password for a service installation. Here is my code:

    <Product Id="e84cd420-ad5e-4476-967c-dba1543eda42" Name="VSTS Backup Service" Language="1033" Version="1.5.9"
         Manufacturer="test" UpgradeCode="9c52783e-e443-4ab1-8c57-3c9901d384f5">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
    <MediaTemplate EmbedCab="yes" />
    <Feature Id="ProductFeature" Title="VSTS Backup Service" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
    </Feature>
    <UI>
        <Dialog Id="ServiceAccountDlg" Width="370" Height="270" Title="[ProductName] Setup">
            <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)">

                <Publish Event="WelcomeDlg" Value="0">1</Publish>
            </Control>
            <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
                <Publish Event="ExitDialog" Value="0">1</Publish>
                <Condition Action="disable"><![CDATA[ACCOUNT = "" OR PASSWORD = ""]]></Condition>
                <Condition Action="enable">ACCOUNT &lt;&gt; "" AND PASSWORD &lt;&gt; ""</Condition>
            </Control>
            <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes"
                     Text="!(loc.WixUICancel)">
                <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
            </Control>
            <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
            <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
            <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
            <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes"
                     Text="Enter service account details.">
            </Control>
            <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes"
                     Text="Service account" />
            <Control Type="Text" Width="322" Height="26" X="25" Y="56" Id="BodyLabel"
                     Text="Specify the logon account for the [ProductName] service." NoPrefix="yes">
            </Control>
            <Control Type="Text" Width="275" Height="10" X="25" Y="98" Id="AccountLabel"
                     Text="&amp;Account name (Example: domain\\user or user@domain):" />
            <Control Type="Edit" Width="194" Height="15" X="25" Y="111" Id="AccountTextbox" Property="ACCOUNT" />
            <Control Type="Text" Width="275" Height="10" X="25" Y="135" Id="PasswordLabel" Text="Pa&amp;ssword:" />
            <Control Type="Edit" Width="194" Height="15" X="25" Y="148" Id="PasswordTextbox" Property="PASSWORD" Password="yes" />
            <Control Id="WarningLabel" Type="Text" X="40" Y="170" Width="200" Height="40"
                     Text="The account entered here will not be validated. Make sure that the account details entered are correct." />
        </Dialog>

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

        <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="ServiceAccountDlg" Order="3">1</Publish>
        <!-- skip the page on the way back too -->
        <Publish Dialog="ServiceAccountDlg" Control="Finish" Event="NewDialog" Order="3" Value="WelcomeDlg">1</Publish>
    </UI>

</Product>

The problem is I get an error when building the project:

Severity Code Description Project File Line Suppression State Error ICE03: Not a valid foreign key; Table: ControlEvent, Column: Control_, Key(s): ServiceAccountDlg.Finish.NewDialog.ServiceAccountDlg.NOT Installed Installer C:\\Projects\\VSTSBackup\\Installer\\Product.wxs 53

What am I doing wrong?

In your declaration:

Publish Dialog="ServiceAccountDlg" Control="Finish"...

There does not appear to be a control with an Id of Finish in that dialog.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM