in JetBrains.Etw.HostService.Updater/src/Util/VersionControl.cs [14:38]
public static Version GetInstalledVersion([NotNull] ILogger logger)
{
if (logger == null) throw new ArgumentNullException(nameof(logger));
var upgradeCode = MajorVersion switch
{
16 => "{25CB994F-CDCF-421B-9156-76528AAFC0E1}",
_ => throw new ArgumentOutOfRangeException(nameof(MajorVersion), $"Unknown major version {MajorVersion}")
};
IEnumerable<ProductInstallation> productInstallations;
try
{
productInstallations = ProductInstallation.GetRelatedProducts(upgradeCode);
}
catch (ArgumentException)
{
productInstallations = Enumerable.Empty<ProductInstallation>();
}
var foundVersions = productInstallations.Select(x => x.ProductVersion).OrderByDescending(x => x).ToList();
logger.Info($"{Logger.Context} upgradeCode={upgradeCode} versions={string.Join(",", foundVersions.Select(x => x.ToString()))}");
return foundVersions.Select(CheckVersion).SingleOrDefault();
}