Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit 143406e

Browse files
committed
[packages,WindowsSDK,*] Added error checking for whether the registry keys for the WindowsSDK exist
1 parent cbdd52a commit 143406e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/WindowsSDK-10/bam/Scripts/MetaData.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public MetaData()
4949
}
5050

5151
var installPath10 = key.GetValue("KitsRoot10") as string;
52+
if (null == installPath10)
53+
{
54+
throw new Bam.Core.Exception("Unable to locate the registry value {0}\\KitsRoot10. Is the WindowsSDK 10 installed?", key.Name);
55+
}
5256
Bam.Core.Log.DebugMessage("Windows 10 SDK installation folder is {0}", installPath10);
5357
this.InstallDirSDK10 = Bam.Core.TokenizedString.CreateVerbatim(installPath10);
5458

@@ -57,6 +61,10 @@ public MetaData()
5761
this.SpecificVersion10 = Bam.Core.TokenizedString.CreateVerbatim("10.0.10240.0");
5862

5963
var installPath81 = key.GetValue("KitsRoot81") as string;
64+
if (null == installPath81)
65+
{
66+
throw new Bam.Core.Exception("Unable to locate the registry value {0}\\KitsRoot81. Is the WindowsSDK 8.1 installed?", key.Name);
67+
}
6068
Bam.Core.Log.DebugMessage("Windows 8.1 SDK installation folder is {0}", installPath81);
6169
this.InstallDirSDK81 = Bam.Core.TokenizedString.CreateVerbatim(installPath81);
6270
return;

packages/WindowsSDK-8.1/bam/Scripts/MetaData.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ public MetaData()
5050
}
5151

5252
installPath = key.GetValue("KitsRoot81") as string;
53+
if (null == installPath)
54+
{
55+
throw new Bam.Core.Exception("Unable to locate the registry value {0}\\KitsRoot81. Is the WindowsSDK 8.1 installed?", key.Name);
56+
}
5357
Bam.Core.Log.DebugMessage("Windows 8.1 SDK installation folder is {0}", installPath);
5458
}
5559

0 commit comments

Comments
 (0)