Skip to content

Commit

Permalink
lib: ignore VS instances that cause COMExceptions
Browse files Browse the repository at this point in the history
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: #2018
Reviewed-By: João Reis <reis@janeasystems.com>
  • Loading branch information
amcasey authored and joaocgreis committed Jan 14, 2020
1 parent a79d866 commit 1f7e1e9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Find-VisualStudio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
}
}

Expand Down

0 comments on commit 1f7e1e9

Please sign in to comment.