Pablo Galiano : Friday, July 04, 2008 - Posts

Subscriptions

<September 2010>
SuMoTuWeThFrSa
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

News

Subscribe to Pablo Galiano by Email

Post Categories

Friday, July 04, 2008 - Posts

Detecting installed VS edition via API

There are some scenarios where we need to detect the installed VS edition for our VS Package licence purposes.

The following snippet shows how to detect it and act accordingly.

 

    private SKUEdition GetSKUEdition(IServiceProvider serviceProvider)

    {

        var shell = serviceProvider.GetService(typeof(IVsShell)) as IVsShell;

        object sku;

 

        shell.GetProperty((int)__VSSPROPID2.VSSPROPID_SKUEdition, out sku);

 

        return (SKUEdition)Enum.Parse(typeof(SKUEdition), sku.ToString());

    }

 

    internal enum SKUEdition

    {

        Standard = 1000,

        Professional = 2000,

        Enterprise = 3000,

    }

 

Pablo

posted Friday, July 04, 2008 7:27 AM by pga with 0 Comments