You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于WiX中MultiString类型RegistryValue的write动作及与String类型差异的问询

Understanding the write Action for WiX RegistryValue (MultiString Type)

Let me break this down clearly for you:

What does the write action do for MultiString?

When you set Action="write" (the default behavior, so you don’t even need to specify it explicitly) on a RegistryValue of type MultiString, it completely replaces the existing multi-string value in the registry with the set of strings you define in your WiX markup.

It does NOT append or prepend using semicolons—those are exactly what the append and prepend actions are designed for. Remember: a multi-string registry value is stored as an array of separate strings (not a single string with semicolon separators, even though some registry viewers might display it that way). The write action wipes out the entire existing array and replaces it with your new collection of entries.

For example, if the registry already has a MultiString value with entries:

  • "Old Entry 1"
  • "Old Entry 2"

And your WiX markup looks like this:

<RegistryValue Root="HKLM" Key="Software\MyApp" Name="MyMultiList" Type="MultiString" Value="New Entry A;New Entry B" Action="write" />

After installation, the registry value will only contain:

  • "New Entry A"
  • "New Entry B"
    The original entries are removed entirely.

How is this different from a String type RegistryValue with write?

The core difference lies in the underlying data structure being manipulated:

  • For a String type: The registry stores a single, continuous text string. The write action replaces that one string with your new value. If you pass a value with semicolons, it’s just stored as part of that single string (the registry doesn’t recognize semicolons as separators here).
  • For a MultiString type: The registry stores an array of distinct, individual strings. The write action replaces the entire array with your new set of strings (split automatically by semicolons in the WiX Value attribute—each semicolon-separated segment becomes a separate entry in the registry’s multi-string array).

So while both use write to replace existing data, one targets a single string and the other targets an array of strings—that’s the critical distinction.


内容的提问来源于stack exchange,提问作者user3664223

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 04:21:59