inno-setupinno-setup-v6

How to line break in StatusMsg in InnoSetup?


Filename: "{app}\program.exe"; Parameters: -d; \
  StatusMsg: "How to put line break after this sentence? This sentence should be on new line."; \
  Flags: runascurrentuser;

I tried + #13#10 + and %n but they didn't worked.


Solution

  • The status message line has one line only (so while you can insert a new line into the message, the second line won't show).

    The second line is reserved for a file name (when files are being installed).

    You can abuse the file name line like this:

    [Run]
    Filename: "{app}\program.exe"; Parameters: "-d"; \
      StatusMsg: "How to put line break after this sentence?"; Flags: runascurrentuser; \
      BeforeInstall: SetFileName('This sentence should be on new line.'); \
      AfterInstall: SetFileName('')
    
    [Code]
    
    procedure SetFileName(FileName: string);
    begin
      WizardForm.FilenameLabel.Caption := FileName;
    end;
    

    enter image description here


    Another (more complicated) option would be to temporarily make status line higher (multi-line).