Save yourself from insanity: Visual Studio 2012 silent install


Sometimes in IT you get tasks that can drive you to the brink of madness, fortunately this series of  posts should help before you end up like the chap on the right >>>

Credit for the R&D on this one go to my colleague Barry Whitehouse who had a lot of fun working on this

Starting off today is how to get Visual Studio 2012 to behave itself and install silently for deployment with your systems management tool of choice. In theory it seemed simple, run setup.exe and set required modifications in an XML file… but true to form there’s some irritating bugs to iron out as well.

The theory

First step is to copy the deployment files down to the local machine (or run from network share but we had some issues with this so went local to make it more reliable)

Next we edit the AdminDeployment.xml file to enable the NoWeb flag as per in the Microsoft instructions
Finally we run the executable with the correct switches

C:\VS2012\vs_professional.exe /adminfile AdminDeployment.xml /passive /norestart

The reality (and required workarounds)

The installer gave us hope initially, ran for about 10 minutes then promptly fell over at the end (after you’ve tried and failed with this multiple times you’ll understand the title of the article!) After digging through logs and a spot of Googling we found the first problem…

Issue #1 – you need .NET Framework 4.5

Without this installed Visual Studio is going nowhere. Download the full installer from Microsoft then run the silent installer (you can get away with suppressing the reboot at completion). Using Zenworks we copy the installer into a temporary folder to run it e.g.

${WinDir}\Temp\dotnetfx45_full_x86_x64.exe /passive /norestart

Once this component was installed we got a bit further but then found the installation rebooted half way through with no way to stop it, not good! One issue down one to go…

Issue #2 – SQL Server Compact Edition ignores norestart command

As you may have noticed above the Visual Studio installer runs as an exe and gives the option to suppress reboot behaviour via the /norestart parameter. This is meant to get passed to each component as the setup goes along. Problem is, it doesn’t…

We narrowed the problem down to the SQL Server Compact Edition (SCCE) component and soon found other people having the same issue, eventually confirmed by Microsoft that they had in fact borked the installer but weren’t rushing to fix it 😦

The easiest way around it is to install SCCE before the Visual Studio setup process and then disable it in the AdminDeployment.xml file (browse down the file and you’ll see where you can configure each component to enable \ disable the installation)

The most bizarre thing about installing SCCE is that if running a 64-bit OS you need to install the 32-bit version of the package first otherwise it won’t work! Certainly not the standard behaviour you’d expect. Installation goes something like this (for an x64 system)

msiexec /i SSCERuntime_x86-ENU.msi /qn
msiexec /i SSCERuntime_x64-ENU.msi /qn

End result and return codes

One you’ve done the pre-requisites above run your complete Bundle (or script if you’re on a different systems management product) and you should have a working installation.

If you’re using Zenworks make sure you include the result code 3010 (reboot required) in your list of acceptable return values or the installation will be marked as failed!

Make sure you schedule a reboot at the end of the installation (we prompt the user to do it) and you’re done 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: