Wix 4: Burn Bundle ask the user for variable(s)?

69 views Asked by At

I am using a burn bundle to install several separate MSIs. One of the MSIs needs to interface with a SQL Server and therefore needs an url, password etc.

Is there an easyish way to prompt the user for the required variables? I have a hard time grokking the wix docs on that subject.

1

There are 1 answers

0
joy On

I think in WiX, you would use the <Dialog> element to define the dialog box and the <Control> element to define the controls on the dialog box.

Now the code would be something like:

<UI>
  <Dialog Id="SqlSettingsDlg" Width="370" Height="270" Title="[ProductName]">
    <Control Id="UrlLabel" Type="Text" X="20" Y="60" Width="290" Height="16" Text="SQL Server URL:" />
    <Control Id="UrlEdit" Type="Edit" X="20" Y="80" Width="290" Height="18" Property="SQLSERVERURL" />
    <Control Id="PasswordLabel" Type="Text" X="20" Y="110" Width="290" Height="16" Text="SQL Server password:" />
    <Control Id="PasswordEdit" Type="Edit" X="20" Y="130" Width="290" Height="18" Password="yes" Property="SQLSERVERPASSWORD" />
    <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="Next">
      <Publish Property="SQLSERVERURL" Value="[SQLSERVERURL]" />
      <Publish Property="SQLSERVERPASSWORD" Value="[SQLSERVERPASSWORD]" />
      <Publish Event="EndDialog" Value="Return" />
    </Control>
    <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
      <Publish Event="SpawnDialog" Value="CancelDlg" />
    </Control>
  </Dialog>
</UI>

Bottom line, if you want to display this dialog box during the isntallation process, you should be adding the code to Wix source file:

<UIRef Id="WixUI_InstallDir" />
<UIRef Id="SqlSettingsDlg" />