wpf 如何安装微软?表面?2.0 SDK 无需安装 Visual Studio

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21702121/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 10:47:50  来源:igfitidea点击:

How to install Microsoft? Surface? 2.0 SDK without installing Visual Studio

wpfvisual-studio-2010pixelsense

提问by GibboK

I have a kiosk application build on Microsoft? Surface? 2.0 SDKand WPF.

我有一个基于Microsoft的自助服务终端应用程序表面?2.0 SDK和 WPF。

The device for deployment is a kiosk and Visual Studio is not installed.

部署设备是自助服务终端,未安装 Visual Studio。

When running the application on the kiosk I miss some dlls Microsoft.Surface.Core, so I tried to install Microsoft? Surface? 2.0 SDK but it require VS.

在自助服务终端上运行应用程序时,我错过了一些 dll Microsoft.Surface.Core,所以我尝试安装 Microsoft?表面?2.0 SDK 但它需要 VS。

Error:

错误:

You must install Microsoft Visual Studio 2010 or Microsoft Visual C# 2010 express before you install Microsoft Surface 2.0 sdk.

在安装 Microsoft Surface 2.0 sdk 之前,您必须安装 Microsoft Visual Studio 2010 或 Microsoft Visual C# 2010 express。

I would like to know a work around in order to install SDK without having VS... or an alternative approach?

我想知道一种解决方法,以便在没有 VS 的情况下安装 SDK ......或其他方法?

回答by jessehouwing

The SDK requires Visual Studio, but the runtime does not. Download the runtime components from the same location you've probably downloaded the SDK from.

SDK 需要 Visual Studio,但运行时不需要。从您可能从 下载 SDK 的同一位置下载运行时组件

enter image description here

在此处输入图片说明

When you click download you have the option to just download the runtime installer.

单击下载时,您可以选择只下载运行时安装程序。

回答by sba

Try this:

尝试这个:

  1. install the XNA Game Framework Runtime 4.0 first (xnafx40_redist.msi)
  2. Use the following PS code instead of my original version:
  1. 首先安装 XNA Game Framework Runtime 4.0 (xnafx40_redist.msi)
  2. 使用以下 PS 代码代替我的原始版本:
foreach ($base in @('HKLM:\Software\Microsoft\VisualStudio', 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio')) {

cd $base
mkdir 10.0
cd 10.0                                                                                                          
mkdir Setup                                                                                                       
mkdir Setup\VS                                                                                                    
cd Setup\VS                                                                                                       
New-ItemProperty -path . -Name EnvironmentPath -PropertyType String -Value d:\DummyVS10                           
mkdir d:\DummyVS10   
cd "$base.0"                                                                                             
mkdir Projects
cd Projects                                                                                                    
mkdir '{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}'                                                                    
cd '{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}'                                                                       
New-ItemProperty -path . -Name DefaultProjectExtension -PropertyType String -Value foo
cd "$base"                                                                                             
mkdir SxS
cd SxS
mkdir VS7
cd VS7
mkdir 10.0
cd "$base.0"
New-ItemProperty -path . -Name InstallDir -PropertyType String -Value D:\DummyVS10
}

回答by sba

I managed to install the Surface 2.0 SDK on my machine that only has VS2013 installed.

我设法在我只安装了 VS2013 的机器上安装了 Surface 2.0 SDK。

Of course, this is not a supported scenario ;-)... so use at your own risk!

当然,这不是受支持的方案 ;-)... 所以使用风险自负!

I checked the MSI for how they detect the presence of VS2010, and just added two dummy registry entries, as follows (from a "run as administrator" PowerShell prompt):

我检查了 MSI 以了解它们如何检测 VS2010 的存在,并添加了两个虚拟注册表项,如下所示(来自“以管理员身份运行”PowerShell 提示符):

cd HKLM:\Software\Microsoft\VisualStudio                                                                          
# 10.0 was already present on my machine, might need to be created 
cd 10.0                                                                                                          
mkdir Setup                                                                                                       
mkdir Setup\VS                                                                                                    
cd Setup\VS                                                                                                       
New-ItemProperty -path . -Name EnvironmentPath -PropertyType String -Value d:\DummyVS10                           
mkdir d:\DummyVS10                                                                                                
mkdir Projects                                                                                                    
mkdir '{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}'                                                                    
cd '{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}'                                                                       
New-ItemProperty -path . -Name DefaultProjectExtension -PropertyType String -Value foo

Once these entries exist, the installer runs like a charm, and I can build my VS2013 solution that references the Surface SDK!

一旦这些条目存在,安装程序就会像魅力一样运行,我可以构建引用 Surface SDK 的 VS2013 解决方案!

回答by j_schultz

If the previous answers do not work for you, you can edit the MSI file with SuperOrca to remove the offending checks from the "LaunchCondition" folder. They are easily identifiable by their error messages in the second column.

如果之前的答案对您不起作用,您可以使用 SuperOrca 编辑 MSI 文件以从“LaunchCondition”文件夹中删除违规检查。通过第二列中的错误消息很容易识别它们。