Ever since I posted my original instructions for chaining unattended installation of the Visual Studio .NET Prerequisites, Visual Studio and MSDN, I have had a few customers who tried these steps out and had problems getting the steps to work. So as a result I want to write a new post where I give better detail and clarify each of the steps to make this unattended installation process easier to understand and implement.
To start with you should stage Visual Studio bits to a network share so that you can use this as your installation source later on. You can accomplish that with the following steps (also described in the VS readme):
- Create a folder on your server, such as \\server\vs2003
- Create subfolders named \\server\vs2003\pre, \\server\vs2003\vs, and \\server\vs2003\msdn
- Copy the contents of the CD labeled Visual Studio .NET 2003 Prerequisites to \\server\vs2003\prereqs.
- Copy the contents of all CDs labeled Visual Studio .NET 2003 to \\server\vs2003\vs. If prompted, choose yes to overwrite existing files.
- Copy the contents from all the CDs labeled MSDN Library for Visual Studio .NET 2003 to \\server\vs2003\msdn. If prompted, choose yes to overwrite existing files.
NOTE: You can substitute a later MSDN Quarterly Library for the version of MSDN that shipped with Visual Studio .NET 2003 if you choose
Now that you have a network image, you can create the unattended INI files to install VS Prerequisites, VS and MSDN using the following steps:
- Locate a test computer that has the same operating system that you want to deploy Visual Studio to in your network, and make sure that it does not already have Visual Studio .NET 2003 installed
- Run \\server\vs2003\prereqs\setup.exe /createunattend \\server\vs2003\datafiles\prereq.ini /vsupdate=”\\server\vs2003\vs\setup\setup.exe” /vsupdateargs=”unattendfile \\server\vs2003\datafiles\vs.ini“
- Install .NET Framework 1.1 on your test computer (because this is required for creating an unattend file for Visual Studio in the next step)
- Run \\server\vs2003\vs\setup\setup.exe /createunattend \\server\vs2003\datafiles\vs.ini /vsupdate=\\server\vs2003\MSDN\setup.exe /vsupdateargs=”qn”
- Open \\server\vs2003\datafiles\prereq.ini, go to the [PostSetupLaunchList] section and change “””unattendfile \\server\vs2003\datafiles\vs.ini“”” to /unattendfile \\server\vs2003\datafiles\vs.ini
- Open \\server\vs2003\datafiles\vs.ini, go to the [PostSetupLaunchList] section and change “””qn””” to /qn
- Go to a clean computer without Visual Studio .NET 2003 installed and run \\server\vs2003\prereqs\setup.exe /unattendfile \\server\vs2003\datafiles\prereq.ini to test the unattended installation process
There are a couple of gotchas that I have seen that you should keep an eye out for when following these instructions:
- Make sure to note the extra \setup\ directory for the Visual Studio setup.exe in the steps above. Unattended installation will not work correctly if you run the setup.exe in the root of the \\server\vs2003\vs folder; you must use \\server\vs2003\vs\setup\setup.exe.
- Make sure that you have write permission for the location that you create your data files at in steps 2 and 4 above (in this example I used \\server\vs2003\datafiles). You will get an error if you try to create the data files on a share that you do not have write permissions for.
- Make sure that you create the INI files on a computer that does NOT already have Visual Studio .NET 2003 installed. If you have VS installed, you will end up creating an INI file for a maintenance mode update instead of an initial install of VS.
- The INI files for VS are unique to each version of VS (such as Pro, Standard, Enterprise Architect), and also unique to the OS that you want to install on (Windows 2000, Windows XP, etc). Make sure that you create INI files on computers that match what you will eventually be deploying to.
There are a couple of advanced tricks that you can use when creating these unattend scripts as well:
- If you want to perform a full install of MSDN to the local hard drive instead of a default installation, you can read the steps at this blog post to learn how to update your vs.ini file to call MSDN setup with the correct parameters to accomplish this.
- If you want to run the unattended installation via a batch file or script and wait for the process to exit and check the return code, you will notice that by default Visual Studio setup copies itself to the %temp% folder, kills the current process and restarts to perform the actual installation. This logic breaks batch files or scripts that listen for return codes. To prevent setup from copying itself to the %temp% folder and starting a new process, you can open up setup.sdb in the \\server\vs2003\vs\setup folder, locate the [Product Information] section, and add the following line to that section: NoInitialFileCopy=1. You must add this entry to setup.sdb before you create any of the INI files above.
As always, let me know if you have questions or problems with any of the above steps….