Wix Session Object
Does anyone know at what point this object is still available?
I am trying to create a custom action called as follws:
<Control Id="Test_Button" Type="PushButton" X="100" Y="100" Width="56" Height="17" Text="Test">
<Publish Event="DoAction" Value="TestDatabaseConnection.SetProperties">1</Publish>
<Publish Event="DoAction" Value="TestDatabaseConnection">1</Publish>
</Control>
I have also defined
<CustomAction Id="TestDatabaseConnection.SetProperties" Property="TestDatabaseConnection" Value="CONNECTIONPROVIDER=[CONNECTIONPROVIDERNAME];PRIMARY_SERVER=[SERVER];PRIMARY_USERID=[USERID];PRIMARY_PASSWORD=[PASSWORD];"/>
<CustomAction Id="TestDatabaseConnection" BinaryKey="WixCustomActions" DllEntry="TestDatabaseConnection"/>
But I keep getting an error in the custom action, and it down to when I try and retrieve the set parameters.
I.e.
server = session.CustomActionData["PRIMARY_SERVER"];
boom it blows up
Action ended 13:11:46: TestDatabaseConnection. Return value 3.
DEBUG: Error 2896: Executing action TestDatabaseConnection failed.
The installer has encounte开发者_运维知识库red an unexpected error installing this package. This may indicate a problem with this package. The error code is 2896. The arguments are: TestDatabaseConnection, ,
This code works when put at the end of the execution cycle but now I want to call it when a button is pressed.
Any clues?
You only serialize and deserialize properties through a CustomActionData class for deferred CA's. Immeadiate Ca's ( like when called from DoAction control events ) don't need this and it won't work.
精彩评论