How to show multiple licenses in the installer

I use Inno Setup to create an installer for my program. In my program, I use third-party libraries, so I have to show license information for each of them. I also want the installer to show specific license files for the selected language. I know how to switch between license files if I have 1 license form.

I looked at Google all day but found nothing

How can I show multiple licenses?

+6
source share
2 answers

You can use CreateOutputMsgMemoPage to create a page with the box turned on. You can then adjust the size and add the consent / disagree fields.

; Shows a new license page for the LGPL with the usual accept/don't acccept options [Code] var LGPLPage: TOutputMsgMemoWizardPage; LGPLAccept: TNewRadioButton; LGPLRefuse: TNewRadioButton; procedure LGPLPageActivate(Sender: TWizardPage); forward; procedure LGPLAcceptClick(Sender: TObject); forward; procedure LGPL_InitializeWizard(); var LGPLText: AnsiString; begin // Create the page LGPLPage := CreateOutputMsgMemoPage(wpLicense, SetupMessage(msgWizardLicense), SetupMessage(msgLicenseLabel), CustomMessage('LGPLHeader'), ''); // Adjust the memo and add the confirm/refuse options LGPLPage.RichEditViewer.Height := ScaleY(148); LGPLAccept := TNewRadioButton.Create(LGPLPage); LGPLAccept.Left := LGPLPage.RichEditViewer.Left; LGPLAccept.Top := LGPLPage.Surface.ClientHeight - ScaleY(41); LGPLAccept.Width := LGPLPage.RichEditViewer.Width; LGPLAccept.Parent := LGPLPage.Surface; LGPLAccept.Caption := SetupMessage(msgLicenseAccepted); LGPLRefuse := TNewRadioButton.Create(LGPLPage); LGPLRefuse.Left := LGPLPage.RichEditViewer.Left; LGPLRefuse.Top := LGPLPage.Surface.ClientHeight - ScaleY(21); LGPLRefuse.Width := LGPLPage.RichEditViewer.Width; LGPLRefuse.Parent := LGPLPage.Surface; LGPLRefuse.Caption := SetupMessage(msgLicenseNotAccepted); // Set the states and event handlers LGPLPage.OnActivate := @LGPLPageActivate; LGPLAccept.OnClick := @LGPLAcceptClick; LGPLRefuse.OnClick := @LGPLAcceptClick; LGPLRefuse.Checked := true; // Load the LGPL text into the new page ExtractTemporaryFile('lgpl-3.0.txt'); LoadStringFromFile(ExpandConstant('{tmp}/lgpl-3.0.txt'), LGPLText); LGPLPage.RichEditViewer.RTFText := LGPLText; end; procedure LGPLPageActivate(Sender: TWizardPage); begin WizardForm.NextButton.Enabled := LGPLAccept.Checked; end; procedure LGPLAcceptClick(Sender: TObject); begin WizardForm.NextButton.Enabled := LGPLAccept.Checked; end; [Files] Source: {#Common}Setups\lgpl-3.0.txt; DestDir: {app}; Flags: ignoreversion [CustomMessages] LGPLHeader=Please read the following License Agreement. Some components are licensed under the GNU Lesser General Public License. 
+5
source

You can make each license file correspond to a language file by removing the LicenseFile directive from [Setup] and placing it in [Languages] as follows:

 Name: "english"; MessagesFile: "compiler:Default.isl"; LicenseFile: "English License.rtf" Name: "chinesesimp"; MessagesFile: "compiler:Languages\ChineseSimp.isl"; LicenseFile: "Chinese SIM License.rtf" Name: "chinesetrad"; MessagesFile: "compiler:Languages\ChineseTrad.isl"; LicenseFile: "Chinese TRA License.rtf" etc... 

Hope that helps

+7
source

Source: https://habr.com/ru/post/894260/


All Articles