How to work around product key issue with new Visual Studio 2008 silent switches

I previously wrote a blog post describing some new silent install switches that have been introduced in Visual Studio 2008 setup.  Unfortunately, an issue was recently found with these switches that can cause installation to fail.

To summarize the issue, if you attempt to use the /q and /full switches for Visual Studio 2008 setup, and the copy of Visual Studio 2008 that is being installed is not configured to have a pre-populated product key, then setup will fail during the CA_SetPidProps custom action that runs as a part of the main vs_setup.msi.

There are a couple of options that will allow you to work around this issue:

Option 1 – Pass the product key via command line when running setup

You can provide an additional command line parameter to the Visual Studio 2008 setup.exe to specify the product code that will be used during installation.  The command line will look like the following:

<VS install location>\setup\setup.exe /q /msipassthru=BEGIN” PIDKEY=xxxxxxxxxxxxxxxxxxxxxxxxx “END

You need to replace xxxxxxxxxxxxxxxxxxxxxxxxx in the above example command line with the actual 25-character product key for your copy of Visual Studio 2008 with no dashes included.

Option 2 – Add a pre-populated product key to the VS setup data file

You can use the following steps to add a product key to the appropriate Visual Studio 2008 setup data file in order to cause the key to be automatically pre-populated during unattended Visual Studio 2008 setup:

  1. Copy the VS installation files to a location that you have write permission to
  2. Open the file <VS install location>\setup\setup.sdb in a text editor such as Notepad
  3. Go to the end of the file and locate the section named [Product Key]
  4. Press enter and add the product key to the line immediately after [Product Key] so it looks like the following:

    [Product Key]
  5. Save and close setup.sdb
  6. Run <VS install location>\setup\setup.exe /q to install silently and have setup use the product key specified in setup.sdb

You need to replace xxxxxxxxxxxxxxxxxxxxxxxxx in step 4 above with the actual 25-character product key for your copy of Visual Studio 2008 with no dashes included.  You do not need to modify setup.sdb if you already see a 25-character product key listed in this file.

Comments (4)

  1. tilovell09 says:

    Tip for anyone else trying this with Dev10 – try it without spaces in the quotes around the PIDKEY. :-/

  2. James Mclean says:

    I use Visual Studio 2008 at work. I am trying to download Visual Studio 2010 express at home. I am mostly self taught in Visual Basic and C#. I figure if I do my learning at home I won't make a mess at work. i can find the four 2010 languages but not the Visual Studio part. I also can't register what I have. Microsoft says what I am looking for doesn't exist. I think it does.

  3. Hi James Mclean – Each of the Visual Studio 2010 express editions include a version of the Visual Studio IDE.  You don't need to download any additional components.

    I don't have any experience troubleshooting Visual Studio registration issues, so I'd recommend posting a question on the Visual Studio setup forum at…/home for that issue.