I have an MSI being created with Wxs 3.0. My MSI references a C# custom action, written using the new C# Custom Action project (http://blogs.msdn.com/jasongin/archive/2008/05/23/custom-action-project-templates.aspx)
I want to pass an argument to msiexec that gets routed to my custom action - eg:
msiexec /i MyApp.msi ENVIRONMENT=TEST#
In my Wxs, I refer to my custom action like this:
<Property Id="ENVIRONMENT"/>
<Binary Id="WixCustomAction.dll" SourceFile="$(var.WixCustomAction.Path)" />
<CustomAction Id="WixCustomAction" BinaryKey="WixCustomAction.dll" DllEntry="ConfigureSettings"/>
<InstallExecuteSequence>
<Custom Action="WixCustomAction" After="InstallFiles"></Custom>
</InstallExecuteSequence>
My C# custom action is setup like this:
[CustomAction]
public static ActionResult ConfigureSettings(Session session)
{
}
I was expecting to be able to access the property like this:
string environmentName = session.Property["ENVIRONMENT"];
but this doesn't seem to work.
How do I access the propery I passed to msiexec in my custom action?