Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use variables \ macros with Inno Setup?

Tags:

inno-setup

I try to use the macros / variables in the following way, but then I get an error. Can you advice please?

#define AnnotateDir "C:\Users\new_skin\Annotate\project"
#define AnnotateUserInstallAppData "{userappdata}\Annotate3"


[Files]
Source: {AnnotateDir}\bin\gm_annotate.exe; DestDir: {app}; Flags:  ignoreversion  external

enter image description here

like image 571
Tamir Gefen Avatar asked Jan 18 '26 16:01

Tamir Gefen


1 Answers

You are missing # char before the variable name which is used to emit defined variable value during script preprocessing stage. You can fix your script this way:

#define AnnotateDir "C:\Users\new_skin\Annotate\project"  

[Files]
Source: {#AnnotateDir}\bin\gm_annotate.exe; DestDir: {app}; Flags: ignoreversion external

It looks quite misleading, but e.g. the {app} constant will remain after preprocessing whilst your defined variable will be replaced by its value, so that's why they have different notation in script.

like image 115
TLama Avatar answered Jan 21 '26 09:01

TLama