<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
     xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
  <Fragment>
    <WixVariable Id="WixUIBannerBmp" Value="$(var.BannerBmp)" />
    <WixVariable Id="WixUIDialogBmp" Value="$(var.DialogBmp)" />

    <UI Id="TachyonUI">
      <ui:WixUI Id="WixUI_InstallDir" />

      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="TachyonInstallDirDlg" Condition="NOT Installed" Order="3" />
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="TachyonInstallDirDlg" Condition="NOT Installed" Order="3" />
      <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication"
               Condition="WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed" Order="1" />

      <Dialog Id="TachyonInstallDirDlg" Width="370" Height="270" Title="!(loc.InstallDirTitle)">
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
          <Publish Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1" />
          <Publish Event="NewDialog" Value="VerifyReadyDlg" Order="2" />
        </Control>
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)">
          <Publish Event="NewDialog" Value="WelcomeDlg" Order="1" />
        </Control>
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
          <Publish Event="SpawnDialog" Value="CancelDlg" />
        </Control>

        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="22" Transparent="yes" NoPrefix="yes"
                 Text="!(loc.InstallDirDescription)" />
        <Control Id="Title" Type="Text" X="15" Y="6" Width="260" Height="15" Transparent="yes" NoPrefix="yes"
                 Text="!(loc.InstallDirTitle)" />
        <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" />

        <Control Id="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="18" NoPrefix="yes"
                 Text="!(loc.InstallDirDlgFolderLabel)" />
        <Control Id="Folder" Type="PathEdit" X="20" Y="82" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
        <Control Id="ChangeFolder" Type="PushButton" X="20" Y="106" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)">
          <Publish Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1" />
          <Publish Event="SpawnDialog" Value="BrowseDlg" Order="2" />
        </Control>

        <Control Id="DesktopShortcutCheck" Type="CheckBox" X="20" Y="142" Width="320" Height="18"
                 Property="INSTALLDESKTOPSHORTCUT" CheckBoxValue="1"
                 Text="!(loc.DesktopShortcutCheckbox)" />
        <Control Id="AutostartCheck" Type="CheckBox" X="20" Y="166" Width="320" Height="18"
                 Property="INSTALLAUTOSTART" CheckBoxValue="1"
                 Text="!(loc.AutostartCheckbox)" />
      </Dialog>
    </UI>
  </Fragment>
</Wix>
