From eaadead5d52d4dea246cbd3c2a7c7f32f66027e1 Mon Sep 17 00:00:00 2001 From: Sunjay Bhatia Date: Fri, 25 Sep 2020 12:35:47 -0400 Subject: [PATCH 1/2] Windows build container: Disable unneeded services Signed-off-by: Sunjay Bhatia --- build_container/build_container_windows.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build_container/build_container_windows.ps1 b/build_container/build_container_windows.ps1 index 6260e143..18285803 100644 --- a/build_container/build_container_windows.ps1 +++ b/build_container/build_container_windows.ps1 @@ -45,6 +45,23 @@ function RunAndCheckError echo "done." } +function DisableService +{ + param([string] $serviceName) + + echo "Disabling service '$serviceName'" + Set-Service -Name $serviceName -StartupType Disabled + Stop-Service -Force -Name $serviceName +} + +DisableService DiagTrack +DisableService LanmanWorkstation +DisableService MSDTC +DisableService SysMain +DisableService usosvc +DisableService WinHttpAutoProxySvc +DisableService WinRM + # Ensures paths rooted at /c/ can be found by programs running via msys2 shell RunAndCheckError "cmd.exe" @("/s", "/c", "mklink /D C:\c C:\") From 3f154f3f4a7185c860c697cd6d99ec8253544354 Mon Sep 17 00:00:00 2001 From: Sunjay Bhatia Date: Fri, 25 Sep 2020 12:40:28 -0400 Subject: [PATCH 2/2] Access denied disabling WinHttpAutoProxySvc Signed-off-by: Sunjay Bhatia --- build_container/build_container_windows.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/build_container/build_container_windows.ps1 b/build_container/build_container_windows.ps1 index 18285803..ed939eec 100644 --- a/build_container/build_container_windows.ps1 +++ b/build_container/build_container_windows.ps1 @@ -59,7 +59,6 @@ DisableService LanmanWorkstation DisableService MSDTC DisableService SysMain DisableService usosvc -DisableService WinHttpAutoProxySvc DisableService WinRM # Ensures paths rooted at /c/ can be found by programs running via msys2 shell