I’ve been trying to create an offline installer for Visual Studio 2019 but unfortunately, the official Microsoft solution is not very firewall-friendly.
So here is an alternative solution that works well with Windows Firewall whitelist-mode.
Download this collection of the batch files. I have split them into multiple files to make it easier to run them.
Here is the overview of each batch file.
_Step1.bat: It downloads the vs_community.exe
_Step2.bat: It downloads vs_installer.opc
_Step3.bat: It extracts both these files into their respective directory. It’s important to have 7-Zip installed on your PC, otherwise, this step will fail
_Step4.bat: It finally creates the offline installer into the directory written after –layout in the source code. Change the path here to the actual directory where you want to create an offline installation for Visual Studio.
Question #1: What firewall exceptions are required for these batch files to work?
powershell.exe: For _Step1.bat (you can alternatively download that URL yourself to avoid white-listing powershell.exe)
vs_installer_opc\contents\resources\app\layout\setup.exe: For _Step4.bat. It’s a required firewall exception.
Question #2: How do I update the offline installer to include the latest version of Visual Studio
Just run the same batch files again and it will update the offline installer instead of re-downloading everything from the stretch.