title: Retrieve variable from WiX during CustomAction
body: <p>I am trying to retrieve a variable from WiX during an install. Here is the tests I have tried:</p>
  
  <pre><code>try
  {
      string reqid = session["REQUESTID"];
      TraceLog.LogMessage("CustomAction =&gt; ReportUpgradeStatus: Straight Session is valid");
  }
  catch
  {
      TraceLog.LogMessage("CustomAction =&gt; ReportUpgradeStatus: Straight Session is invalid");
  }
  try
  {
      string reqid = session.CustomActionData["REQUESTID"];
      TraceLog.LogMessage("CustomAction =&gt; ReportUpgradeStatus: CustomActionData is valid");
  }
  catch
  {
      TraceLog.LogMessage("CustomAction =&gt; ReportUpgradeStatus: CustomActionData is invalid");
  }
  try
  {
      string reqid = session.GetProductProperty("REQUESTID");
      TraceLog.LogMessage("CustomAction =&gt; ReportUpgradeStatus: GetProductProperty is valid");
  }
  catch
  {
      TraceLog.LogMessage("CustomAction =&gt; ReportUpgradeStatus: GetProductProperty is invalid");
  }
  </code></pre>
  
  <p>I have some xml in Product.wxs as such:</p>
  
  <pre><code>&lt;InstallExecuteSequence&gt;
    &lt;Custom Action="SetRequestIdProp" Before="InstallFiles" /&gt;  
    &lt;Custom Action="ReportUpgradeStatusMVACA" After="SetRequestIdProp" /&gt;    
    &lt;ScheduleReboot After="InstallFinalize"/&gt;
  &lt;/InstallExecuteSequence&gt;
  
  &lt;Fragment&gt;
    &lt;Binary Id="CustomActionBinary" SourceFile="..\..\..\Bin\$(var.Configuration)\InstallationCA.CA.dll"/&gt;    
    &lt;Property Id="REQUESTID" Value="[REQUESTID]" /&gt;   
    &lt;CustomAction Id="SetRequestIdProp" Property="REQUESTID" Value="[REQUESTID]" /&gt;    
    &lt;CustomAction Id="ReportUpgradeStatusMVACA" 
                BinaryKey="CustomActionBinary" 
                DllEntry="ReportUpgradeStatusMVA" 
                Execute="commit" 
                Return="check" /&gt;
  &lt;/Fragment&gt;
  </code></pre>
  
  <p>How can I access the RequestID property? I seriously am at a loss here as I everything I try to make that value appear does nothing.</p>
  
  <p>Any advice at all would be welcome.</p>
  
  <p>EDIT: Problem resolved. Here is what I needed to do:</p>
  
  <p>I changed my CustomAction to:</p>
  
  <pre><code>&lt;CustomAction Id="SetRequestIdProp" 
                Property="ReportUpgradeStatusMVACA" 
                Value="REQUESTID=[REQUESTID];APPLIANCEID=[APPLIANCEID];SERVICEURL=[SERVICEURL];STATUSDIR=[STATUSDIR];AUTOUPDATE=[AUTOUPDATE]" /&gt;
  &lt;CustomAction Id="ReportUpgradeStatusMVACA" 
                BinaryKey="CustomActionBinary" 
                DllEntry="ReportUpgradeStatusMVA" 
                Execute="deferred" 
                Return="check"
                HideTarget="no" /&gt;
  </code></pre>
  
  <p>And my InstallExecuteSequence to:</p>
  
  <pre><code>&lt;Custom Action="SetRequestIdProp" Before="ReportUpgradeStatusMVACA" /&gt;
  &lt;Custom Action="ReportUpgradeStatusMVACA" Before="InstallFinalize" /&gt;
  </code></pre>
  
  <p>I got the info using: </p>
  
  <pre><code>RequestId = Int32.Parse(session.CustomActionData["REQUESTID"]),
  ApplianceId = Int32.Parse(session.CustomActionData["APPLIANCEID"]),
  ServiceUrl = session.CustomActionData["SERVICEURL"],
  </code></pre>
  
  <p>Thanks for the help.</p>