Lexy
Posts: 2
Joined: Mon Oct 25, 2021 4:40 pm

Bug in Multiline strings in custom actions

Mon Oct 25, 2021 4:46 pm

It looks like PowerShell functions AI_GetMsiProperty and AI_SetMsiProperty do not support multiline properties.
It is possible to create a multiline Edit field and it is possible to edit a multiline text there.

However, whenever I try to use a PowerShell custom action, say, to parse an XML from that multiline edit, AI_GetMsiProperty returns only the first line of the property, while the installer log shows that the property is full.

Code: Select all

$a = @'
a
b
'@

AI_SetMsiProperty A $a
A changed value to "a"
instead of
A changed value to "a
b"

Catalin
Posts: 4510
Joined: Wed Jun 13, 2018 7:49 am

Re: Bug in Multiline strings in custom actions

Wed Oct 27, 2021 11:57 am

Hello and welcome to our forums,

I have tested this and I was indeed able to reproduce the described behavior.

I have forwarded this to our development team and hopefully this will be fixed in a future version of Advanced Installer. Thank you for bringing this to our attention.

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

Lexy
Posts: 2
Joined: Mon Oct 25, 2021 4:40 pm

Re: Bug in Multiline strings in custom actions

Fri Oct 29, 2021 7:13 pm

Thank you, Catalin.

At the moment, I have worked around this issue by using a VBS script instead of a PowerShell one.

Code: Select all

Session.Property
reads multiline strings and I can replace \r\n characters with something else, then process this data using PowerShell.

Catalin
Posts: 4510
Joined: Wed Jun 13, 2018 7:49 am

Re: Bug in Multiline strings in custom actions

Mon Nov 01, 2021 9:46 am

You are always welcome, Lexy!

And thank you for your followup on this and for sharing your solution with us!

I am sure this will be of help for other users facing a similar scenario.

I will update this thread once this will be fixed.

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

Return to “Common Problems”