Tuesday, September 23, 2014

WiX RTF issue

I have faced a problem with displaying rtf in WiX UI.
Rob Mansching has a post about the issue on his blog http://blogs.msdn.com/b/robmen/archive/2006/05/30/610950.aspx
Briefly WiX rich text control will not show us clickable hyperlink anyway but we would like to show it as something that reminds hyperlink. So we need to show ordinary underlined blue text.
But there is still question how to remove hyperlink from rtf and make text underlined blue.
So the steps to fix rtf:
1. Open EULA.rtf in WordPad and save it. It will remove some unsupported stuff from it but it will add hyperlinks.
2. Now we have to get rid of hyperlinks. I do that with ordinary text editor. First of all find the place with hyperlink.

3. Remove hyperlink tags.

Here i have to explain what "\cl1\ul WWW.ACME.COM\cl0\ulnone" means.
According to rtf specification \clN applies color to the text, where N is color number from colortable.
In the rtf document you will find the colortable:

So you can see that 1st color is "\red0\green0\blue255" - exactly what we need for hyperlink. If it's not there add it.
\ul applies underline to text and \ulnone finishes underline.
This how it looks like in installer:

No comments:

Post a Comment