2using System.Collections.Generic;
13 private static readonly IReadOnlyList<CplexInstallationDefinition>
19 "CPLEX_STUDIO_DIR222",
20 "CPLEX_STUDIO_DIR2220"
28 [
"CPLEX_STUDIO_DIR2212"],
29 [
"CPLEX_Studio2212"]),
32 [
"CPLEX_STUDIO_DIR2211"],
33 [
"CPLEX_Studio2211"]),
36 [
"CPLEX_STUDIO_DIR221"],
40 [
"CPLEX_STUDIO_DIR201"],
48 public static IReadOnlyList<CplexInstallationDefinition>
70 Environment.GetEnvironmentVariable(
84 if (!
string.IsNullOrWhiteSpace(root))
87 $
"Environment variable '{variableName}' points " +
88 $
"to '{root}', but the required CPLEX .NET " +
89 "assemblies were not found there.");
93 if (!OperatingSystem.IsWindows())
99 Environment.GetFolderPath(
100 Environment.SpecialFolder.ProgramFiles);
114 "default Windows installation",
125 "No compatible CPLEX installation was found. " +
126 "Supported automatic discovery currently covers " +
127 "22.2.x, 22.1.2, 22.1.1, 22.1 and 20.1.");
134 private static bool TryResolve(
136 string? rootDirectory,
143 if (
string.IsNullOrWhiteSpace(rootDirectory))
149 Environment.ExpandEnvironmentVariables(
150 rootDirectory.Trim());
152 string managedDirectory =
159 string concertAssembly =
164 string cplexAssembly =
169 if (!File.Exists(concertAssembly) ||
170 !File.Exists(cplexAssembly))
176 new CplexInstallationInfo(
Describes one supported CPLEX installation family.
IReadOnlyList< string > WindowsFolderNames
Gets common Windows installation folder names.
IReadOnlyList< string > EnvironmentVariables
Gets accepted environment-variable names.
string Version
Gets the display version.
Represents the result of compatible CPLEX installation discovery.
Represents one compatible CPLEX installation discovered on the current machine.
Describes and discovers supported IBM ILOG CPLEX installations.
static IReadOnlyList< CplexInstallationDefinition > SupportedInstallations
Gets the supported installation definitions, ordered from newest to oldest.
static CplexInstallationDiscoveryResult Discover()
Finds the newest compatible CPLEX installation visible to the current process.