Implement the install1 and porta1 , such as:
function HasCommandLineSwitch(Name: string): Boolean; var I: Integer; begin Result := False; for I := 1 to ParamCount do begin if CompareText(ParamStr(I), '/' + Name) = 0 then begin Result := True; Break; end; end; end; function install1: Boolean; begin Result := HasCommandLineSwitch('install1'); end; function porta1: Boolean; begin Result := HasCommandLineSwitch('porta1'); end;
In fact, you can use HasCommandLineSwitch directly in the Check parameter:
[Files] Source: "Portable-File.exe"; DestDir: "{app}"; Check: HasCommandLineSwitch('install1') Source: "Installer-File.exe"; DestDir: "{app}"; Check: HasCommandLineSwitch('porta1')
Although I assume that your install1 and porta1 function will actually do more than just call HasCommandLineSwitch , so this is probably not applicable to you.
In fact, since I know that you have flags corresponding to install1 and porta1 , what you really want to do is check these flags when the installer starts, if the specified parameters are specified. Thus, you can use /install1 and /porta1 to set the default values, even if they are not used in conjunction with /verysilent . And it will still work even in /verysilent more, even if the user never sees the checkboxes (they are still present, although they are not displayed)
install1 := TNewRadioButton.Create(WizardForm); install1.Checked := HasCommandLineSwitch('install1'); porta1 := TNewRadioButton.Create(WizardForm); porta1.Checked := HasCommandLineSwitch('porta1');
And you save the install1 and porta1 function to return the state of the checkboxes, as shown in the Inno Setup Set Uninstallable directive based on a custom checkbox. .
source share