Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio
All postings are provided AS IS with no warranties, and confer no rights. Additionally, views expressed herein are my own and not those of my employer, Microsoft.
Visual Studio 2002, 2003 and 2005 setups include a silent deployment mode that requires multiple steps (creating an INI file on the matching OS version and language, then running VS setup and passing it the INI file to perform the installation). Those of you who have automated the installation of these versions of Visual Studio can attest to the difficulties that this multi-step, OS version-specific process has introduced.
In order to make the most commonly needed automated installation scenarios easier to achieve, the following command line switches have been added to Visual Studio 2008 setup:
Note - if you need to pass in a product key when running setup using these new silent switches, you will need to use the syntax described in this blog post.
There are some important notes to keep in mind for these new silent install options:
<update date="9/20/2007"> Added more details about how the /norestart switch works </update>
<update date="12/17/2008"> Added a link to a separate blog post I wrote about how to pass a product key into setup when using the /q switch. </update>
PingBack from http://msdnrss.thecoderblogs.com/2007/09/13/new-simplified-silent-install-switches-are-available-for-visual-studio-2008-setup/
While helping an internal Microsoft team work on deployment scripts to install Visual Studio 2008 to
PingBack from http://msdnrss.thecoderblogs.com/2007/11/02/how-to-work-around-visual-studio-2008-unattended-install-bug-related-to-windows-installer-31/
I previously wrote a blog post describing some new silent install switches that have been introduced
Recently, I posted some instructions for creating an installable layout for Visual Studio 2008 Express
When I do a silent install of Visual Studio 2008 Development Edition using the switch:
Setup\setup.exe /q /norestart /unattendfile \\server\setup\VS.ini
The reboot occurs at the end of the installation. When I restart Visual Studio 2008 works fine but I really need to suppress that final reboot or at least prompt the user to reboot.
I am running this script to install the prerequisites:
WCU\msi31\WindowsInstaller-KB893803-v2-x86.exe /quiet /norestart
WCU\dotNetFramework\dotnetfx35setup.exe /q /norestart /lang:ENU
WCU\DExplore\dexplore.exe /q
WCU\WebDesignerCore\WebDesignerCore.exe /Q /install
Setup\setup.exe /q /norestart /unattendfile \\iaunswd03\dp$\SMSPKG\D000003b\setup\VS.ini
Will that be enough to suppress the reboot or am I missing something?
Regards Alex
Hi Lavertal - It is not supported to combine the /norestart switch with the /unattendfile switch. If you need to use an INI file and also control reboots, you will need to make sure to pre-install any components that could potentially cause reboots, then create the INI file (so that those pre-installed components will not be included in the INI file).
I am using the setup.exe /q /full command to push VS 2008 to a couple test machines.
It works great when I run the command under a logged on user, but when I send it via the remote deployment software we use, I receive the following error in the Application log on the target machine.
Event Type: Error
Event Source: MsiInstaller
Event Category: None
Event ID: 10005
Description:
Product: RGB9RAST -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2103. The arguments are: 26, ,
I looked this error up and it seems .net Framework 3.5 has to install under a user with a local profile (which my deployment account won't have on the target machine)
I tried creating a separate task to just install framework 3.5 and to pass the ALLUSERS option to the installer. But I still receive the same error.
The command I tried was
dotNetFramework\dotnetfx35setup.exe /q /norestart /lang:ENU /v"ALLUSERS=2"
Does anyone have a workaround for this issue?
Just to clarify, the full silent install works great if it is run under a logged on user. When run under a deployment account (an account with no local profile) .net framework 3.5 fails.
Hi Ac2008 - Unfortunately, this is a known issue with the RGBRast package that is a prerequisite for the .NET Framework 3.0 and 3.5. If you need to deploy using an account with no local profile, you will need to extract the contents of the RGBRast9 package (it is a single file named rgb9rast_2.dll) and copy it to %windir%\system32 on your target systems prior to deploying the .NET Framework 3.5 and VS 2008. This component is only needed on x86 Windows XP and Windows Server 2003 systems.
Thank you for the reply Aaron. I've got my silent install working. One more question. Is there a way to chain the MSDN install to the end of the V.S. 2008 install?
Right now, my 2008 silent install reboots the machine, then I have another task I have to send to install the MSDN documentation.
It would be great if it would all install at once, then reboot the machine at the end.
Hi Ac2008 - VS 2008 setup has a /norestart switch that you should be able to use to suppress the reboot at the end of VS 2008 installation. When you do that, you should be able to schedule the MSDN installation and then defer the reboot until after that completes.
There is also a way to chain MSDN install directly to the end of VS installation, but it cannot be done with the new /q, /full or /norestart switches. Instead, you need to use the old unattended INI file installation mechanism. There is an example of how to do this and chain MSDN for VS 2005 at http://blogs.msdn.com/astebner/archive/2005/05/24/421314.aspx. I haven't tried those steps with VS 2008, but the underlying setup is similar enough in VS 2008 that I think these steps should also work in VS 2008.
Are there any uninstall switches? What is the best (and quickest) way to implement a silent uninstall of visual studio 2008 (default install)
Hi Garm - The setup.exe does have a /u switch that you can use to do a silent uninstall. However, that switch will only remove the main vs_setup.msi - it will not remove any of the other MSIs that Visual Studio 2008 setup chains behind the scenes, so I'm not sure how useful it really is.
What I would recommend doing here is something like this:
1. Take the full list of components being installed (from the Manual Uninstall Instructions) section of the topic at http://msdn.microsoft.com/vs2008/bb968856.aspx as a starting point
2. Find the product code for each of them by using the MsiInv tool described at http://blogs.msdn.com/astebner/archive/2005/07/01/434814.aspx
3. Create an uninstall script that runs msiexec /x for each of those product codes in the exact order listed in that MSDN topic.
There are some components that you may not want to remove as a part of this uninstall - for example, the .NET Framework 3.5 might be used by other products on your system so you may want to leave that behind.
I have a question also - could you explain your scenario in more detail. I haven't run into any cases yet where customers needed to automate the uninstall of VS, so I'd like to learn more about why that is required in your environment.
Please let me know if you have any problems getting the above steps to work.