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!

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

Bug in Multiline strings in custom actions

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: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Bug in Multiline strings in custom actions

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: 8
Joined: Mon Oct 25, 2021 4:40 pm

Re: Bug in Multiline strings in custom actions

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: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Bug in Multiline strings in custom actions

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
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Bug in Multiline strings in custom actions

Hello Lexy,

This has been fixed in version 19.5 of Advanced Installer, released on May 23rd, 2022.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Lexy
Posts: 8
Joined: Mon Oct 25, 2021 4:40 pm

Re: Bug in Multiline strings in custom actions

Great birthday present, thank you, Catalin!
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Bug in Multiline strings in custom actions

You are always welcome, Lexy!

And happy birthday! :)

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

Return to “Common Problems”