Skip to content

Commit

Permalink
Update install script to check if containers feature is enabled on Io…
Browse files Browse the repository at this point in the history
…t Core Image (#1158)
  • Loading branch information
sachin-ac authored and arsing committed May 9, 2019
1 parent cae7379 commit 90f6368
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/windows/setup/IotEdgeSecurityDaemon.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Set-Variable EdgeInstallDirectory -Value "$env:ProgramFiles\iotedge" -Option Con
Set-Variable EdgeDataDirectory -Value "$env:ProgramData\iotedge" -Option Constant
Set-Variable EdgeServiceName -Value 'iotedge' -Option Constant

Set-Variable ContainersFeaturePackageName -Value 'Microsoft-IoT-Containers-Server-Package' -Option Constant
Set-Variable ContainersFeatureLangPackageName -Value 'Microsoft-IoT-Containers-Server-Package_*' -Option Constant

Set-Variable MobyDataRootDirectory -Value "$env:ProgramData\iotedge-moby" -Option Constant
Set-Variable MobyInstallDirectory -Value "$env:ProgramFiles\iotedge-moby" -Option Constant
Set-Variable MobyLinuxNamedPipeUrl -Value 'npipe://./pipe/docker_engine' -Option Constant
Expand Down Expand Up @@ -863,6 +866,13 @@ function Setup-Environment {
'See https://aka.ms/iotedge-platsup for more details.')
$preRequisitesMet = $false
}

if (Test-IoTCore) {
if (-not (Get-Service vmcompute -ErrorAction SilentlyContinue) -or (-not [bool] (Get-Package $ContainersFeaturePackageName)) -or (-not [bool] (Get-Package $ContainersFeatureLangPackageName))) {
Write-HostRed "The container host does not have 'Containers Feature' enabled. Please build an Iot Core image with 'Containers Feature' enabled."
$preRequisitesMet = $false
}
}

if ($preRequisitesMet) {
Write-HostGreen "The container host is on supported build version $currentWindowsBuild."
Expand Down

0 comments on commit 90f6368

Please sign in to comment.