問題描述
如何從 InitializeWizard 中更改嚮導頁面的名稱和描述? (How do I change the name and description of a wizard page from within InitializeWizard?)
I am moving code from CurPageChanged
to InitializeWizard
. In CurPageChanged
I could do this if Inno has changed to the page I wanted modify the name and descripton for:
WizardForm.PageNameLabel.Caption := 'A message about your license';
WizardForm.PageDescriptionLabel.Caption := 'The message here';
But I can't do something similar from InitializeWizard
without specifying the page I want to change the caption for. I have looked at the Inno Setup source but I can't figure out what I need to access. How can I change the name and description of a wizard page?
I would have thought something like WizardForm.LicensePage.PageNameLabel.Caption
but that doesn't work. Maybe I'm going about this all wrong. Is there an easier way? I might need to add translations for the name and description as well.
‑‑‑‑‑
參考解法
方法 1:
Include a Messages
section in your script:
[Messages]
WizardLicense = A message about your license
LicenseLabel = The message here
The way it is supposed to work to support multiple languages is like this:
[Languages]
Name: en; MessagesFile: "compiler:Default.isl"
Name: de; MessagesFile: "compiler:Languages\German.isl"
[Messages]
en.WizardLicense = A message about your license
en.LicenseLabel = The message here
de.WizardLicense = (German translation)
de.LicenseLabel = (Another translation..)
You can of course modify a copy of the corresponding .isl file and use that instead.
(by loop、Sertac Akyuz)