visual-studio-2012 - Visual Studio 2012 中缺少 Visual C++ 的先决条件

标签 visual-studio-2012 clickonce prerequisites visual-c++-2012

我最近安装了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 x64x86安装了可再发行版本和运行时版本(我认为它们之前是与 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 获取插入此信息的产品 G​​UID,但该程序抛出很多异常,我不知道该怎么做。作为第二种解决方案,只需从 \\v7.0A\Bootstrapper\Packages\Bootstrapper\Packages to \v8.0A\Bootstrapper\Packages 复制 Visual C++ 2010 的包是安全的。 ?

最佳答案

转至\v8.0A\Bootstrapper\Packages 并确保您拥有 vcredist_x86 文件夹。

在该文件夹中,您应该有一个“en”文件夹,该文件夹应该保留在那里,但您丢失了

  1. 产品.xml
  2. 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/

相关文章:

installshield - 在 installshield 中添加先决条件

C# 应用程序 - 无法添加先决条件文件

visual-studio - 如何将 Visual Studio 2013 中的新字体更改回 2012

c++ - Unicode 与 MSVC++ 2012

unit-testing - 使用 NUnit 测试适配器进行单元测试失败,但使用 VS2012 中的 ReSharper 则不会

c++ - 使用 System.Diagnostics C++.Net 2003 fx1.1

GetOpenFileName 时出现 C++ WinAPI 错误

deployment - 单击一次应用程序回滚

clickonce - 签名的 ClickOnce 应用程序提供 "Publisher could not be verified"

c# - 我需要用法语创建 .net 4.0 部署设置