How to use variables \ macros with Inno Setup?

inno-setup

Solution

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.

Problem

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 ```

Original source