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?
The easiest way to set environment variables in Bash is to use the “export” keyword followed by the variable name, an equal sign and the value to be assigned to the environment variable.
No. This is not possible. One process can never directly manipulate the environment of a different already-running process.
env files are a great solution. It's a file inside your project in which you specify these environment variables and afterwards you use a library for your respective programming language to load the file which will dynamically define these variables.
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};
According to this page in the Inno Setup documentation, the value of environment variables can be retrieved using the following syntax:
{%name|default}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With