My component section:
[Components]
Name: "client"; Description: "Client"; Types: full default monitor;
Name: "server"; Description: "Server"; Types: full default server;
Name: "server/feature"; Description: "Optional feature";
Name: "server/Db"; Description: "Always supported server feature"; Types: full default server; Flags: fixed
Name: "server/Db/latest"; Description: "Latest"; Types: full default server; Flags: exclusive
Name: "server/Db/2_10"; Description: "2.10"; Flags: exclusive
I would like to have component server/Db that is always selected when its parent server is selected. I was able to acomplish it with fixed flag, but then I'm not able to select server/Db/2_10. If I tried to select second exclusive component, server/Db is unsellected altogether. I can only select server/Db/2_10 if server/Db isn't flaged as fixed, but then I'm able to unselect it.
Edit:
I added procedures like in Inno Setup: how to auto select a component if another component is selected?. Just changed ComponentsListCheckChanges procedure like this, (because I don't want to allow user to uncheck it):
procedure ComponentsListCheckChanges;
begin
// No metter what you chceck/uncheck force component if needed.
if WizardIsComponentSelected('server') then
begin
WizardSelectComponents('server/Db');
end
else
begin
WizardSelectComponents('!server/Db');
end
end;
I just found out, that If I try to uncheck server/Db, its checked back, that's good, but Type change to Custom even if it match other predefined type. Did I made some mistakes?
Old:
I also tried to mark it as Disabled in code. I was able to select both exclusive components, but not able to Uncheck component server anymore.
[code]
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpSelectComponents then
WizardForm.ComponentsList.ItemEnabled[3] := False;
end;
I'm able to create same behavior in component section as with code above by adding custom to Types list. I'm able to select both exclusive components, but can't uncheck server
[Components]
Name: "client"; Description: "Client"; Types: full default monitor;
Name: "server"; Description: "Server"; Types: full default server;
Name: "server/feature"; Description: "Optional feature";
Name: "server/Db"; Description: "Always supported server feature"; Types: full default server custom; Flags: fixed
Name: "server/Db/latest"; Description: "Latest"; Types: full default server; Flags: exclusive
Name: "server/Db/2_10"; Description: "2.10"; Types: custom; Flags: exclusive
Last thing that I tried was setting it to True in code if server is checked. I Tried using code from: https://stackoverflow.com/a/36989894/2416941 , it forced server/Db to behave like I wanted but, in dropdown menu above components, Selected Type stopped changing, It always showed as Default instalation and not Custom or any other type, so I don't think that's a valid solution.
How can I force server/Db to be always checked with server and able to choose one of server/Db's children, and still possible to uncheck server?
Or is there other way to group exclusive components?