Skip to content

Commit

Permalink
Ensure that FindWithVsWhere continues to return the newest version fo…
Browse files Browse the repository at this point in the history
…und. FindAllWithVsWhere will return the list sorted from newest to oldest
  • Loading branch information
Javagedes committed Jan 11, 2024
1 parent 9e9aee4 commit 010b3e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions edk2toollib/windows/locate_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def GetVsWherePath(fail_on_not_found: bool = True):


def FindWithVsWhere(products: str = "*", vs_version: str = None):
"""Finds a product with VS Where. Returns the first match.
"""Finds a product with VS Where. Returns the newest match.
Args:
products (:obj:`str`, optional): product defined by vswhere tool
Expand All @@ -147,7 +147,7 @@ def FindWithVsWhere(products: str = "*", vs_version: str = None):
return results[0] if results else None

def FindAllWithVsWhere(products: str = "*", vs_version: str = None):
"""Finds a product with VS Where. Returns all matches.
"""Finds a product with VS Where. Returns all matches, sorted by newest version.
Args:
products (:obj:`str`, optional): product defined by vswhere tool
Expand All @@ -161,7 +161,7 @@ def FindAllWithVsWhere(products: str = "*", vs_version: str = None):
(ValueError): Unsupported VS version
(RuntimeError): Error when running vswhere
"""
cmd = "-nologo -all -property installationPath"
cmd = "-nologo -all -sort -property installationPath"
vs_where_path = GetVsWherePath() # Will raise the Environment Error if not on windows.
if vs_where_path is None:
raise EnvironmentError("Unable to locate the VsWhere Executable.")
Expand Down

0 comments on commit 010b3e1

Please sign in to comment.