Installing VS2005 in a Layer
Juice reader trb48 has been heads down in the back lab figuring out better ways to use SVS. He came up with a pretty cool formula that'll streamline the deployment of your more complex apps -- starting with Visual Studio.
Snap on the rubber gloves and check it out.
Introduction
SVS is an amazing piece of technology and innovation. It solved a ton of problems in our IT department, but we did hit a few snags. It seems that we would run into programs that we wanted to virtualize, but we could not import the layer to a new machine. Why? The software in the layer stores license data in the registry. This data is specifically tied to the hardware of the machine that the layer was built on. There are some ways to get around this problem, but they seem more work than it is worth. I have an interesting approach to solving this problem that will give you the benefits of SVS with all software.
Overview
The answer is combining a "silent install" with SVS. First, we need to create what I call a "silent install package." This will install the software, with the appropriate settings, on the machine without any user interaction. Next, we need to create a script file that creates a SVS layer that will capture the "silent install package." The third and final step will combine these two innovations into one package.
For this example I have choosen to walk you through creating a silent install package in Visual Studio 2005. Why? This piece of software has been giving IT departments headaches for a long time. Without this process, you have to hack the layer for it to work.
What you will need:
- A server, on a network, that all your computers can access
- Visual Studio 2005 with enough licenses
- SVS installed on every machine
- Time and patience
- TUGZip or similar program installed
Creating the Silent Install Package
The first thing you need to do when you want to create a silent install package is go to Google.com. In the search bar I typed in Visual Studio 2005 silent install. Then I started to dig through the entries to find a tutorial that will help me achieve my goal. Lucky for you, I found the cream of the crop. Here they are:
- How to deploy Visual Studio 2005 by using Systems Management Server
- This is Microsoft's official guide to installing Visual Studio silently - Unattended Installation of Microsoft Visual Studio 2005
- MSFN is a very valuable resource for creating silent install packages
I will quickly walk you through how to create a package for Visual Studio. If you run into any problems, or cannot understand what I am saying, please refer to the links above.
Setting up the files
- On your server create a shared folder called "VisualStudio2005"
- Inside "VisualStudio2005" create two folders:
- VisualStudio2005/VisualStudio
- VisualStudio2005/MSDNNote: I will continue to use these through this guide. Also, the folder names cannot have spaces in them. - Copy the contents of your CDs labeled Visual Studio 2005 to VisualStudio2005/VisualStudio
Note: If prompted, overwrite existing files. - Next, copy the contents of your CDs labeled MSDN Library to VisualStudio2005/MSDN
Note: If prompted, overwrite existing files. - Open the Setup.ini file that is now located in the VisualStudio2005/VisualStudio folder
- Find the [Documentation] section and change "DIR=" to "DIR=..\MSDN"
- Save the file and close
- Navigate to VisualStudio2005/VisualStudio\Setup
- Open Setup.sdb and add the following:
[Product Key]
XXXXXXXXXXXXXXXXXXXXXXXXXNote: This is what automates the process. Now, during the install you will not be prompted to enter the product key. Do not use dashes, only numbers - Save the file and close
- Share the VisualStudio2005 folder on the network. You can set all of the security settings on the server to your heart's desire.
This section was adapted from the following articles: How to deploy Visual Studio 2005 by using Systems Management Server and Unattended Installation of Microsoft Visual Studio 2005
Making it install silently:
- Go to Start > Run
- Enter in: "VisualStudio2005\VisualStudio\Setup\setup.exe /createunatted VisualStudio2005\VisualStudio\Setup\unattend.ini"
Note: This is all one line of text - Follow the instructions in the Administrator mode setup. This will allow you to specify what components will be installed and what settings will be used during the installation. When you are done the "unattend.ini" file will contain the settings you specificied while doing the Administrator mode setup.
Note: Through this process you can create, if you wanted to, custom settings for each Visual Studio user. - When you want to silently install Visual Studio, all you have to do is:
- Go to Start > Run
- Enter in: "\\Servername\VisualStudio2005\VisualStudio\Setup\setup.exe /unattedfile VisualStudio2005\VisualStudio\Setup\unattend.ini"
Notes: Make sure you have the following installed on your computer before you attempt to silently install Visual Studio 2005:
- Windows XP SP2
- Microsoft .NET Framework 2.0 with all updates
- Microsoft .NET Framework 3.0 with all updates
Creating a script to install Visual Studio 2005:
If you want to create a bat or cmd file that installs Visual Studio you:
- Right click on the desktop
- Go to New > Text Document
- Rename the file to "installvs2005.cmd"
- Hit enter
- Right click on "installvs2005.cmd" and go to edit
- First enter this in to map your network shared folder:
net use x: \\servername\VisualStudio2005Note: This maps the shared folder to the x: drive. It does not matter what drive you use, just as long as it is not being used on the computer you are running this cmd file from.Note: Depending on your shared folder's security settings, you may have to provide a username and password to access this folder. Here are some instructions on how to do that: How to use the Net Use command - Next, enter in the script to install Visual Studio 2005:
X:\VisualStudio\Setup\setup.exe /unattedfile VisualStudio2005\VisualStudio\Setup\unattend.ini"Note: Instead of using the \\servername, we are using the X: drive that we just mapped - Visual Studio will now begin to install.
- After it is done installing we should disconnect the X: drive by typing:
net use x: /delete - After the drive is disconnected, we should exit the cmd file (just for good measure)
exit
- First enter this in to map your network shared folder:
Here's the scripting we used in "installvs2005.cmd" file:
net use x: \\servername\VisualStudio2005 x:\VisualStudio\Setup\setup.exe /unattedfile VisualStudio2005\VisualStudio\Setup\unattend.ini" net use x: /delete exit
Turning the Script into an Executable File
Having a cmd file is fine and dandy, but it is not as useful as having an executable. There is a great guide to on how to turn a cmd file into an executable, found here.
The steps:
- Create a folder, and put installvs2005.cmd inside it
- Download the following files (and save them into the folder you just created)
- Right click on installvs2005.cmd and compress it to be a 7z file:
Note: You may need to download and install TUGZip or other program to do this. - Now, the inside of your folder should look like this:

