在Visual Studio 2012中缺少Visual C++的先决条件
我最近安装了vs2012
,我更新了我的ClickOnce应用程序。更确切地说,我第一次打开我的C++ project
(其中取决于我的主要C#项目)我没有更新它,一切正常。 VS 2012
仍然能够看到Visual C++ 2010先决条件。稍后,我通过将平台工具集更改为"Visual Studio 2012 (v110)"
在Properties->Configuration Properties->General
下更新了我的项目。在Visual Studio 2012中缺少Visual C++的先决条件
与此同时,我甚至安装了其他software
,现在我发现我无法将Visual C++先决条件添加到我的ClickOnce发布项目中。 Visual C++ 2010 Runtime Libraries (x64)
先决条件标记为黄色三角形,并且缺失。理想情况下,我想更新到Visual C++ 2012 Runtime Libraries x64 (and x86)
,但即使这个先决条件不存在。
我想这是由于该文件夹C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages
相应的包中(vcredist_x64)
是空的。我也注意到,在控制面板中已安装程序的列表中,我安装了Microsoft Visual C++ 2010 x64
和x86
,同时我还缺少了Visual(可视化工作室版本)和Runtime版本(我认为他们以前安装有Visual Studio 2010) C++ 2012文件。因此我争辩说Visual C++ 2012并没有与Visual Studio 2012一起出现,不是吗?我甚至试图通过下载它们来安装Visual C++ 2012 Redistributable x64软件包,现在它们在我已安装的程序中仅列出可再发行组件,而不是运行版本。
但是前提条件仍然不存在。我该如何解决这个问题?我甚至想过手动复制位于... \v7.0A\Bootstrapper\Packages
文件夹中的Visual C++ 2010的引导程序包,并为C++ 2012手动更改它,但我不知道我应该在product.xml
下编写<MsiProductCheck Property="VCRedistInstalled" Product=?>
。看起来插入这些信息的产品GUID可以用Bootstrapper Manager获得,但是这个程序抛出了很多异常,我不知道该怎么做。作为第二种解决方案,从\\v7.0A\Bootstrapper\Packages\Bootstrapper\Packages to \v8.0A\Bootstrapper\Packages
简单复制Visual C++ 2010的包是否安全?
转到\ v8.0A \ Bootstrapper \ Packages并确保您具有vcredist_x86文件夹。
在该文件夹,你应该有一个“连接”文件夹中,应该留在那里,你缺少
- product.xml
- 选择vcredist_x64.exe
您也可以下载所需要的.exe自http://go.microsoft.com/fwlink/?LinkID=266495&clcid=0x409
至于product.xml
<?xml version="1.0" encoding="utf-8" ?>
<Product
xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
ProductCode="Microsoft.Visual.C++.11.0.x86"
>
<!-- Defines list of files to be copied on build -->
<PackageFiles>
<PackageFile Name="vcredist_x86.exe" HomeSite="VCRedistExe"/>
</PackageFiles>
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{6C772996-BFF3-3C8C-860B-B3D48FF05D65}"/>
</InstallChecks>
<!-- Defines how to invoke the setup for the Visual C++ 11.0 redist -->
<!-- TODO: Needs EstrimatedTempSpace, LogFile, and an update of EstimatedDiskSpace -->
<Commands Reboot="Defer">
<Command PackageFile="vcredist_x86.exe"
Arguments=' /q:a '
>
<!-- These checks determine whether the package is to be installed -->
<InstallConditions>
<BypassIf Property="VCRedistInstalled" Compare="ValueGreaterThanOrEqualTo" Value="3"/>
<!-- Block install if user does not have admin privileges -->
<FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
<!-- Block install on Win95 -->
<FailIf Property="Version9X" Compare="VersionLessThan" Value="4.10" String="InvalidPlatformWin9x"/>
<!-- Block install on NT 4 or less -->
<FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.00" String="InvalidPlatformWinNT"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<ExitCode Value="3010" Result="SuccessReboot"/>
<DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
</ExitCodes>
</Command>
</Commands>
</Product>
对于那些寻找2012 x64 vcredist类似的答案,这是我拼凑在一起,似乎工作。请注意,下载链接是 http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe
<?xml version="1.0" encoding="utf-8" ?>
<Product
xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
ProductCode="Microsoft.Visual.C++.11.0.x64"
>
<!-- Defines list of files to be copied on build -->
<PackageFiles>
<PackageFile Name="vcredist_x64.exe" HomeSite="VCRedistExe"/>
</PackageFiles>
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{CF2BEA3C-26EA-32F8-AA9B-331F7E34BA97}"/>
</InstallChecks>
<!-- Defines how to invoke the setup for the Visual C++ 11.0 redist -->
<!-- TODO: Needs EstimatedTempSpace, LogFile, and an update of EstimatedDiskSpace -->
<Commands Reboot="Defer">
<Command PackageFile="vcredist_x64.exe"
Arguments=' /q:a '
>
<!-- These checks determine whether the package is to be installed -->
<InstallConditions>
<BypassIf Property="VCRedistInstalled" Compare="ValueGreaterThanOrEqualTo" Value="3"/>
<!-- Block install if user does not have admin privileges -->
<FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
<!-- Block install on any platform other than x64 -->
<FailIf Property="ProcessorArchitecture" Value="AMD64" Compare="ValueNotEqualTo" String="InvalidOS"/>
<!-- Block install on Vista or below -->
<FailIf Property="VersionNT" Compare="VersionLessThan" Value="6.00" String="InvalidPlatformWinNT"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<ExitCode Value="3010" Result="SuccessReboot"/>
<DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
</ExitCodes>
</Command>
</Commands>
</Product>
谢谢你,怎么样vcredist_x64.exe? – Berezh
Noam的回答是正确的,只是msbuild不喜欢两个“xml version ...”行的副本。 我删除了一个,我可以在脚本上运行msbuild来创建安装文件。 –