Conditional DisableProgramGroupPage in Inno Setup

I am trying to create a single installer for both normal and portable installations. For a portable installation, I will disable all icons and create an uninstaller.

The only problem I am stuck with is how to disable the program group page when starting a portable installation. I do not understand something?

[Setup]
;This works as expected
Uninstallable=not IsPortable()
;This does NOT work, can't compile (DisableProgramGroupPage=yes alone compiles fine)
DisableProgramGroupPage=yes IsPortable()

      

Compilation failed with error

The value of the [Setup] section directive ... is invalid.

This is the function IsPortable()

:

function IsPortable(): Boolean;
begin
  if(StandardRadioButton.Checked = True) then
  Result := False
  else
  Result := True;
end;

      

+3


source to share


1 answer


(Development of @TLama comment)

DisableProgramGroupPage

does not support "boolean expression":

[Setting]: DisableProgramGroupPage
Valid values auto

, yes

orno

Unlike Uninstallable

:



[Installation]: Uninstallable
Valid values: yes

or no

, or Boolean expression


Instead of ShouldSkipPage

the event function,
you can use

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  Result := False;

  if PageID = wpSelectProgramGroup then
  begin
    Result := IsPortable;
  end;
end;

      

+3


source







All Articles