【问题标题】:Add a new Setup Message ID to Inno Setup Messages - Language Files (.isl)将新的设置消息 ID 添加到 Inno 设置消息 - 语言文件 (.isl)
【发布时间】:2016-07-25 06:10:41
【问题描述】:

我想向 Inno Setup 添加一个名为 SetupMessageID[msgButtonNotify] 的新设置消息 ID。

而且我还需要使用 .isl 文件修改其文本,例如 msgButtonNotify=Notify

如何添加新的设置消息 ID 而不会收到任何异常消息?

如果可能,我应该在其源代码中的哪个位置添加它,包括MsgIDs.pas

如何更新 Struct.pas 中的 MessageHdrID 以添加新的设置消息 ID?

因为,Jordan Russel 在MsgIDs.pas 上发出了这个警告:{ Note: When any messages are added/deleted/changed, MessagesHdrID needs to be updated in Struct.pas }

我不明白我应该在Struct.pas 中更新什么。

Struct.pas 中可以看到与此警告相关的行是:

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

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

这些行中应该更新什么?

Jordan Russel 是什么意思 Update 那里???

我应该增加 AnsiChar 数组的值还是其他什么?

我问这个是因为当我将名为 msgButtonNotify 的新设置消息 ID 添加到 MsgIDs.pas 并将 TMessagesHdrID 的 AnsiChar 数组长度增加到 65 时, 在Default.isl 中添加我的新Setup Message ID,然后编译项目并尝试使用Inno Setup Compiler 进行测试编译,Setup Loader 显示Message name "ButtonNotify" in Default.isl is not recognized by this version of Inno Setup

为什么会出现这个异常?

在 Inno Setup Compiler 的源代码中添加新的 Setup Message ID 时,我还需要更新其他单元吗?

提前致谢。

【问题讨论】:

  • 你为什么要这样做?为什么不使用[CustomMessages]
  • 因为,自定义消息没有名为 {cm:ButtonNotify} 的消息。使用[CustomMessages] 是否可以添加新的自定义消息?
  • 并且 Jordan Russel 说可以在我显示的行中添加新的消息 ID。
  • 我还在 Inno Setup Wizard 中添加了一个名为 Notify: TNewButton 的按钮............这个新的 Message ID 应该添加到它的 Caption...... ...
  • 你是如何添加按钮的?您是否修改了 Inno Setup 源代码?还是您使用了 Pascal 脚本 - Code 部分?

标签: inno-setup pascalscript


【解决方案1】:

我没有看到重新编译 Inno Setup 以添加新消息的意义。


使用.isl.iss 中的CustomMessages section 添加新消息。

[CustomMessages]
ButtonNotify=&Notify

然后使用CustomMessage function(或{cm:...} constant)加载消息。

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

【讨论】:

  • Shit............即使知道要在脚本中添加大量代码,我什至不知道如何使用内置的[CustomMessages]函数...... .....我是什么样的男人...... :(
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-19
  • 1970-01-01
  • 1970-01-01
  • 2011-04-15
  • 2016-02-15
  • 2022-07-24
相关资源
最近更新 更多