VersionCLR
The installer sets this variable to the Common Language Runtime (i.e., .Net) version number of the target system if the target system has .Net 4.x or earlier installed. Otherwise it is set to 0. (For .Net 6.x and later, use separate, per-version variables to determine the installed version.)
The CLR version number is encoded as 1000 * major + 10 * minor + sp, as follows:
.Net version | VersionCLR |
---|---|
Not present | 0 |
1.0 | 1000 |
1.1 | 1010 |
2.0 | 2000 |
2.0 SP1 | 2001 |
2.0 SP2 | 2002 |
3.0 | 3000 |
3.1 | 3010 |
3.5 | 3050 |
3.5 SP1 | 3051 |
4.0 | 4000 |
4.5 | 4050 |
4.5.1 | 4051 |
4.5.2 | 4052 |
4.6 | 4060 |
4.6.1 | 4061 |
4.6.2 | 4062 |
4.7 | 4070 |
4.7.1 | 4071 |
4.7.2 | 4072 |
4.8.0 | 4080 |
4.8.1 | 4081 |
.Net 5.x and later | use separate variables |
Usage
You can refer to it as <VersionCLR>. In conditional expressions you can omit the brackets and use tests like VersionCLR >= 1010 (to test for .Net 1.1 or later) or simply VersionCLR (to test for the presence of .Net). Do not set this variable directly; it is set automatically when the installer runs.
Tips:
- If you need a more accurate .Net version indicator, use the MsiNetAssemblySupport variable. That variable provides the fully dotted .Net runtime version number, for example 4.6.1055.0
- For .Net versions from 6.x onwards, separate variables for each version are provided. See .Net version variables for details.
Related topics
MsiNetAssemblySupport, System information variables, .Net version variables