inno-setup

Inno Setup: How to change LicenseFile text?


I have a single license.txt file. I use it for all of my applications.

[Setup]
LicenseFile=license.txt

I want my user to see a title "{#MyAppName} License Agreement" at the beginning of the license agreement text. But I don't want to change license.txt file content.

Is there any Inno Setup code way to achieve this? Thanks in advance.


Solution

  • For example, to change the fist line of license, you can do:

    [Code]
    
    procedure InitializeWizard();
    begin
      WizardForm.LicenseMemo.Lines[0] := '{#MyAppName} License Agreement';
      WizardForm.LicenseMemo.SelStart := 0;
    end;
    

    enter image description here


    Another way is to use Inno Setup preprocessor to generate a modified license file out of your template file.