I generate an an offline installer for the build tools like this:
vs_BuildTools.exe --layout c:\\VS_BuildTools2017_offline --add Microsoft.VisualStudio.Workloa
Possible workloads are specified here. Following command contains workloads for msbuild and C++ build tools.
Run (exe file will have some version numbers in name): vs_BuildTools.exe --layout c:\BT2017offline --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.WebBuildTools --add Microsoft.VisualStudio.Workload.NetCoreBuildTools --lang en-US
Copy c:\BT2017offline to box on which you want to install it.
Open mmc and import all certificates from c:\BT2017offline\certificates to "Trusted Root Certification Authorities" of computer (not current user)
Run (exe file will have some version numbers in name): c:\BT2017offline\vs_BuildTools.exe --noweb