Changes

Microsoft Visual Studio 2008

5,124 bytes added, 18:00, 30 June 2010
A guide to creating a Visual Studion 2008 package file.
Installing Visual Studio 2008 in "unattended mode" can be tricky. This biggest problem is that the installer likes to just mysteriously and sometimes silently quit. Below is a guide for implementing an unattended installation of Visual Studio 2008 and the MSDN library that comes on the disc. If you have any problem try looking in the References area.

== Preparing the Installation ==

First and fore most, you need to copy the DVD's contents to someplace WPKG can access it. Note, this bunch of files is quite large at 3.3GB so make sure you have lots of room. In this guide we will assume that you copied the files to <tt>%SOFTWARE%\vs2008</tt>.

Now we must create an ini file that the unattended installer will use to figure out what software to install. Run the following command. It will open a wizard that looks very similar to the standard Visual Studio install wizard. Proceed through the wizard, after you have selected the software to be installed click the ''Save Settings'' button. This will generate the ini file.
<source lang="winbatch">"%SOFTWARE%\vs2008\Setup\setup.exe" /createunattend "%SOFTWARE%\vs2008\Setup\vs2008-install.ini"</source>

If you wish to install MSDN then you must generate an ini file for its installation separately. The procedure is very similar. You will have to go through a wizard and click the ''Save Settings'' button at the end.
<source lang="winbatch">"%SOFTWARE%\vs2008\msdn\Setup\setup.exe" /createunattend "%SOFTWARE%\vs2008\msdn\msdn-install.ini"</source>

The unattended installer does not properly detect prerequisite software. It will try and install them again and fail with an 1603 return code. The root of this problem is that the prerequisite software is often installed by default. So we need to remove their installation from the ini files.
* In the vs2008-install.ini file locate the <tt>[InstallOrder]</tt> section and remove the following lines (they are just below the section heading).
<pre>gfn_mid windows installer 3.1
gfn_mid net framework setup
gfn_mid dexplore
gfn_mid webdesignercore</pre>
* Similarly, in the msdn-installer.ini file locate the <tt>[InstallOrder]</tt> section and remove the following lines (they are just below the section heading).
<pre>gfn_mid windows installer 3.1
gfn_mid framework 2.0a setup
gfn_mid dexplore</pre>


== Package File ==

We are now ready to create the package file. Remember those dependencies we removed from the ini file? We need to manually install them from the package file. After a successful Visual Studio installation you will need reboot the computer.

<source lang="xml">
<packages>
<package id="vs2008" name="Microsoft Visual Studio 2008" revision="2008" reboot="false" priority="10">
<!-- Visual studio does not always install these automatically. So we will install them manually first. -->
<depend package-id="net-3.5" />
<depend package-id="ms-doc-explorer" />
<depend package-id="ms-web-designer-tools" />

<!-- Install MSDN after VS 2008 -->
<chain package-id="msdn" />

<check type="uninstall" condition="exists" path="Microsoft Visual Studio 2008 Professional Edition - ENU" />
<install cmd='"%SOFTWARE%\vs2008\Setup\setup.exe" /norestart /unattendfile "%SOFTWARE%\vs2008\Setup\vs2008-install.ini"'>
<exit code="0" />
<exit code="1641" />
<exit code="3010" restart="delayed"/> <!-- just tells us we need to restart -->
</install>
</package>

<package id="msdn" name="MSDN" revision="2008" reboot="false" priority="10">
<check type="uninstall" condition="exists" path="MSDN Library for Visual Studio 2008 - ENU" />
<install cmd='"%SOFTWARE%\vs2008\msdn\Setup\setup.exe" /unattendfile "%SOFTWARE%\vs2008\msdn\msdn-install.ini"' />
</package>


<package id="net-3.5" name="Microsoft .NET Framework 3.5" revision="3.5" reboot="false" priority="10">
<check type="uninstall" condition="exists" path="Microsoft .NET Framework 3.5" />
<install cmd='"%SOFTWARE%\vs2008\WCU\dotNetFramework\dotnetfx35setup.exe" /q /norestart /lang:ENU' />
</package>

<package id="ms-doc-explorer" name="Microsoft Document Explorer 2008" revision="3.1" reboot="false" priority="10">
<check type="uninstall" condition="exists" path="Microsoft Document Explorer 2008" />
<install cmd='"%SOFTWARE%\vs2008\WCU\DExplore\dexplore.exe" /q' />
</package>

<package id="ms-web-designer-tools" name="Microsoft Web Designer Tools" revision="3.1" reboot="false" priority="10">
<check type="file" condition="exists" path="%PROGRAMFILES%\Microsoft Web Designer Tools" />
<install cmd='"%SOFTWARE%\vs2008\WCU\WebDesignerCore\WebDesignerCore.exe" /Q /install' />
</package>
</packages>
</source>


== References ==
* <tt>%SOFTWARE%\vs2008\Setup\adminreadme.htm</tt> &mdash; This file gives the general outline for performing unattended installs.
* http://www.msfn.org/board/topic/117875-unattended-ms-visual-studio-2008-pro/ &mdash; Gives directions for manually installing the prerequisites, optional components, and where to find the log files.
* http://www.appdeploy.com/messageboards/tm.asp?m=50186 &mdash; Explains how to fix the ini files.
1
edit