将Inno Setup DefaultDirName留空或显示消息“选择安装目录”

时间:2017-11-26 11:51:30

标签: inno-setup

我为3ds Max制作了一个插件,我需要两件事:

  • 路径字段中的消息“选择3ds Max root”代替“c:...或d:...”。
  • 如果用户没有使用浏览按钮手动选择路径,我还需要点击 Next 按钮。

非常感谢。

2 个答案:

答案 0 :(得分:0)

  • 清除InitializeWizard event function中的DirEdit。您可能希望仅在首次安装时清除它,而不是在重新安装/升级时清除它。 Inno Setup本身不允许用户继续,除非用户选择路径。
  • 您可以更改"选择目的地位置"在[Messages] section。更改WizardSelectDirSelectDirDescSelectDirLabel3SelectDirBrowseLabel等条目。
[Messages]
WizardSelectDir=Choose install directory

[Code]

procedure InitializeWizard();
begin
  if not IsUpgrade then
  begin
    WizardForm.DirEdit.Text := '';
  end;
end;

对于IsUpgrade功能,请参阅示例Inno Setup: How to overwrite on install but not on change?

enter image description here

或者您可以创建一个全新的自定义页面:
How to ask the user to specify a folder name (using Inno Setup)?

(隐藏标准的?)

答案 1 :(得分:0)

Autodesk 3ds Max将其安装目录存储在Windows注册表中。您可以将Inno Setup安装程序设置为检查该注册表项并将其用作默认值。

以下是3ds Max SDK程序员指南的链接:3ds Max Install Directory Registry Key

相关问题