Can one use environment variables in Inno Setup scripts?

dicroce picture dicroce · Jan 4, 2010 · Viewed 16.9k times · Source

I need to find a way to reference environment variables INSIDE the Inno Setup script file (.iss)...

I've found plenty of references to MODIFYING the environment from an .iss, but none on how to actually use it. Is this possible?

Answer

goran picture goran · Aug 6, 2013

I ran into the same problem when trying to specify the source location of files in the [Files] section. I used the GetEnv function to define a new constant.

#define Qt5 GetEnv('QT5')
[Files]
Source: {#Qt5}\bin\Qt5Concurrent.dll; DestDir: {app};