Inno Setup 在注册表中的多字符串键中追加行
Inno Setup append rows in a multi-string key in registry
我需要在 Windows 注册表的 PreshutdownOrder
键的多字符串值中添加一些行。
如何将行附加到现有值?
向 [Registry]
section with ValueType
parameter set to multisz
. Use {olddata}
and {break}
tokens in the ValueData
parameter 添加条目:
On a string
, expandsz
, or multisz
type value, you may use a special constant called {olddata}
in this parameter. {olddata}
is replaced with the previous data of the registry value. The {olddata}
constant can be useful if you need to append a string to an existing value, for example, {olddata};{app}
. If the value does not exist or the existing value isn't a string type, the {olddata}
constant is silently removed. {olddata}
will also be silently removed if the value being created is a multisz
type but the existing value is not a multi-string type (i.e. it's REG_SZ or REG_EXPAND_SZ), and vice versa.
On a multisz
type value, you may use a special constant called {break}
in this parameter to embed line breaks (nulls).
[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control"; ValueType: multisz; \
ValueName: "PreshutdownOrder"; ValueData: "{olddata}{break}newline"
我需要在 Windows 注册表的 PreshutdownOrder
键的多字符串值中添加一些行。
如何将行附加到现有值?
向 [Registry]
section with ValueType
parameter set to multisz
. Use {olddata}
and {break}
tokens in the ValueData
parameter 添加条目:
On a
string
,expandsz
, ormultisz
type value, you may use a special constant called{olddata}
in this parameter.{olddata}
is replaced with the previous data of the registry value. The{olddata}
constant can be useful if you need to append a string to an existing value, for example,{olddata};{app}
. If the value does not exist or the existing value isn't a string type, the{olddata}
constant is silently removed.{olddata}
will also be silently removed if the value being created is amultisz
type but the existing value is not a multi-string type (i.e. it's REG_SZ or REG_EXPAND_SZ), and vice versa.On a
multisz
type value, you may use a special constant called{break}
in this parameter to embed line breaks (nulls).
[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control"; ValueType: multisz; \
ValueName: "PreshutdownOrder"; ValueData: "{olddata}{break}newline"