Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 3a46b78

Browse files
committed
gh-35: Fail if WMI isn't ready, add basic service dependencies
1 parent ba9d9fe commit 3a46b78

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

context.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,13 @@ function extendPartitions()
537537
# Main
538538
################################################################################
539539

540+
# Check the working WMI
541+
if (-Not (Get-WMIObject -ErrorAction SilentlyContinue Win32_Volume)) {
542+
Write-Output "WMI not ready, exiting"
543+
Stop-Transcript | Out-Null
544+
exit 1
545+
}
546+
540547
Write-Output "Detecting contextualization data"
541548
Write-Output "- Looking for CONTEXT ISO"
542549

package.wxs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@
5656
Start="auto"
5757
Account="[SYSTEM]"
5858
Arguments="-s onecontext"
59-
ErrorControl="normal" />
59+
ErrorControl="normal">
60+
61+
<ServiceDependency Id="Winmgmt" />
62+
<ServiceDependency Id="PlugPlay" />
63+
<ServiceDependency Id="Tcpip" />
64+
<ServiceDependency Id="Dhcp" />
65+
<ServiceDependency Id="Dnscache" />
66+
</ServiceInstall>
6067

6168
<ServiceControl Id="ocControl" Name="onecontext"
6269
Remove="both"

0 commit comments

Comments
 (0)