0

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;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
MyICQ
  • 987
  • 1
  • 9
  • 25
  • It would be run-time / dynamic, based on a (hardware) condition in the computer to install to. Thank you for the hints. – MyICQ May 31 '23 at 14:18
  • @MartinPrikryl, thank you, I know the flags but it's not that simple. So it has be a function based on code. If I can't do what I imagine possible, I will use the `Check: somefunction` . – MyICQ May 31 '23 at 14:32
  • What's wrong with using `Check:`? – StayOnTarget May 31 '23 at 14:59

0 Answers0