We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

rahmadi89
Posts: 1
Joined: Sat Jan 25, 2020 6:21 am

Make a single line value with type REG_MULTI_SZ

Hello

how I can to build a single line REG_MULTI_SZ value in registry and replace the data ?
for example Something like this:

Key: HKEY_CURRENT_USER\testkey
Value Name: testvalue
ValueType: REG_MULTI_SZ
ValueData: text


when I add this value in REGISTRY section at AI16.5, because the value is single line, AI will automatically set this value type to "REG_SZ"

with some searching in your forums I found that maybe using "[~]" solve my problem but no. When I add "[~]" at the end of data, the Prepend or Append option will selected depending on location of entering "[~]". But I want the data be Replaced not prepend or append.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Make a single line value with type REG_MULTI_SZ

Hello and welcome to Advanced Installer forums,

Unfortunately, this is a Windows Installer limitation.

If a [~] follows the end of the string list (as you did), the strings are to be prepended to any existing registry value strings. If a prepending string already occurs in the registry value, the original occurrence of the string is removed.

For more information about this, please have a look over the "Registry Table" Microsoft article.

After some further testing, I think I may have found a workaround for this. In the "Data" field, please insert your value as it follows:

Code: Select all

testValue[~] 
after the [~] character, simply insert a space character (if you try to copy the above expression you can notice the extra space).

This way, the registry type will be set to "REG_MULTI_SZ" and the "Replace existing value" option will be chose.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”