| Author: |
Carlos J. Quintero (Microsoft MVP) |
Applies to: |
Microsoft Visual Studio 2005 |
| Date: |
October 2012 |
|
Microsoft Visual Studio 2008 |
| |
|
|
Microsoft Visual Studio 2010 |
| |
|
|
Microsoft Visual Studio 2012 |
Introduction
Setups of Visual Studio extensions (add-ins, packages) can detect the
installation of Visual Studio versions, editions or components using
registry-based checks, as explained in the articles HOWTO: Detect installed Visual Studio editions, packages or service packs
and HOWTO: Detect if Visual Studio .NET is installed in a Visual Studio Setup package for an add-in.
For MSI-based setups, they can use MSI component-based checks, as explained in
this article.
More information
Visual Studio MSI components are identified by a Guid that can be known through
two ways:
- In the MSDN documentation: see the page
Detecting System
Requirements.
- Using the orca.exe tool to open msi packages of the Visual Studio setup:
- Install the Microsoft Windows SDK v7.0A (or check that some Visual Studio setup
has installed it in the folder C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\Bin)
- Locate the orca.msi setup in that folder and install it. This installs orca.exe
in the folder C:\Program Files (x86)\Orca.
- To locale component GUIDs, use orca.exe to open the following .msi files of the
Visual Studio setups and locate the Component table:
- Visual Studio .NET 2002: VS_SETUP.MSI
- Visual Studio .NET 2003: VS_SETUP.MSI
- Visual Studio 2005: VS_SETUP.MSI
- Visual Studio 2008: VS_SETUP.MSI
- Visual Studio 2010: VS_SETUP.MSI
- Visual Studio 2012: \packages\professionalcore\Setup\VS_PROFESSIONALCORE.MSI
The following table summarize some common component Ids in the Component table
of .msi setup files of Visual Studio:
|
Description |
Component |
Component Id |
|
VS.NET 2002 |
Core_IDE_VS7_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{0C4A71DF-5A73-11D3-A520-00A0C9231BA1} |
|
C# 2002 |
_VCSharp_Project_System_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{B881292C-F099-11D4-A547-0090278A1BB8} |
|
C++ 2002 |
_vc_VCPKG_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{00E21CF5-5361-11D3-A51F-00A0C9231BA1} |
|
VB 2002 |
VB_Project_Package_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{62EDCDC9-69F4-11D3-A521-00A0C9231BA1} |
|
VS.NET 2003 |
Core_IDE_VS7_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{153B059B-B2F4-4B54-9AC3-32BE38E470E1} |
|
C# 2003 |
_VCSharp_Project_System_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{6110A574-76CE-45A5-92E8-2E194F20BBF7} |
|
C++ 2003 |
_vc_VCPKG_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{1E8D5C4E-0143-4871-9E7E-F04EEF70C3E0} |
|
VB 2003 |
VB_Project_Package_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{667F7FE3-3165-41C4-9CF9-F2719ADF0505} |
|
VS 2005 |
Core_IDE_VS7_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{320DB690-7979-4015-BD78-A16D7279043B} |
|
C# 2005 |
_VCSharp_Project_System_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{727833BC-8B4B-4480-B34A-B1A17CFF259B} |
|
C++ 2005 |
_vc_VCPKG_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{28A38374-4A68-4562-9AF3-5D7BB96B0461} |
|
VB 2005 |
VB_Project_Package_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{F5FDD145-7637-4CA7-90FE-6936A082CEDB} |
|
VS 2008 |
Core_IDE_VS7_673_____x86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{9E43F3BB-E7AE-4A97-ACF6-FB864533CC7E} |
|
C# 2008 |
_VCSharp_Project_System_5146_____x86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{8D70EE8E-1638-40C2-921B-28E52A68A986} |
|
C++ 2008 |
_vc_VCPKG_439_____x86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{35DF9D40-8283-4661-B572-F7EACCAB287C} |
|
VB 2008 |
VB_Project_Package_745_____x86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{F59EAFC0-6C67-40F2-AE59-85E4CE330A4E} |
|
VS 2010 |
Core_IDE_VS7_673_____x86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{D9291B56-A7B4-4F5A-96B6-EF25F821821E} |
|
C# 2010 |
_VCSharp_Project_System_5146_____x86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{D3246EF0-4F4E-4F81-B4FF-8C716EC0A929} |
|
C++ 2010 |
_vc_VCPKG_439_____x86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{82D71315-B841-492E-986E-2660ABD89CD1} |
|
VB 2010 |
VB_Project_Package_745_____x86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{235875C7-333C-4186-A46F-064431527642} |
|
VS 2012 |
N/A |
N/A |
|
C# 2012 |
_VCSharp_Project_System_5146_____x86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{2C599C41-6349-4636-A370-BF5B19C451EC} |
|
C++ 2012 |
_vc_VCPKG_439_____x86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{1243286A-60DE-45D8-B6E7-5D5AD4066549} |
|
VB 2012 |
VB_Project_Package_745_____x86.3643236F_FC70_11D3_A536_0090278A1BB8 |
{E564381B-94EA-435E-BD6A-07193CFD3FB2} |
Once you have the Component Id (GUID), you can create a condition in the setup package to check
the existence of one or more of those GUIDs. In this example, we will show how to
create a condition that checks the existence of Visual Studio 2010 with the C++
language with a setup created with Visual Studio 2010:
- Open Visual Studio 2010.
- Create a new Setup and Deployment Package.
- Select the setup project in the Solution Explorer.
- Click the "Launch Conditions Editor" button on the toolbar of the Solution
Explorer.
- In the Launch Conditions Editor, select the node "Search Target Machine" and
right-click the "Add Windows Installer Search" context menu.
- Name the search "Search for VS 2010".
- In the properties window for this search, enter these values:
ComponentId: {D9291B56-A7B4-4F5A-96B6-EF25F821821E} Property:
VS2010INSTALLED
- Add another search named "Search for VC++ 2010" with these values:
ComponentId: {82D71315-B841-492E-986E-2660ABD89CD1} Property:
VC2010INSTALLED
- Select the node "Launch Conditions" and right-click the "Add Launch
Condition" context menu.
- Name the condition "VS2010AndVC2010Installed".
- In the properties window for this condition, enter these values:
Condition: VS2010INSTALLED And VC2010INSTALLED Message: Visual Studio 2010
with C++ is required
- Build the setup and test it.
Related articles
Go back to the 'Resources for Visual Studio .NET extensibility' section for more articles like this
|