I have a setup using Inno Setup where I would like to have an entire section installed only if a certain condition is met. The condition is calculated in [Code]
section using a Pascal script.
It would be run-time / dynamic, based on a (hardware) condition in the computer to install to.
What I am after is something like this: (pseudo code, used to illustrate my ideas). For my setup it's indifferent what type the defined variable has, as long as it can be variable.
; ---
; --- initial section
;
#define testvarvalue {mytestfunction()}
[files]
; ---
; --- only do this section if certain condition is met
#if testvarvalue == "A"
; -- do something here
#endif
; ---
; --- functions
[code]
function mytestfunction: string;
begin
result:= 'A';
end;