Hello everyone,
I'm using a custom page to obtain a hostname (usable via the installation wizard or via a response file).
For translation purposes, is it possible to use custom messages in a function in the [CODE] section?
The [CustomMessages] uses an #include external file.
This code compiles without any issue but generates an internal error at Runtime.
var
...
ServerHostPage : TInputQueryWizardPage;
Procedure InitializeWizard;
Var
InfFile: string;
...
Begin
ServerHostPage := CreateInputQueryPage(DataDirPage.ID ,
ExpandConstant('{cm:ServerHostPageTitle}'),
ExpandConstant('{cm:ServerHostSubTitle}'),
ExpandConstant('{cm:ServerHostDesc}');
ServerHostPage.add('{cm:ServerHostPageTitle}', False);
InfFile := ExpandConstant('{param:LOADINF}');
if InfFile<>'' then
ServerHostPage.Values[0] :=GetIniString('Custom', 'ServerHostName', '', ExpandFileName(InfFile));
End;
I miss something or is it just not possible?
Thank you in advance.
Inno Setup Compiler version 6.2.2
On Thursday, September 25, 2025, 10:42:17, Eric Gambert wrote:
I miss something or is it just not possible?
The error is telling you that ServerHostPageTitle custom message isn't defined anywhere.
Also, instead of using ExpandConstant('{cm:Foo}') you can use CustomMessage('Foo').
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/84833034.20250925110317%40eternallybored.org.
Got my mistake : no external files for CustomMessages to be used in [CODE], they have to be in the Script.