- Open a command prompt, navigate to the folder you created, and type in the following:
copy /b 7zs.sfx + config.txt + installvs2005.7z installvs2005.exe - installvs2005.exe has been created, it will be useful to us later on in this process.
The following section was adapted from the following forum post: Creating a 7zip switchless installer
Installing the Package into a Layer:
Our goal, at this point, is to install Visual Studio into a layer. Why? We want to be able to activate, deactivate, and reset the program. Plus, we are looking ahead to all of the really cool features that will be included in future versions of SVS and we want to use them.
If we want to keep things simple, all we have to do is open the "Altiris Software Virtualization Solution Admin" and go to File > Create New Layer. Then click on "Install application." We can name the layer something like: Visual Studio 2005. Then we can select the cmd file that we created earlier. Visual Studio will then be installed into the Layer.
If you are like me you don't want to have to do anything on the computer. I want everything to be completely automated. In this next part of the guide I will tell you how to get Visual Studio to install in a layer automatically. If you have any questions in this section of the guide please refer to "Altiris Software Virtualization Solution Reference." Pages 55 and 56 will be the most helpful.
SVSCMD
Altiris has packaged an application that allows us to everything that the Altiris Software Virtualization Solution Admin can do. It is located in "C:\Program Files\Altiris\Software Virtualization Agent\SVSCMD.exe." We will use SVSCMD to create the Visual Studio layer.
The Script
Here is the script that we can use to create the layer:
SVSCMD.exe "Visual Studio 2005" CAPTURE -P "PathtoCMDFile\file.exe"
Here is what is going on:
- SVSCMD.exe: this is the command prompt based program that we will use to create the layer
- "Visual Studio 2005": this is the name of the layer we are creating
- CAPTURE: this is the parameter that tells SVSCMD that we are going to install a program into a new layer
- -P " PathtoCMDFile\file.exe": The -P is a flag associated to the CAPTURE parameter. It tells SVSCMD where to find the program that we are trying to capture into a layer. We cannot use a bat or cmd file, we can only use exe or msi.
Creating the Layer
Now, we have all the elements that we need to create a cmd file that will install Visual Studio into a layer. It will look something like this:
c: cd program files cd altiris cd Software Virtualization Agent SVSCMD.exe "Visual Studio 2005" CAPTURE -P "PathtoCMDFile\installvs2005.exe" exit
At this point you can copy this script into Deployment Console and schedule it to be installed. You can send the script to the user, and have them install it. And, you can create a executable using the cmd file above. Do whatever fits your needs.
Conclusion
This interesting workaround solves our problem with importing the Visual Studio layer onto new machines by avoiding importing layers. Instead, we set up a process that installs Visual Studio into a layer without any user interaction. This allows us to install the software on any computer, into a layer giving us all the benefits of virtualization.
This same process can be used on any application you run across. There are, however, a few drawbacks to this process. The main one is that you have to wait for the program to install, but if you have Deployment Console install this at night that is not that big of a deal.
Good luck, and feel free to contact me with any questions.
| Attachment | Size |
|---|---|
| config.txt | 70 bytes |
| 7zS.zip | 62.46 KB |
| installvs2005.zip | 577 bytes |
- Login or register to post comments
- 6638 reads
- Printer-friendly version

















