Microsoft Visual Studio 2008

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

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 %SOFTWARE%\vs2008.

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.

"%SOFTWARE%\vs2008\Setup\setup.exe" /createunattend "%SOFTWARE%\vs2008\Setup\vs2008-install.ini"

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.

"%SOFTWARE%\vs2008\msdn\Setup\setup.exe" /createunattend "%SOFTWARE%\vs2008\msdn\msdn-install.ini"

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 [InstallOrder] section and remove the following lines (they are just below the section heading).
gfn_mid windows installer 3.1
gfn_mid net framework setup
gfn_mid dexplore
gfn_mid webdesignercore
  • Similarly, in the msdn-installer.ini file locate the [InstallOrder] section and remove the following lines (they are just below the section heading).
gfn_mid windows installer 3.1
gfn_mid framework 2.0a setup
gfn_mid dexplore


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 to reboot the computer.

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

References