Wix 会话对象
有谁知道这个对象什么时候仍然可用?
我正在尝试创建一个名为以下的自定义操作:
<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>
我还定义了
<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"/>
但我在自定义操作中不断收到错误,并且直到我尝试检索设置的参数时才出现错误。
即
server = session.CustomActionData["PRIMARY_SERVER"];
,它爆炸了
Action ended 13:11:46: TestDatabaseConnection. Return value 3.
DEBUG: Error 2896: Executing action TestDatabaseConnection failed.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2896. The arguments are: TestDatabaseConnection, ,
这段代码在执行周期结束时可以工作,但现在我想在按下按钮时调用它。
有什么线索吗?
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 encountered 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只能通过延迟 CA 的 CustomActionData 类序列化和反序列化属性。即时 Ca(例如从 DoAction 控制事件调用时)不需要这个,并且它不会工作。
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.