开发者

Inno Setup: Hide/Disable Component at runtime

I would like to disable or hide one of the component choices at run-time. I have created a custom wizard page with two radio buttons. If the first radio button is selected, I would like one of开发者_如何学Python the components (CustomInstall) to not appear, or at least be disabled.

Of course, the custom page appears prior to the Components page.

I have tried to do this with a Check: parameter, but it appears that the [Components] section is evaluated at startup, and not when the page is displayed.

So my next thought was to add some code to my CurPageChanged() so that I could remove or disable the item from the CheckListBox (which I think is called ComopnentsList), but I can't find any documentation on TNewCheckListBox.

Does anyone know more about this class? Will what I am thinking work?


Here's what I ended up doing:

if CurPageID=wpSelectComponents then
begin
  if ExtraOptionAvailable() then
  begin
    Wizardform.ComponentsList.Checked[6] := true;
    Wizardform.ComponentsList.ItemEnabled[6] := true;
  end else begin
    Wizardform.ComponentsList.Checked[6] := false;
    Wizardform.ComponentsList.ItemEnabled[6] := false;
  end;
end;

Searching the Inno Setup newsgroups at http://www.jrsoftware.org/newsgroups.php was very helpful.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