Recently, I posted some instructions for creating an installable layout for Visual Studio 2008 Express Editions and silently installing the components that are a part of the Visual Studio 2008 Express Edition setups.
In addition, there are some new silent installation command line switches introduced in the Visual Studio 2008 product family. I've heard from some customers asking me why I posted a long, involved set of instructions for silently installing the components for the Express Editions while there is a simple /q switch available for Visual Studio 2008 setup.
The good news is that since the same setup.exe chainer is used by all Visual Studio 2008 editions, these new silent switches can also be used to install the Visual Studio 2008 Express Editions. The bad news is that the Express Editions were not officially designed to support silent installations in this manner, and there is a bug that can prevent the silent install from working in some scenarios without applying one of the workarounds listed at the bottom of this post.
Description of the issue
The installers for the Express Editions assume that they are being run from a location that they have write permissions to (since the normal UI-based installation scenario starts by copying the setup files to the %temp% folder and re-launching setup from there). This means that if you create an installable layout for the VS 2008 Express Editions and then copy it to a read-only network and attempt to run setup.exe /q /norestart, setup will fail with a error message related to the setup file vs_setup.ms_.
Diagnosing the issue
The log file named %temp%\dd_install_*.txt will have an error message that looks like the following:
[03/25/08,11:11:58] Microsoft Visual C# 2008 Express Edition - ENU: ***ERRORLOG EVENT*** : ERROR_FILE_NOT_FOUND/ERROR_INSTALL_PACKAGE_OPEN_FAILED returned in CRootComponent::Install for: \\myserver\myshare\Visual C# 2008 Express Edition\VCS\vs_setup.ms_
Earlier in the log file, you will see the true root cause of this error:
[03/25/08,11:11:32] Microsoft Visual C# 2008 Express Edition - ENU: CreateProcess launched with cmd line: \\myserver\myshare\Visual C# 2008 Express Edition\vcs\.\.\Ixpvcs.exe "\\myserver\myshare\Visual C# 2008 Express Edition\vcs\.\.\Ixpvcs.exe" /Q /X:"\\myserver\myshare\Visual C# 2008 Express Edition\VCS\"
[03/25/08,11:11:57] Microsoft Visual C# 2008 Express Edition - ENU: \\myserver\myshare\Visual C# 2008 Express Edition\vcs\.\.\Ixpvcs.exe exited with return value: 5
These log entries show that setup is attempting to extract the contents of ixpvcs.exe to the network share that setup is being run from, and it fails with return value 5 (which means access is denied, most likely because the network share is read-only).
How to work around the issue
Fortunately, there are a few options that can be used when deploying the Visual Studio 2008 Express Editions with the new /q switch in order to work around the above issue:
- Extract the contents of the main express edition setup package to the folder on the network share that hosts the setup files for the Visual Studio 2008 Express Editions.
For example, in the Visual C# 2008 Express Edition, you can do this by running ixpvcs.exe /x and selecting the path to extract the files to. When using this option, your installable layout as described in this blog post should contain both ixpvcs.exe and the files vs_setup.msi and vs_setup.cab that are inside of ixpvcs.exe in the root folder next to the file setup.exe.
- Grant write permissions to the network share that hosts the setup files for the Visual Studio 2008 Express Editions
- Copy the setup files for the Visual Studio 2008 Express Edition that you want to install in silent mode to the local computer and run setup from there instead of running setup directly from the read-only network share
Putting it all together
Once you use one of the above workarounds, you can install a Visual Studio 2008 Express Edition in silent mode by running the following command line just like you can in Visual Studio 2008 Standard Edition and higher:
setup.exe /q /norestart
One note - the previous blog post I wrote about the new silent switches mentioned a /full switch. This switch is not applicable to the Visual Studio 2008 Express Editions because they do not offer any selectable features that are not installed by default. So there is no need to use the /full switch during a silent install of a VS 2008 Express Edition.