[wix-users] Property Value Updating?

Brian Enderle brianke at gmail.com
Wed Sep 28 05:18:47 PDT 2016


I have a dialog in my MSI that allows a user to select "Server" or "Client"
installation.  "Server" installation is supposed to execute a custom action
setting up some SQL tables.  A "Client" installation should simply skip the
CustomAction.

I am having an issue where if the user switches between "Server" and
"Client", finalizing on "Server" before proceeding to the next screen,  the
install will perform a "Client" installation.

I know the property is updating properly as I can see the log messages
about modifying CLIENT_SERVER_INSTALL. Anyone know why the CustomActions
are not being executed when CLIENT_SERVER_INSTALL = 1?


Action 8:00:57: ClientServerDlg. Dialog created
MSI (c) (78:FC) [08:00:59:145]: PROPERTY CHANGE: Modifying
CLIENT_SERVER_INSTALL property. Its current value is '1'. Its new value:
'0'.
MSI (c) (78:FC) [08:01:03:927]: PROPERTY CHANGE: Modifying
CLIENT_SERVER_INSTALL property. Its current value is '0'. Its new value:
'1'.
MSI (c) (78:FC) [08:01:36:151]: Note: 1: 2727 2:
Action 8:01:36: AcctInfoDlg. Dialog created




The dialog is nothing more than two radio buttons:

<Fragment>

    <UI>

      <Property Id="CLIENT_SERVER_INSTALL" Secure="yes" Value="1" />

      <Dialog Id="ClientServerDlg" Width="370" Height="270"
Title="[ProductName] Setup" NoMinimize="yes">

        <!-- Back button takes us to Install Directory dialog -->
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56"
Height="17" Text="!(loc.WixUIBack)">
          <Publish Event="NewDialog" Value="InstallDirDlg">1</Publish>
        </Control>

        <!-- Next button takes us to the Account Info dialog -->
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56"
Height="17" Default="yes" Text="!(loc.WixUINext)">
          <!-- If Client option is selected, remove the FoxPro service from
installation -->
          <Publish Event="Remove"
Value="ServiceFeature">CLIENT_SERVER_INSTALL = 0</Publish>
        </Control>

        <!-- Cancel button takes us to the Cancel dialog -->
        <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="Title" Type="Text" X="15" Y="6" Width="200"
Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}
Client or Server Installation" />
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280"
Height="15" Transparent="yes" NoPrefix="yes" Text="Please select if this is
a client or server installation" />
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370"
Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
        <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" />

        <!-- Choose Client or Server installation -->
        <Control Id="ClientServerRadioButtonGroup" Type="RadioButtonGroup"
X="30" Y="63" Width="200" Height="100" Property="CLIENT_SERVER_INSTALL"
Text="Select Client or Server installation">
          <RadioButtonGroup Property="CLIENT_SERVER_INSTALL">
            <RadioButton Value="1" X="0" Y="0" Width="200" Height="10"
Text="Server" />
            <RadioButton Value="0" X="0" Y="20" Width="200" Height="10"
Text="Client" />
          </RadioButtonGroup>
        </Control>

      </Dialog>
    </UI>
  </Fragment>



I am calling the custom action from Product.wxs like so:

    <!-- CusomtActions.dll -->
    <Binary Id="CustomAction.CA"
SourceFile="$(var.SolutionDir)CustomActions\bin\CustomActions.CA.dll" />


    <InstallExecuteSequence>
      <!-- Only execute on install (not repair or uninstall) and for SERVER
install -->
      <Custom Action='ExecuteSQLParameters' Before='InstallFinalize'>NOT
Installed AND NOT REMOVE AND CLIENT_SERVER_INSTALL = 1</Custom>
      <Custom Action='ExecuteSQL' After='ExecuteSQLParameters'>NOT
Installed AND NOT REMOVE AND CLIENT_SERVER_INSTALL = 1</Custom>
    </InstallExecuteSequence>


And here are the CustomAction calls:

    <!-- Need to perform a CustomAction to execute SQL command script with
parameters -->
    <!-- ExecuteSQLParameters adds the various values, needed by the
CustomAction, to the call to ExecuteSQL -->
    <CustomAction Id="ExecuteSQLParameters"
                  Return="check"
                  Property="ExecuteSQL"

Value="Server=[SQLSERVER];Database=master;Username=[SQLUSER];Password=[SQLPASSWORD];Directory=[INSTALL_SCRIPTS_FOLDER];FoxProPath=[FOXPROPATH]"
/>

    <!-- Execute the CustomAction code-->
    <CustomAction Id="ExecuteSQL"
                  BinaryKey="CustomAction.CA"
                  DllEntry="ExecuteSQLCustomAction"
                  Execute="deferred"
                  Impersonate="no"
                  Return="check" />



Brian

If you can't explain it simply, you don't understand it well enough.  -
Albert Einstein


More information about the wix-users mailing list