title: How to set a Property in Wix
body: <p>I'm confused about the correct procedure for setting a Property in Wix. Is it necessary to use an Event? Are there existing, built-in, events and can they be tailored to custom Wix Properties? What I'm trying to do (with Wix 3.0) is install a IIS Virtual Directory using a custom UI. The problem here is that the property I'm attempting to set the virtual directory name with is not being over-written from the value provided in the interface. The other property here used for the installation path is being over-written and it looks like the Event="SetTargetPath" is what is taking care of that, am I wrong or missing something with this installation UI? Thanks much for your help.</p>
  
  <pre><code>&lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;
    &lt;Directory Id="ProgramFilesFolder" Name="PFiles"&gt;
      &lt;Directory Id="MyCo" Name="MyCo"&gt;
        &lt;Directory Id="FILEINSTALLDIR" Name="MyCo Admin"&gt;
          &lt;Component Id="MyCo_AdminComponent" Guid="########-####-####-####-############"&gt;
            &lt;File Source="Default.aspx" Vital="yes" KeyPath="yes" DiskId="1"/&gt;
          &lt;/Component&gt;
        &lt;/Directory&gt;
      &lt;/Directory&gt;
    &lt;/Directory&gt;
    &lt;Component Id='ADMINVIRTUALDIRCOMP' Guid='########-####-####-####-############' Permanent='no'&gt;
      &lt;iis:WebVirtualDir Id='VIRTUALDIRECTORY' Alias='[WIXUI_VIRTUALDIR]' Directory='FILEINSTALLDIR' WebSite='DefaultWebSite'&gt;
        &lt;iis:WebApplication Id='ADMINWEBAPPLICATION' Name='[WIXUI_VIRTUALDIR]' /&gt;
      &lt;/iis:WebVirtualDir&gt;
    &lt;/Component&gt;      
  &lt;/Directory&gt;
  
  &lt;iis:WebSite Id='DefaultWebSite' Description='Default Web Site'&gt;
    &lt;iis:WebAddress Id='AllUnassigned' Port='80' /&gt;
  &lt;/iis:WebSite&gt;
  
  &lt;Feature Id="ProductFeature" Title="MyCo WebApp" Level="1"&gt;
    &lt;ComponentRef Id="MyCo_AdminComponent" /&gt;
    &lt;ComponentRef Id="ADMINVIRTUALDIRCOMP" /&gt;
  &lt;/Feature&gt;
  
  &lt;UIRef Id="WixUI_Common" /&gt;
  &lt;UIRef Id="WixUI_InstallWeb" /&gt;
  &lt;Property Id="WIXUI_INSTALLDIR" Value="FILEINSTALLDIR" /&gt;
  &lt;Property Id="WIXUI_VIRTUALDIR" Value ="VIRTUALDIR" &gt;&lt;/Property&gt;
  &lt;Property Id="VIRTUALDIR" &gt;&lt;![CDATA[AdminCompName]]&gt;&lt;/Property&gt;
  
    &lt;UI Id="WixUI_InstallWeb"&gt;
  
    &lt;TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /&gt;
    &lt;TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /&gt;
    &lt;TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /&gt;
  
    &lt;Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /&gt;
    &lt;Property Id="WixUI_Mode" Value="InstallDir" /&gt;
  
    &lt;DialogRef Id="BrowseDlg" /&gt;
    &lt;DialogRef Id="DiskCostDlg" /&gt;
    &lt;DialogRef Id="ErrorDlg" /&gt;
    &lt;DialogRef Id="FatalError" /&gt;
    &lt;DialogRef Id="FilesInUse" /&gt;
    &lt;DialogRef Id="MsiRMFilesInUse" /&gt;
    &lt;DialogRef Id="PrepareDlg" /&gt;
    &lt;DialogRef Id="ProgressDlg" /&gt;
    &lt;DialogRef Id="ResumeDlg" /&gt;
    &lt;DialogRef Id="UserExit" /&gt;
  
    &lt;Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3"&gt;1&lt;/Publish&gt;
    &lt;Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"&gt;
      &lt;![CDATA[WIXUI_INSTALLDIR_VALID&lt;&gt;"1"]]&gt;
    &lt;/Publish&gt;
  
      &lt;Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999"&gt;1&lt;/Publish&gt;
  
      &lt;Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallWebDlg"&gt;1&lt;/Publish&gt;
  
      &lt;Publish Dialog="InstallWebDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg"&gt;1&lt;/Publish&gt;
      &lt;Publish Dialog="InstallWebDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1"&gt;1&lt;/Publish&gt;
      &lt;Publish Dialog="InstallWebDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2"&gt;
        NOT WIXUI_DONTVALIDATEPATH&lt;/Publish&gt;
      &lt;Publish Dialog="InstallWebDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"&gt;
        &lt;![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID&lt;&gt;"1"]]&gt;&lt;/Publish&gt;
      &lt;Publish Dialog="InstallWebDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4"&gt;
        WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"&lt;/Publish&gt;
      &lt;Publish Dialog="InstallWebDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1"&gt;1&lt;/Publish&gt;
      &lt;Publish Dialog="InstallWebDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2"&gt;1&lt;/Publish&gt;
      &lt;Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallWebDlg" Order="1"&gt;NOT Installed&lt;/Publish&gt;
      &lt;Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2"&gt;Installed&lt;/Publish&gt;
      &lt;Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg"&gt;1&lt;/Publish&gt;
  
      &lt;Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg"&gt;1&lt;/Publish&gt;
      &lt;Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg"&gt;1&lt;/Publish&gt;
  
      &lt;Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg"&gt;1&lt;/Publish&gt;
  
      &lt;Property Id="ARPNOMODIFY" Value="1" /&gt;
  
      &lt;Dialog Id="InstallWebDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)"&gt;
        &lt;Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" &gt;
        &lt;/Control&gt;
        &lt;Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" /&gt;
        &lt;Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)"&gt;
        &lt;Publish Event="SpawnDialog" Value="CancelDlg"&gt;1&lt;/Publish&gt;
        &lt;/Control&gt;
  
        &lt;Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgDescription)" /&gt;
        &lt;Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgTitle)" /&gt;
        &lt;Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" /&gt;
        &lt;Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" /&gt;
        &lt;Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" /&gt;
  
        &lt;Control Id="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="!(loc.InstallDirDlgFolderLabel)" /&gt;
        &lt;Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" /&gt;
        &lt;Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" /&gt;
  
        &lt;Control Id="VirtualDirLabel" Type="Text" X="20" Y="160" Width="290" Height="10" NoPrefix="yes" Text="Virtual Directory:" /&gt;
        &lt;Control Id="VirtualDir" Type="Edit" X="20" Y="172" Width="320" Height="18" Property="WIXUI_VIRTUALDIR" Indirect="yes" /&gt;
      &lt;/Dialog&gt;
     &lt;/UI&gt;
  </code></pre>