我最近安装了vs2012
我已经更新了我的 ClickOnce 应用程序。更准确地说,是我第一次打开我的C++ project
(这取决于我的主要 c# 项目)我还没有更新它,一切都工作正常。 VS 2012
仍然能够看到 Visual C++ 2010 先决条件。后来我通过将平台工具集更改为"Visual Studio 2012 (v110)"
来更新我的项目下Properties->Configuration Properties->General
.
与此同时,我还安装了其他 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 Studio 2010 一起安装的),而我缺少 Visual C++ 2012 文件。因此我认为 Visual C++ 2012 没有与 Visual Studio 2012 结合在一起,不是吗?我什至尝试安装 Visual C++ 2012 Redistributable x64通过下载它们来安装软件包,现在它们列在我安装的程序中(8仅是可再发行版本,而不是运行时版本)。
但是,仍然缺少先决条件。我该如何解决这个问题?我什至考虑过手动复制 Visual C++ 2010 的 Bootstrap 包,位于... \v7.0A\Bootstrapper\Packages
文件夹并为 C++ 2012 手动更改它,但我不知道应该在 product.xml
中写什么下<MsiProductCheck Property="VCRedistInstalled" Product=?>
。似乎可以使用 Bootstrapper Manager 获取插入此信息的产品 GUID,但该程序抛出很多异常,我不知道该怎么做。作为第二种解决方案,只需从 \\v7.0A\Bootstrapper\Packages\Bootstrapper\Packages to \v8.0A\Bootstrapper\Packages
复制 Visual C++ 2010 的包是安全的。 ?
最佳答案
转至\v8.0A\Bootstrapper\Packages 并确保您拥有 vcredist_x86 文件夹。
在该文件夹中,您应该有一个“en”文件夹,该文件夹应该保留在那里,但您丢失了
- 产品.xml
- vcredist_x86.exe
您可以从http://go.microsoft.com/fwlink/?LinkID=266495&clcid=0x409下载所需的.exe
至于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>
关于visual-studio-2012 - Visual Studio 2012 中缺少 Visual C++ 的先决条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14497382/