Using the InnoSetup preprocessor, you can automatically give the setup file the same version as the program file you're packaging with InnoSetup. Predefined functions are
;
; Inno Setup Preprocessor macro to simplify the version string.
;
; The following situations are covered:
;
; (1) 1.2.4.3 -> 1.2.4
; (2) 1.2.4.0 -> 1.2.4
; (3) 1.2.0.0 -> 1.2
; (4) 1.0.0.0 -> 1.0
; (5) 1.0.0.2 -> 1.0
; (6) 1.3.0.1 -> 1.3
;
#define SimpleVersion(str S) \
Local[0] = Pos (".0.0.", S), \
/* (4) and (5) */ \
(Local[0] > 0) ? Copy (S, 1, 3) : \
( \
Local[0] = Pos (".0.0", S), \
/* (3) */ \
(Local[0] > 0) ? Copy (S, 1, 3) : \
( \
Local[0] = Pos (".0", S), \
/* (2) */ \
(Local[0] > 5) ? Copy (S, 1, Local[0] - 1) : \
( \
Local[0] = Pos (".0.", S), \
/* (6) */ \
(Local[0] > 0) ? Copy (S, 1, 3) : \
( \
Copy (S, 1, 5) \
) \
) \
) \
);