title: Wix: Can't set a property with a custom action
body: <p>I have a dialog that's part of my installer to enter a activation key. I'm able to pass the value from this control,</p>
  
  <pre><code>         &lt;Control Id="KEY1" Type="Edit" Property="KEY1" Height="17" Width="45" X="50" Y="150" Text="{5}" Indirect="no"/&gt;
  </code></pre>
  
  <p>to my custom action,</p>
  
  <pre><code> session["KEY1"]
  </code></pre>
  
  <p>But I can't seem to figure out why I can't set session["KEY1"] = "test" and see the value in my control... I tried everything but nothing works. Here's my current code,</p>
  
  <p><strong>C# (Custom Action)</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using Microsoft.Deployment.WindowsInstaller;
  
  namespace Test.CustomActions
  {
      public class CustomActions
      {
          [CustomAction]
          public static ActionResult TestAction(Session session)
          {
              session.Log("Begin CustomAction1");
  
              session["KEY1"] = "lol";
              string[] lines = { session["KEY1"], "Second line", "Third line" };
              System.IO.File.WriteAllLines(@"C:\CustomAction.txt", lines);
  
              return ActionResult.Success;
          }
      }
  }
  </code></pre>
  
  <p><strong>Wix</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
    &lt;Fragment&gt;
      &lt;Property Id="KEY1" Value="Test" Secure="yes"/&gt;
      &lt;Property Id="Key2"/&gt;
      &lt;Property Id="Key3"/&gt;
      &lt;Property Id="Key4"/&gt;
      &lt;Property Id="Key5"/&gt;
      &lt;Property Id="Key6"/&gt;
      &lt;UI&gt;
        &lt;Dialog Id="ActivationCodeDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)"&gt;
          &lt;Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)"/&gt;
          &lt;Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}Activation Code"/&gt;
          &lt;Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Please enter your activation code"/&gt;
          &lt;Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0"/&gt;
  
          &lt;Control Id="KEY1" Type="Edit" Property="KEY1" Height="17" Width="45" X="50" Y="150" Text="{5}" Indirect="no"/&gt;
          &lt;Control Id="Hyphen1" Type="Text" Height="17" Width="5" X="96" Y="153" Text="-"/&gt;
          &lt;Control Id="Key2" Type="Edit" Property="Key2" Height="17" Width="45" X="100" Y="150" Text="{5}"/&gt;
          &lt;Control Id="Hyphen2" Type="Text" Height="17" Width="5" X="146" Y="153" Text="-"/&gt;
          &lt;Control Id="Key3" Type="Edit" Property="Key3" Height="17" Width="45" X="150" Y="150" Text="{5}"/&gt;
          &lt;Control Id="Hyphen3" Type="Text" Height="17" Width="5" X="196" Y="153" Text="-"/&gt;
          &lt;Control Id="Key4" Type="Edit" Property="Key4" Height="17" Width="45" X="200" Y="150" Text="{5}"/&gt;
          &lt;Control Id="Hyphen4" Type="Text" Height="17" Width="5" X="246" Y="153" Text="-"/&gt;
          &lt;Control Id="Key5" Type="Edit" Property="Key5" Height="17" Width="45" X="250" Y="150" Text="{5}"/&gt;
          &lt;Control Id="Hyphen5" Type="Text" Height="17" Width="5" X="296" Y="153" Text="-"/&gt;
          &lt;Control Id="Key6" Type="Edit" Property="Key6" Height="17" Width="15" X="300" Y="150" Text="{1}"/&gt;
  
          &lt;Control Id="Activate" Type="PushButton" X="50" Y="200" Width="56" Height="17" Text="Activate"&gt;
            &lt;Publish Event="DoAction" Value="Testing"/&gt;
          &lt;/Control&gt;
  
          &lt;Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0"/&gt;
          &lt;Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)"/&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;/Dialog&gt;
      &lt;/UI&gt;
      &lt;CustomAction Id='Testing' BinaryKey='FooBinary' DllEntry='TestAction' Execute='immediate'/&gt;
      &lt;Binary Id='FooBinary' SourceFile='Feenics.Keep.CustomActions.CA.dll'/&gt;
    &lt;/Fragment&gt;
  &lt;/Wix&gt;
  </code></pre>