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

时间:2013-01-24 09:00:17

标签: 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,现在我发现我无法为我的ClickOnce发布项目添加Visual C ++先决条件。 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,Redistributable版本和Runtime版本(我认为它们之前安装在Visual Studio 2010中) ),而我错过了Visual C ++ 2012文件。因此,我认为Visual C ++ 2012没有与Visual Studio 2012结合在一起,不是吗?我甚至尝试通过下载它们来安装Visual C++ 2012 Redistributable x64软件包,现在它们已经在我安装的程序中列出,只有Redistributable,而不是Runtime版本。)

然而,先决条件仍然缺失。我怎么解决这个问题?我甚至考虑手动复制位于... \v7.0A\Bootstrapper\Packages文件夹中的Visual C ++ 2010的bootstrapper包,并为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包是安全的

2 个答案:

答案 0 :(得分:3)

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

在该文件夹中,您应该有一个“en”文件夹,该文件夹应保留在那里,您缺少

  1. product.xml
  2. 选择vcredist_x64.exe
  3. 您可以从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>
    

答案 1 :(得分: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>