Skip to content

Commit d7bfad1

Browse files
authored
add start /wait command to fix github issue #6765 & update to how VS Build Tools is installed (#8716)
1 parent 821371c commit d7bfad1

File tree

1 file changed

+53
-35
lines changed

1 file changed

+53
-35
lines changed

docs/install/advanced-build-tools-container.md

Lines changed: 53 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,23 @@ ADD https://aka.ms/vscollect.exe C:\TEMP\collect.exe
8888
ARG CHANNEL_URL=https://aka.ms/vs/15/release/channel
8989
ADD ${CHANNEL_URL} C:\TEMP\VisualStudio.chman
9090

91-
# Install Build Tools with the Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues.
92-
ADD https://aka.ms/vs/15/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
93-
RUN C:\TEMP\Install.cmd C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
94-
--installPath C:\BuildTools `
95-
--channelUri C:\TEMP\VisualStudio.chman `
96-
--installChannelUri C:\TEMP\VisualStudio.chman `
97-
--add Microsoft.VisualStudio.Workload.AzureBuildTools `
98-
--remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
99-
--remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
100-
--remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
101-
--remove Microsoft.VisualStudio.Component.Windows81SDK
91+
RUN `
92+
# Download the Build Tools bootstrapper.
93+
curl -SL --output vs_buildtools.exe https://aka.ms/vs/15/release/vs_buildtools.exe `
94+
`
95+
# Install Build Tools with the Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues.
96+
&& (start /w C:\TEMP\Install.cmd vs_buildtools.exe --quiet --wait --norestart --nocache `
97+
--installPath C:\BuildTools `
98+
--channelUri C:\TEMP\VisualStudio.chman `
99+
--installChannelUri C:\TEMP\VisualStudio.chman `
100+
--add Microsoft.VisualStudio.Workload.AzureBuildTools `
101+
--remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
102+
--remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
103+
--remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
104+
--remove Microsoft.VisualStudio.Component.Windows81SDK
105+
106+
# Cleanup
107+
&& del /q vs_buildtools.exe
102108
103109
# Define the entry point for the Docker container.
104110
# This entry point starts the developer command prompt and launches the PowerShell shell.
@@ -135,21 +141,27 @@ ADD https://aka.ms/vscollect.exe C:\TEMP\collect.exe
135141
ARG CHANNEL_URL=https://aka.ms/vs/16/release/channel
136142
ADD ${CHANNEL_URL} C:\TEMP\VisualStudio.chman
137143
138-
# Install Build Tools with the Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues.
139-
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
140-
RUN C:\TEMP\Install.cmd C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
141-
--installPath C:\BuildTools `
142-
--channelUri C:\TEMP\VisualStudio.chman `
143-
--installChannelUri C:\TEMP\VisualStudio.chman `
144-
--add Microsoft.VisualStudio.Workload.AzureBuildTools `
145-
--remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
146-
--remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
147-
--remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
148-
--remove Microsoft.VisualStudio.Component.Windows81SDK
144+
RUN `
145+
# Download the Build Tools bootstrapper.
146+
curl -SL --output vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe `
147+
`
148+
# Install Build Tools with the Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues.
149+
&& (start /w C:\TEMP\Install.cmd vs_buildtools.exe --quiet --wait --norestart --nocache modify `
150+
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools" `
151+
--channelUri C:\TEMP\VisualStudio.chman `
152+
--installChannelUri C:\TEMP\VisualStudio.chman `
153+
--add Microsoft.VisualStudio.Workload.AzureBuildTools `
154+
--remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
155+
--remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
156+
--remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
157+
--remove Microsoft.VisualStudio.Component.Windows81SDK
158+
159+
# Cleanup
160+
&& del /q vs_buildtools.exe
149161
150162
# Define the entry point for the Docker container.
151163
# This entry point starts the developer command prompt and launches the PowerShell shell.
152-
ENTRYPOINT ["C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
164+
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
153165
```
154166
155167
::: moniker-end
@@ -180,21 +192,27 @@ ADD https://aka.ms/vscollect.exe C:\TEMP\collect.exe
180192
ARG CHANNEL_URL=https://aka.ms/vs/17/preview/channel
181193
ADD ${CHANNEL_URL} C:\TEMP\VisualStudio.chman
182194
183-
# Install Build Tools with the Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues.
184-
ADD https://aka.ms/vs/17/preview/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
185-
RUN C:\TEMP\Install.cmd C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
186-
--installPath C:\BuildTools `
187-
--channelUri C:\TEMP\VisualStudio.chman `
188-
--installChannelUri C:\TEMP\VisualStudio.chman `
189-
--add Microsoft.VisualStudio.Workload.AzureBuildTools `
190-
--remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
191-
--remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
192-
--remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
193-
--remove Microsoft.VisualStudio.Component.Windows81SDK
195+
RUN `
196+
# Download the Build Tools bootstrapper.
197+
curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/pre/vs_buildtools.exe `
198+
`
199+
# Install Build Tools with the Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues.
200+
&& (start /w C:\TEMP\Install.cmd vs_buildtools.exe --quiet --wait --norestart --nocache modify `
201+
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" `
202+
--channelUri C:\TEMP\VisualStudio.chman `
203+
--installChannelUri C:\TEMP\VisualStudio.chman `
204+
--add Microsoft.VisualStudio.Workload.AzureBuildTools `
205+
--remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
206+
--remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
207+
--remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
208+
--remove Microsoft.VisualStudio.Component.Windows81SDK
209+
210+
# Cleanup
211+
&& del /q vs_buildtools.exe
194212
195213
# Define the entry point for the Docker container.
196214
# This entry point starts the developer command prompt and launches the PowerShell shell.
197-
ENTRYPOINT ["C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
215+
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
198216
```
199217
200218
::: moniker-end

0 commit comments

Comments
 (0)