【问题标题】:How to pass string with symbol ";" from CustomActionData to a CustomAction using WiX?如何传递带有符号“;”的字符串使用 WiX 从 CustomActionData 到 CustomAction?
【发布时间】:2014-06-18 13:43:01
【问题描述】:

我已经推迟了 C# 中的 CustomAction 和另一个将一些属性传递给它的方法。

<CustomAction Id="CustomAction1"
              Property="CustomAction2"
              Value="EncryptedString=[ENCRYPTEDSTRING]"
/>

但是,如果属性包含符号“;”那么

string encString=session.CustomActionData["EncryptedString"];

仅输出“;”之前的部分,因为该符号被视为属性之间的分隔符。 是否有任何解决方法可以传递包含“;”的字符串?

例如

ENCRYPTEDSTRING="12;3474dsfgee"

和输出

encString="12"

【问题讨论】:

    标签: wix custom-action


    【解决方案1】:

    您不能使用 DTF 的 CustomActionData;它假定自定义操作项由分号分隔。相反,直接获取 CustomActionData,不要使用 EncryptedString= 前缀。

    【讨论】:

    • 感谢您的回复,但是如何从延迟的自定义操作中获取 CustomActionData?
    • 使用会话索引器:session["CustomActionData"]
    【解决方案2】:

    【讨论】:

      猜你喜欢
      • 2012-06-29
      • 1970-01-01
      • 2017-10-31
      • 1970-01-01
      • 1970-01-01
      • 2021-05-05
      • 1970-01-01
      • 2021-05-21
      • 1970-01-01
      相关资源
      最近更新 更多