- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
关于如何使用 PID(可以在 HKLM\SYSTEM\Setup\Pid
注册表项中找到)和 ProductID(可以在 HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
中找到)来检测 Windows 许可证类型和分发 channel ,网上有很多信息。
但是,关于如何检测用于安装其他 Microsoft 产品的许可类型的信息很少。
也就是说,我需要确定哪些是使用 MSDN 订阅许可证安装的,哪些是使用其他许可证类型安装的。
通过分析产品 GUID(在 Uninstall
注册表分支中找到),我设法找到了一些关于 Office 风格的信息:
最佳答案
Visual Studio 2010
The detection keys for Visual Studio are used both to detect if the product is installed and what service pack level is installed. As with previous versions, these keys and values are under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\VS\Servicing.
Key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\VS\Servicing\10.0\$(var.ProductEdition)\$(var.LCID)
Name Install
Type REG_DWORD (32-bit integer)
Data 0x00000001 (1)
The values for $(var.ProductEdition) include the following table. The for other products, this value corresponds to the ProductEdition property in the Property table of the Windows Installer package for that product. The locale IDs for $(Var.LCID) are listed here.
Visual Studio 2010 Ultimate VSTSCore
Visual Studio 2010 Premium VSTDCore
Visual Studio 2010 Professional PROCore
Visual Studio 2010 Shell (Integrated) IntShell
For Dev10 we have also added detection values to the edition keys so that you do not have to detect every single language for ever edition.
Key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\VS\Servicing\10.0\$(var.ProductEdition)
Name Install
Type REG_DWORD (32-bit integer)
Data 0x00000001 (1)
These registry keys and values are also used to detect the service pack level. Instead of checking for the Name registry value, check the SP registry value. Ignore SPIndex; Microsoft uses this internally. In addition to the registry keys above, we also set a version-dependent registry value listed below.
Key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\VS\Servicing\10.0
Name SP
Type REG_DWORD (32-bit integer)
Data 0x00000001 (1)
Keep in mind, however, that as with all shared resources the more shared a resource is the less accurate it may be. This is because there is no version policy for registry values and other resources that do not have versions like text files. If two languages were installed at different servicing pack levels – which is unsupported but possible – the value would be set by the last product to be installed or reinstalled (repaired).
For more information, see the Visual Studio 2010 detection system requirements. This also includes information to use the CompLocator in your Windows Installer package as an alternative to registry detection.
To detect which Visual Studio version a (multi-IDE) add-in is running under, you can use the EnvDTE.DTE.RegistryRoot property, which can return the following values:
For Visual Studio 2005: Software\Microsoft\VisualStudio\8.0
For Visual Studio 2008: Software\Microsoft\VisualStudio\9.0
To detect the edition and subedition of the Visual Studio IDE you can use the IVsShell interface, calling its GetProperty method with the Microsoft.VisualStudio.Shell.Interop.__VSSPROPID2.VSSPROPID_SKUEdition and Microsoft.VisualStudio.Shell.Interop.__VSSPROPID2.VSSPROPID_SubSKUEdition values.
Note: To get a service from an add-in, see HOWTO: Get a Visual Studio service from an add-in; and to know how to reference an assembly from the GAC (such as Microsoft.VisualStudio.Shell.Interop.dll), see HOWTO: Reference a Visual Studio assembly in the GAC from an add-in.
The returned results are not well documented but some values are provided in the following sample add-in:
Imports System
Imports Microsoft.VisualStudio.CommandBars
Imports Extensibility
Imports EnvDTE
Imports System.Runtime.InteropServices
Imports Microsoft.VisualStudio.Shell.Interop
Imports System.Windows.Forms
<ComVisible(True), ComImport(), Guid("6D5140C1-7436-11CE-8034-00AA006009FA"), _
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _
Friend Interface IServiceProvider
<PreserveSig()> _
Function QueryService(<InAttribute()> ByRef guidService As Guid, _
<InAttribute()> ByRef riid As Guid, <OutAttribute()> ByRef ppvObject As IntPtr) As Integer
End Interface
Public Class Connect
Implements IDTExtensibility2
Private Enum SKUEdition
SKUEdition_None = 0
SKUEdition_Express = 500
SKUEdition_Standard = &H3E8
SKUEdition_Professional = &H7D0
SKUEdition_AcademicProfessional = &H834
SKUEdition_AcademicStudent = &H834
SKUEdition_AcademicStudentMSDNAA = &H898
SKUEdition_AcademicEnterprise = &H8FC
SKUEdition_Book = &H960
SKUEdition_DownloadTrial = &H9C4
SKUEdition_Enterprise = &HBB8
End Enum
Private Enum SubSKUEdition
SubSKUEdition_None = &H0
SubSKUEdition_VC = &H1
SubSKUEdition_VB = &H2
SubSKUEdition_CSharp = &H4
SubSKUEdition_Architect = &H8
SubSKUEdition_IDE = &H10
SubSKUEdition_JSharp = &H20
SubSKUEdition_Web = &H40
SubSKUEdition_TeamEditionDevelopers = &H80
End Enum
Public Function GetService(ByVal serviceProvider As Object, ByVal type As System.Type) As Object
Return GetService(serviceProvider, type.GUID)
End Function
Public Function GetService(ByVal serviceProvider As Object, ByVal guid As System.Guid) As Object
Dim objService As Object = Nothing
Dim objIServiceProvider As IServiceProvider
Dim objIntPtr As IntPtr
Dim hr As Integer
Dim objSIDGuid As Guid
Dim objIIDGuid As Guid
objSIDGuid = guid
objIIDGuid = objSIDGuid
objIServiceProvider = CType(serviceProvider, IServiceProvider)
hr = objIServiceProvider.QueryService(objSIDGuid, objIIDGuid, objIntPtr)
If hr <> 0 Then
System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr)
ElseIf Not objIntPtr.Equals(IntPtr.Zero) Then
objService = System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(objIntPtr)
System.Runtime.InteropServices.Marshal.Release(objIntPtr)
End If
Return objService
End Function
Public Sub OnConnection(ByVal Application As Object, ByVal ConnectMode As Extensibility.ext_ConnectMode, _
ByVal AddInInst As Object, ByRef custom As System.Array) _
Implements Extensibility.IDTExtensibility2.OnConnection
Dim objDTE As DTE
Dim objService As Object
Dim objIVsShell As IVsShell
Dim objValue As Object = Nothing
Dim eSKUEdition As SKUEdition
Dim eSubSKUEdition As SubSKUEdition
Select Case ConnectMode
Case ext_ConnectMode.ext_cm_AfterStartup, ext_ConnectMode.ext_cm_Startup
objDTE = DirectCast(Application, DTE)
objService = GetService(objDTE, GetType(IVsShell))
objIVsShell = CType(objService, IVsShell)
If objIVsShell.GetProperty(__VSSPROPID2.VSSPROPID_SKUEdition, objValue) = 0 Then
eSKUEdition = CType(objValue, SKUEdition)
MessageBox.Show(eSKUEdition.ToString)
End If
If objIVsShell.GetProperty(__VSSPROPID2.VSSPROPID_SubSKUEdition, objValue) = 0 Then
eSubSKUEdition = CType(objValue, SubSKUEdition)
MessageBox.Show(eSubSKUEdition.ToString)
End If
End Select
End Sub
Public Sub OnAddInsUpdate(ByRef custom As System.Array) _
Implements Extensibility.IDTExtensibility2.OnAddInsUpdate
End Sub
Public Sub OnBeginShutdown(ByRef custom As System.Array) _
Implements Extensibility.IDTExtensibility2.OnBeginShutdown
End Sub
Public Sub OnDisconnection(ByVal RemoveMode As Extensibility.ext_DisconnectMode, _
ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnDisconnection
End Sub
Public Sub OnStartupComplete(ByRef custom As System.Array) _
Implements Extensibility.IDTExtensibility2.OnStartupComplete
End Sub
End Class
To detect whether a specific Visual Studio package is installed or not, you can use the IsPackageInstalled method of the IVsShell interface, which receives the Guid of the package.
Detecting installed Visual Studio Service Packs
Visual Studio uses the following Windows registry entries to track the installed service packs for the several versions (2005, 2008), editions (Standard, Professional, etc.) and languages (English, Spanish, etc.):
HKEY_LOCAL_MACHINE\Software\Microsoft\DevDiv\VS\Servicing\<version>\<edition>\<localeId>
where <version> and <edition> where explained in a previous section of this article and <localeId> is 1033 for English, 3082 for Spanish, etc.
For example, when Visual Studio 2005 Team Edition for Developers has SP1 installed, the value of the "SP" registry entry of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\VS\Servicing\8.0\VSTD\1033 is set to 1.
To know the service at general level (without taking into account the edition and language) you can use the "SP" registry entry under the registry key:
HKEY_LOCAL_MACHINE\Software\Microsoft\DevDiv\VS\Servicing\<version>
关于visual-studio - 检测 Visual Studio 许可证类型/分发 channel ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10020421/
这是一个与 Get OS-Version in WinRT Metro App C# 相关的问题但不是它的重复项。 是否有任何选项可以从 Metro 应用程序检测系统上是否有可用的桌面功能?据我所知,
我想在闹钟响起时做点什么。例如, toast 或设置新闹钟。我正在寻找可以检测闹钟何时响起的东西。首先,我在寻找广播 Action ,但找不到。也许是我的错? 当闹钟响起时,还有其他方法可以做些什么吗
如果某个 JS 添加了一个突变观察者,其他 JS 是否有可能检测、删除、替换或更改该观察者?我担心的是,如果某些 JS 旨在破坏某些 DOM 元素而不被发现,那么 JS 可能想要摆脱任何观察该 DOM
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想要改善这个问题吗?更新问题,以便将其作为on-topi
有没有办法在您的 Activity/应用程序中(以编程方式)知道用户已通过 USB 将您的手机连接到 PC? 最佳答案 有人建议使用 UMS_CONNECTED自最新版本的 Android 起已弃用
我正在想办法测量速度滚动事件,这将产生某种代表速度的数字(相对于所花费的时间,从滚动点 A 到点 B 的距离)。 我欢迎任何以伪代码形式提出的建议...... 我试图在网上找到有关此问题的信息,但找不
某些 JavaScript 是否可以检测 Skype 是否安装? 我问的原因是我想基于此更改链接的 href:如果未安装 Skype,则显示一个弹出窗口,解释 Skype 是什么以及如何安装它,如果已
我们正在为 OS X 制作一个使用 Quartz Events 移动光标的用户空间设备驱动程序,当游戏(尤其是在窗口模式下运行的游戏)无法正确捕获鼠标指针时,我们遇到了问题(= 将其包含/保留在其窗口
我可以在 Controller 中看到事件 $routeChangeStart,但我不知道如何告诉 Angular 留下来。我需要弹出类似“您要保存、删除还是取消吗?”的信息。如果用户选择取消,则停留
我正在解决一个问题,并且已经花了一些时间。问题陈述:给你一个正整数和负整数的数组。如果索引处的数字 n 为正,则向前移动 n 步。相反,如果为负数(-n),则向后移动 n 步。假设数组的第一个元素向前
我试图建立一个条件,其中 [i] 是 data.length 的值,问题是当有超过 1 个值时一切正常,但当只有 1 个值时,脚本不起作用。 out.href = data[i].hr
这是我的问题,我需要检测图像中的 bolt 和四分之一,我一直在搜索并找到 OpenCV,但据我所知它还没有在 Java 中。你们打算如何解决这个问题? 最佳答案 实际上有一个 OpenCV 的 Ja
是否可以检测 ping? IE。设备 1 ping 设备 2,我想要可以在设备 2 上运行的代码,该代码可以在设备 1 ping 设备时进行检测。 最佳答案 ping 实用程序使用的字面消息(“ICM
我每天多次运行构建脚本。我的感觉是我和我的同事花费了大量时间等待这个脚本执行。现在想知道:我们每天花多少时间等待脚本执行? .我可以对总体平均值感到满意,即使我真的很想拥有每天的数据(例如“上周一我们
我已经完成了对项目的编码,但是当我在客户端中提交了源代码时,就对它进行了测试,然后检测到内存泄漏。我已经在Instruments using Leaks中进行了测试。 我遇到的问题是AVPlayer和
我想我可以用 std.traits.functionAttributes 来做到这一点,但它不支持 static。对于任何类型的可调用对象(包含 opCall 的结构),我如何判断该可调用对象是否使用
我正在使用多核 R 包中的并行和收集函数来并行化简单的矩阵乘法代码。答案是正确的,但并行版本似乎与串行版本花费的时间相同。 我怀疑它仅在一个内核上运行(而不是在我的机器上可用的 8 个内核!)。有没有
我正在尝试在读取 csv 文件时编写一个这样的 if 语句: if row = [] or EOF: do stuff 我在网上搜索过,但找不到任何方法可以做到这一点。帮忙? 最佳答案 wit
我想捕捉一个 onFontSizeChange 事件然后做一些事情(比如重新渲染,因为浏览器已经改变了我的字体大小)。不幸的是,不存在这样的事件,所以我必须找到一种方法来做到这一点。 我见过有人在不可
我有一个使用 Windows 服务的 C# 应用程序,该服务并非始终打开,我希望能够在该服务启动和关闭时发送电子邮件通知。我已经编写了电子邮件脚本,但我似乎无法弄清楚如何检测服务状态更改。 我一直在阅
我是一名优秀的程序员,十分优秀!