6

我最近安裝了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 x64x86,同時我還缺少了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的包是否安全?

回答

3

轉到\ v8.0A \ Bootstrapper \ Packages並確保您具有vcredist_x86文件夾。

在該文件夾,你應該有一個「連接」文件夾中,應該留在那裏,你缺少

  1. product.xml
  2. 選擇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> 
+0

謝謝你,怎麼樣vcredist_x64.exe? – Berezh

+0

Noam的回答是正確的,只是msbuild不喜歡兩個「xml version ...」行的副本。 我刪除了一個,我可以在腳本上運行msbuild來創建安裝文件。 –

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> 
相關問題