Skip to content

Commit

Permalink
add a message popup when project creation fails due to sdk not found (#…
Browse files Browse the repository at this point in the history
…22)

* add a message popup when project creation fails due to sdk not found

* use sdk version as string when sdk is pre-win10
  • Loading branch information
spebl authored Aug 15, 2017
1 parent 67bda0e commit 0237d0c
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions GoogleTestAdapter/NewProjectWizard/WizardImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,32 @@ public void RunStarted(object automationObject,

if (latestSdk == null)
{
MessageBox.Show(Resources.WinSDKNotFound);
throw new WizardCancelledException(Resources.WinSDKNotFound);
}

List<Platform> allPlatformsForLatestSdk = ToolLocationHelper.GetPlatformsForSDK("Windows", latestSdk.TargetPlatformVersion)
.Select(moniker => TryParsePlatformVersion(moniker))
.Where(name => name != null)
.OrderByDescending(p => p.Version).ToList();
Platform latestPlatform = allPlatformsForLatestSdk.FirstOrDefault();
string versionString;

if (latestPlatform == null)
if (latestSdk.TargetPlatformVersion.Revision >= 10)
{
throw new WizardCancelledException(Resources.WinSDKNotFound);
}
List<Platform> allPlatformsForLatestSdk = ToolLocationHelper.GetPlatformsForSDK("Windows", latestSdk.TargetPlatformVersion)
.Select(moniker => TryParsePlatformVersion(moniker))
.Where(name => name != null)
.OrderByDescending(p => p.Version).ToList();
Platform latestPlatform = allPlatformsForLatestSdk.FirstOrDefault();

if (latestPlatform == null)
{
MessageBox.Show(Resources.WinSDKNotFound);
throw new WizardCancelledException(Resources.WinSDKNotFound);
}

string versionString = latestPlatform.Version.ToString();
versionString = latestPlatform.Version.ToString();
}
else
{
versionString = latestSdk.TargetPlatformVersion.ToString();
}

replacementsDictionary[TargetPlatformVersion] = versionString;
}
Expand Down

0 comments on commit 0237d0c

Please sign in to comment.