This is...
This is excellent, and well described.
This took some effort, and I wish to thank you for posting this.
Kind Regards, Starf0x
Another Option is
Another option is to use WinZip to create the Self Extracting Executable. And I like the way you described it here. But the general deift of this is you are Layering the Application at Time of Install instead of Layering it before and pushing the package then. Do you still have the option to set EXECPTIONS. As I am sure your developers would not like it if you Deleted all thier applications on a layer reset...Or would you do this Per workstation?
Thanks - Tom Fronza
Wow, great article thanks
Wow, great article thanks for the tip. Could I modify for other version of Visual Studio as well?
Other Versions
The concepts that I talked about in this article apply to any software. They key is that you have to find out how to silently install the program.
A quick Google search will help you find instructions for silently installing most applications.
As far as exceptions go, I have not looked into that, but it is a really good question. One solution would be to create a data layer that looks for Visual Studio projects. That would prevent loss if the layer were reset.
Good Writeup
Good job on the writeup!
I have used a very similar solution.
We used WiseScript Editor to create an .exe to handle the process of creating the layer. Here are a couple of things we added that you did not comment in detail.
1. All other layers need to be deactiviated before the command capture can be run. They were reactivated after the capture was completed (svscmd.exe * D) & (svscmd.exe * A)
2. To minimize what you pickup on your capture you can stop services for inventory agents, antivirus software, etc so those changes are not captured in the layer.
3. You can add file exclusions by integrating excludegen and excludecopy commands at the end of the process.
4. We also added an execution for VS2005 SP1 as well.
-BSuggs
Excellent description, you
Excellent description, you have described this process in a clear and detailed way.
Regards
PM
UNC work for path to exe?
I am using the same method to create and svs layer for IBM rational application developer. I already have a silent install exe and I am trying to run the command svscmd.exe "RAD" CAPTURE -P "UNCPATH\rad.exe" I get a message error 14000 - The requested section was not present in the activation context. SVSCMD failed:capture. I mapped a network drive to the unc path and ran from the mapped drive and its going now...just want to know does it not accept UNC paths?
Nice article..
Its a very well documented article.. :)
Very Good Job Buddy. :) :)
Package Worked as far as install but...
The directions were clear with install; however I still get a Microsoft Visual Studio-Invalid License Data. Reinstall Is required. Can someone point me in the right direction?