Wix 会话对象

发布于 2024-12-04 13:02:11 字数 1352 浏览 2 评论 0原文

有谁知道这个对象什么时候仍然可用?

我正在尝试创建一个名为以下的自定义操作:

         <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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

戏舞 2024-12-11 13:02:11

您只能通过延迟 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文