Partilhar via


Better detailed instructions for chaining Visual Studio, Prerequisites and MSDN

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):

  1. Create a folder on your server, such as \\server\vs2003
  2. Create subfolders named \\server\vs2003\pre, \\server\vs2003\vs, and \\server\vs2003\msdn
  3. Copy the contents of the CD labeled Visual Studio .NET 2003 Prerequisites to \\server\vs2003\prereqs.
  4. Copy the contents of all CDs labeled Visual Studio .NET 2003 to \\server\vs2003\vs. If prompted, choose yes to overwrite existing files.
  5. 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:

  1. 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
  2. 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"
  3. 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)
  4. Run \\server\vs2003\vs\setup\setup.exe /createunattend \\server\vs2003\datafiles\vs.ini /vsupdate=\\server\vs2003\MSDN\setup.exe /vsupdateargs="qn"
  5. 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
  6. Open \\server\vs2003\datafiles\vs.ini, go to the [PostSetupLaunchList] section and change """qn""" to /qn
  7. 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:

  1. 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.
  2. 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.
  3. 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.
  4. 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:

  1. 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.
  2. 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....

Comments

  • Anonymous
    May 04, 2005
    If we dont have .NET Pre-requisite CD, how can we manage to instal .NET.

    Where can I find all the software pre-requistes over the NET.

    Can you please send the URL of all the pre-requisites..required for WINDOWS XP ..O.S.
  • Anonymous
    May 04, 2005
    If we dont have .NET Pre-requisite CD, how can we manage to install .NET.

    Where can I find all the software pre-requistes over the NET.

    Can you please send the URL of all the pre-requisites..required for WINDOWS XP ..O.S.
  • Anonymous
    May 06, 2005
    Hi!

    We have XP Sp2 with .NET 2 Beta 2 deployed to all machines and want to deploy VS.NET 2005 Beta 2 untattended to several machines.

    Where can I find the steps to do that? It would be cool if you could write an article how to silently install VS.NET 2005!

    Thanks!
  • Anonymous
    May 19, 2005
    Hi,


    I have followed these instructions to the T about 100 times already and for some reason it will not create the vi.ini file. It creates the prereq.ini file but no the other. I read the Gothcas and made sure everything is being typed in correctly and I have full writes on the server. PLEASE HELP! What could I be doing wrong. One thing I have to mention is that the path to my server is quite long. I cut names of directories down such as datafiles is d and vs2003 is vs. Could this be the problem? Any input would be greatly appreciated.

    Marcos Santiago
    msantiag@rdg.boehringer-ingelheim.com
  • Anonymous
    May 23, 2005
    I got a question from a customer who found this blog post describing how to chain silent installation...
  • Anonymous
    May 26, 2005
    The comment has been removed
  • Anonymous
    July 20, 2005
    Any Suggestions on making SP1 for .NET (VS7.0) install silently. The vendor whos code we are extending will be switching from VS6.0 to VS7.0 late this year, I've tried to get .NET2003 to work - but they have lots of stuff hard coded to the VS7.0 directories. -- Anyway I can install VS 7.0 silent, but am having problems with the service pack - any help would be appreciated

    Thanks

    Les
  • Anonymous
    July 20, 2005
    Hi Les - you can download VS .NET 2002 (VS 7.0) SP1 from http://www.microsoft.com/downloads/thankyou.aspx?familyId=c41d8159-b42f-4d06-a797-e510494976ee&displayLang=en and then run the package with the /q switch to install it silently. Let me know if you run into any problems getting this to work...

  • Anonymous
    September 26, 2005
    Works perfect! Only two questions.... is it possible to have a progress bar during install and remove the reboot in the prerequisites setup?
  • Anonymous
    September 27, 2005
    Hi Olan - unfortunately the answer to both of your questions is no. There is not a way to make unattended VS installation show a small progress bar (similar to msiexec's /qb switch). Also, any reboots required during installation need to happen, and are caused by files in use during installation. There has been some work done in the .NET Framework 2.0 to reduce reboots (http://blogs.msdn.com/quanto/archive/2005/08/28/457389.aspx) that will help here. You can also try to close down unnecessary processes on your client machines prior to installing VS to help reduce reboots.

  • Anonymous
    October 14, 2005
    Question: Will it work on a local drive? Say I put everything in "c:vs2003" ?
  • Anonymous
    October 14, 2005
    Hi Glentium - these instructions should also work if you copy the files to a local drive (such as c:vs2003) instead of a network path. I used network paths in the example because the most common scenario I've run into is that people want to create a central network install point and then run that same setup on all of their client machines.
  • Anonymous
    October 14, 2005
    Thanks Aaron. Just finished copying the CDs.. I'll try it then post the result here..
  • Anonymous
    October 14, 2005
    The comment has been removed
  • Anonymous
    October 15, 2005
    ooops! sorry, my fault. I'm installing on a fresh install of Windows Server 2003. I haven't installed the IIS and FrontPage server extensions. When I ran it, it went okay. The install finished. My problem now, is that it didn't create the VS.INI file, I only found PREREQ.INI.
  • Anonymous
    October 15, 2005
    The comment has been removed
  • Anonymous
    October 17, 2005
    Yes, it worked!

    I did it again on a fresh install of Server 2003 and it worked! Maybe I didn't run the setup.exe in the setup directory the first time around, I couldn't remember. But now it worked! Thank you, Aaron. Very much appreciated!
  • Anonymous
    November 16, 2005
    Hi Aaron,

    I have been trying to perform an unattended installation of vs 2003 using an ini file I created following the steps in the MS knowledge base article KB812820. I can create the .ini file fine, but when I try and use it in the install it seems to ignore the options I've set (i.e. I don't want to install c++) in MY .ini file. I've tried following the steps you outline above, and replacing the reference to the vs.ini in prereq.ini with the ini specific .ini file I created, but that makes no odds at all. Is it just not possilbe to do what I want (contrary to the KB article!)?

    Thanks for any pointers you can provide.

    Jason
  • Anonymous
    November 25, 2005
    I have followed any step and all works fine.
    Then only problem is that i must install ALL prerequisites for getting unattended creation of VS's setup.
    If i install only dotnet 1.1 (and VJ#) the setup ask me for "installing prerequisites"
    Thanks
  • Anonymous
    November 25, 2005
    Hi Stefano - In general, it is required that you install all of the prerequisites before Visual Studio setup will allow you to install the main VS product. There is an option to uncheck the prerequisites when you create an unattend file, but VS has not been tested and it is not recommended that you install without all of the prerequisites installed beforehand.

    If you really want to install VS without all of the prerequisites, you can the following in place of step 5 in the instructions above:

    Open \servervs2003datafilesprereq.ini, go to the [PostSetupLaunchList] section and change """unattendfile \servervs2003datafilesvs.ini""" to /unattendfile \servervs2003datafilesvs.ini /NO_BSLN_CHECK

    Note that VS setup will not install correctly if you do not at least install the .NET Framework. If you leave out the other prereqs, you will see some broken behavior in scenarios in the VS IDE, but most things will likely work (though the IDE has not been tested much at all in this type of scenario).

    Please contact me at http://blogs.msdn.com/astebner/contact.aspx if you run into any issues getting this to work.
  • Anonymous
    January 31, 2006
    The comment has been removed
  • Anonymous
    January 31, 2006
    Hi Jay - It sounds like you are hitting a reboot due to files in use during the prerequisites phase of VS setup. If you can send me the log files listed at http://blogs.msdn.com/astebner/articles/447004.aspx I can tell for sure (you can send them to aaronste@microsoft.com).

    Unfortunately, if there is a reboot during the prerequisites, you will have to have autologon configured on your system or manually log on. You can avoid this by deploying each individual prerequisite package one by one and suppress the reboots until the end.

    Also, did you launch your setup from a mapped drive in this scenario? I think that would explain why you are getting prompted to reconnect after the reboot. You might want to try from a UNC path or a local path, or configure your system to save mapped drive paths after a reboot to avoid this.

  • Anonymous
    February 21, 2006
    Everything works great Aaron. But im quite bothered by the fact that the whole install goes totally silent. I would like that the user atleast gets a message that tells him that setup is complete.

    Im trying to accomplish this by using (simple) batchfiles. Ive edited the answer file vs.ini's "postsetuplaunchlist" and put in c:2.bat. So that when Visual Studio is done isntalling the user gets a batch window telling him that the install is done. I would like to do the same for MSDN Library but this isnt possible since the MSDN Library setup doesnt seem to use an answer file.

    Do you have any suggestions how I could inform my users that the installation is complete?
  • Anonymous
    February 21, 2006
    Hi Gerben - There isn't a built-in way to have MSDN setup launch something when it finishes.  You will have to handle this in whatever wrapper script/batch file that you use to launch the setup process to begin with.  It will have to wait for all of the setups to finish installing and then display some information to the user.  This is less than ideal, but unfortunately the setups that are a part of Visual Studio were not designed with this type of scenario in mind and we're stuck working around it with existing means...