0
votes

I want to add a new Setup Message ID named SetupMessageID[msgButtonNotify] to Inno Setup.

And I also need its text to be modifiable using .isl Files like msgButtonNotify=Notify.

How can I add a new Setup Message ID without getting any Exception Message?

If it is possible, where should I add it in its Source Code including MsgIDs.pas?

How can I update MessageHdrID in Struct.pas to add a new Setup Message ID?

Because, Jordan Russel gives this warning on MsgIDs.pas: { Note: When any messages are added/deleted/changed, MessagesHdrID needs to be updated in Struct.pas }

I can't understand what should I update in Struct.pas.

The lines whose related to this warning can bee seen in Struct.pas are:

TMessagesHdrID = array[0..63] of AnsiChar; and

MessagesHdrID: TMessagesHdrID = 'Inno Setup Messages (5.5.3)'{$IFDEF UNICODE}+' (u)'{$ENDIF};

What should be updated in those lines?

What Jordan Russel means Update there???

Should I increase the value of the AnsiChar Array or anything else?

I ask this because when I adding new Setup Message ID called msgButtonNotify to MsgIDs.pas and increasing TMessagesHdrID's AnsiChar Array Length to 65, adding my new Setup Message ID in Default.isl, then compiling project and try a testing Compile with Inno Setup Compiler, Setup Loader says Message name "ButtonNotify" in Default.isl is not recognized by this version of Inno Setup.

Why this Exception is occurring?

Are there any other Unit I have to update when adding a new Setup Message ID in Inno Setup Compiler's Source Code?

Thanks in Advance.

1
Why are you doing this? Why don't you use [CustomMessages]?Martin Prikryl
Because, Custom Messages haven't a Message called {cm:ButtonNotify}. Using [CustomMessages] is it possible to add a new Custom Message?Blueeyes789
And Jordan Russel says adding new Message IDs is possible in the line I shown.Blueeyes789
And also I added a button in Inno Setup Wizard called Notify: TNewButton.........This new Message ID should be added for its Caption............Blueeyes789
How did you add the button? Did you modify Inno Setup source code? Or did you use the Pascal script - Code section?Martin Prikryl

1 Answers

1
votes

I do not see a point of recompiling Inno Setup to add a new message.


Use the CustomMessages section in the .isl or the .iss to add new messages.

[CustomMessages]
ButtonNotify=&Notify

And then use the CustomMessage function (or the {cm:...} constant) to load the message.

procedure InitializeWizard();
var
  NotifyButton: TNewButton;
begin
  NotifyButton := TNewButton.Create(WizardForm);
  NotifyButton.Parent := WizardForm;
  NotifyButton.Caption := CustomMessage('ButtonNotify');
  ...
end;