[wix-users] Custom Dialog odd behaviour

Habib Salim habib at hsalim.com
Thu Dec 14 20:38:30 PST 2017


Hello,

I am building an installer that uses a custom action to check the
existence of a database on the target server.
If the database does not exist, the user can create the database (or skip
and install just the application)

Copy of the UI wxs is pasted below.

I have a textbox edit control with a DATABASE_NAME
And a few labels that have the DATABASE_NAME in the label text
An image or two that show if the database exists, and a custom action that
checks the for the existence of the db.

When I change the value in the textbox and tab off, the value of the
property changes
When the custom action fires, it sets the value of  DBEXISTS  and CHECKED 
(I see the change on the install log)

What is not working?  The label that contains DATABASE_NAME does not
change when I tab off after the change.
The database name is correctly embedded in the label when the form opens
but remains frozen after that)

The images don't show/hide correctly when the custom action returns.
However, the image does change if I then change  DATABASE_NAME

Sequence of events:
Dialog opens with default database name.  label is OK
Change database name - no change in UI.  Property does change.
Click Check database exists button.  Custom action fires. DBEXISTS  and
CHECKED values set correctly.  no change in UI.  

Change DATABASE name
Images now appear/disappear as expected for the previous database name .

I am stumped.  

Thanks for reading.  

Regards
Habib










---------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <!-- Copied (and modified)
from:https://stackoverflow.com/questions/14480837/wix-database-deployment-
installation  -->

  <Fragment>
    <UI>
      <Property Id='DBEXISTS' Value='0' ></Property>
      <Property Id='CHECKED' Value='0' ></Property>

      <!-- DATABASE NAME DIALOG -->
      <Dialog Id="DbNameDlg" Width="370" Height="300" Title="[ProductName]
[Setup]" NoMinimize="yes">

        <Control Y="0" X="0" Width="370" Height="44" Type="Bitmap"
Id="BannerBitmap" TabSkip="no" Text="WixUI_Bmp_Banner" />
        <Control Y="6" X="15" Width="200" Height="15" Type="Text"
Id="Title" Transparent="yes" NoPrefix="yes">
          <Text>{\WixUI_Font_Title}Database Settings</Text>
        </Control>
        <Control Y="23" X="25" Width="280" Height="15" Type="Text"
Id="Description" Transparent="yes" NoPrefix="yes">
          <Text>PivotViews Report Definition database setup</Text>
        </Control>
        <Control  Y="44" X="0" Width="370" Height="0" Type="Line"
Id="BannerLine"/>

        <!-- Connection String -->

        <Control Y="60" X="20" Width="100" Height="15" Type="Text"
Id="ServerNameLabel" TabSkip="no" Text="Database Server:" />
        <Control Y="60" X="110" Width="200" Height="18" Type="Edit"
Id="ServerNameEdit" Property="DATABASE_SERVER" Text="{100}" Disabled="yes"
/>

        <Control Y="80" X="20" Width="100" Height="15" Type="Text"
Id="DatabaseNameLabel" TabSkip="no" Text="Database name:" />
        <Control Y="80" X="110" Width="200" Height="18" Type="Edit"
Id="DatabaseNameEdit" Property="DATABASE_NAME" Text="{100}" />

      <Control Y="180" X="20" Width="200" Height="15" Type="Text"
Id="DatabaseCheckLabel1" TabSkip="yes"  Text=" Does Database
[DATABASE_NAME] Exist?  ">
          <!--<Condition Action="hide"><![CDATA[DBEXISTS = 0
]]></Condition>
          <Condition Action="show"><![CDATA[DBEXISTS = 1 AND CHECKED =
1]]></Condition>-->
        </Control>        
        
        <Control Y="200" X="20" Width="100" Height="17" Type="PushButton"
Id="Test" Text="Check Database Exists">
          <Publish Event="DoAction" Value="CheckDBExists"
Order="1">1</Publish>
          <Publish Property="CHECKED"></Publish>
        </Control>

        <Control Y="200" X="230" Width="20" Height="20" Type="Bitmap"
Id="CheckDatabaseResult_Success" Text="success_bmp" >
          <Condition Action="hide"><![CDATA[DBEXISTS =0]]></Condition>
          <Condition Action="show"><![CDATA[DBEXISTS = 1 AND CHECKED =
1]]></Condition>
        </Control>

        <Control Y="200" X="250" Width="20" Height="20" Type="Bitmap"
Id="CheckDatabaseResult_Failure" Text="error_bmp">
          <Condition Action="hide"><![CDATA[DBEXISTS = 0 OR CHECKED =
0]]></Condition>
          <Condition Action="show"><![CDATA[DBEXISTS = 0 AND CHECKED =
1]]></Condition>
        </Control>

        <Control Y="220" X="20" Width="200" Height="30" Type="Text"
Id="DatabaseCheckLabel2" TabSkip="yes" >
          <Text>Database [DATABASE_NAME] Does not Exist.  
          Click Next to Create database or SkipDBinstall to continue
without this step" </Text>
          <Condition Action="hide"><![CDATA[DBEXISTS = 1 AND CHECKED =
1]]></Condition>
          <Condition Action="show"><![CDATA[DBEXISTS = 0 AND CHECKED =
1]]></Condition>
        </Control>       

        <Control Y="250" X="0" Width="370" Height="0" Type="Line"
Id="BottomLine" />

        <Control Y="270" X="100" Width="56" Height="17" Type="PushButton"
Id="SkipDbOps" Text="&Skip DB Install">
          <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
        </Control>

        <!-- Back button -->
        <Control Y="270" X="180" Width="56" Height="17" Type="PushButton"
Id="Back" Text="&Back">
          <Publish Event="NewDialog" Value="DbInfoDlg"
Order="2">1</Publish>
        </Control>
        <Control Y="270" X="236" Width="56" Height="17" Type="PushButton"
Id="Next" Default="yes" Text="&Next">


          <Publish Event="DoAction" Value="InstallPivotViewsDatabase"
Order="1">
            <![CDATA[DATABASE_NAME <> ""]]>
          </Publish>
          <Publish Event="NewDialog" Value="LicenseInfoDlg" Order="2">
            <!--if settings are correct, allow next dialog-->
            <![CDATA[DATABASE_NAME <> "" AND DBCREATED = 5]]>
          </Publish>
        </Control>

        <Control Y="270" X="304" Width="56" Height="17" Type="PushButton"
Id="Cancel" Cancel="yes" Text="Cancel">
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
        </Control>

      </Dialog>

    </UI>
  </Fragment>
</Wix>


More information about the wix-users mailing list