cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rguggisberg
Level 13

How Can I Insert a CRLF in a String?

How can I insert a CRLF in a string in a Suite or Basic MSI project?
Labels (1)
0 Kudos
(9) Replies
MarkusLatz
Level 8

I'm not sure, but you can try "\n" (new line) and "\r" (cariage return).
0 Kudos
skolte
Level 7

This is straight from InstallShield 2012 InstallScript Reference Guide.pdf page 11.


Inserting a Newline Character Into a String
A commonly used escape sequence is \n, which inserts a newline character into a string. The string “This is line one, This is line two.” is displayed or printed on a single line. However, the string “This is line one,\nThis is line two.” is displayed or printed as shown below:
This is line one,
This is line two.

.
.
.
\r Inserts a carriage return only. Does not insert a line feed.
0 Kudos
rguggisberg
Level 13

Guess I should have mentioned that I already tried \n and \r. Those may work fine in ISScript, but they do not work in the Strings table of a Suite or Basic MSI project.
0 Kudos
skolte
Level 7

You are right, there seems to be no way to set newline in string editor for basic MSI. From other posts, it seems like earlier \n or Ctrl+Enter used to work but that's not the case anymore. Interestingly none of the built-in dialogs use a newline. They simply use a new text control if needed. You can do that or the other option is to set the text programmatically in InstallScript (which would be a lot of work for what it's worth considering you are in Basic MSI).
0 Kudos
RobertDickau
Flexera Alumni

Actually, I think you can go to User Interface > String Editor, select the desired string, and click Edit Selected String (or press Ctrl+Enter). In the Value field of the string entry editor, type Ctrl+Enter wherever you want the CRLF.
0 Kudos
skolte
Level 7

Robert,

I saw your old thread on same topic and then tried that in a new sample Basic MSI project. I simply tried to edit an existing string on InstallWelcome dialog by going to layout, edit the text control, then the string in string table...
It didn't work for me.

I tried '\n', '\r\n', '\\r\\n', CRLF, Ctrl+Enter, equivalent UNICODE/ASCII code, with and without brackets, single quotes, double quotes etc.. nothing seemed to work.
0 Kudos
RobertDickau
Flexera Alumni

Hmm, it seems to work at this end. First image is the string editor, second is at run time...
0 Kudos
skolte
Level 7

aha..cool! It worked for me as well.

I was double clicking the text in Value column and trying to edit the text there directly. Didn't notice the 'Edit' button at the top in the grid view.

Thanks
0 Kudos
rguggisberg
Level 13

Robert,
As usual... you are correct. I guess you guys know all the details now. I ran into the same problem as skolte because I have always edited strings the way he did. Your instructions do work nicely... I might caution that is a bit less than ideal because sometimes when you go back and edit, there is no indication of the CRLF, even when you edit the string as you suggested. At least that is the case for a Suite project.
Thanks 🙂
0 Kudos