From 278dcddbddee25761d7a010b3b5e9f10e21af707 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 8 Jan 2020 13:49:39 -0800 Subject: [PATCH] lib: ignore VS instances that cause COMExceptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I have quite a few instances of VS installed and it looks like Find-VisualStudio.cs enumerates all of them, even when find-visualstudio.js already knows which one it wants (from the environment variable in the developer command prompt). One of them (from 15.7.2, if that's interesting) causes a COMException on the ISetupInstance2.GetPackages call. Ignoring such packages seems harmless and unblocks the rest of the run. PR-URL: https://github.com/nodejs/node-gyp/pull/2018 Reviewed-By: João Reis --- lib/Find-VisualStudio.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Find-VisualStudio.cs b/lib/Find-VisualStudio.cs index 0a533f42d6..d2e45a7627 100644 --- a/lib/Find-VisualStudio.cs +++ b/lib/Find-VisualStudio.cs @@ -205,7 +205,14 @@ public static void PrintJson() return; } - instances.Add(InstanceJson(rgelt[0])); + try + { + instances.Add(InstanceJson(rgelt[0])); + } + catch (COMException) + { + // Ignore instances that can't be queried. + } } }