7

我最近安装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(只有 Redistributable,而不是运行时版本)。

然而,先决条件仍然缺失。我该如何解决这个问题?我什至考虑过手动复制位于...\v7.0A\Bootstrapper\Packages文件夹中的 Visual C++ 2010 的引导程序包,并为 C++ 2012 手动更改它,但我不知道应该product.xml<MsiProductCheck Property="VCRedistInstalled" Product=?>. 似乎可以使用 Bootstrapper Manager 获得插入此信息的产品 G​​UID,但是该程序抛出了很多异常,我不知道该怎么做。作为第二种解决方案,简单地从以下位置复制 Visual C++ 2010 的包是否安全\\v7.0A\Bootstrapper\Packages\Bootstrapper\Packages to \v8.0A\Bootstrapper\Packages

4

2 回答 2

3

转到 \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>
于 2013-08-15T08:20:12.290 回答
1

对于那些为 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>
于 2016-02-17T16:56:08.277 回答