Visual C ++ 2012运行时库Visual Studio 2010的先决条件

时间:2014-07-31 09:57:31

标签: c++ visual-studio-2010 visual-studio

我目前正在使用Visual Studio 2010 Professional,我想知道是否有任何方法可以将 Visual C ++ 2012运行时库添加到安装项目的先决条件中?

目前我只能选择 Visual C ++ 2010运行时库

我已经尝试了名为检查Microsoft Update以获取更多可再发行组件的链接(存在于先决条件配置屏幕上),但我被重定向到http://msdn.microsoft.com/en-us/vstudio/aa496123.aspx并且无法找到任何内容在Visual Studio 2010中添加该功能。

1 个答案:

答案 0 :(得分:0)

C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v7.0A \ Bootstrapper \ Packages 中创建 vcredist_x86(2012)文件夹,其结构如下:

+ vcredist_x86 (2012)
|     + en
|     |_  package.xml
|_  product.xml
|_  vcredist_x86.exe

<强> package.xml中

<?xml version="1.0" encoding="utf-8" ?>

<Package
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  Name="DisplayName"
  Culture="Culture"
>
    <Strings>
        <String Name="DisplayName">Visual C++ 2012 Runtime Libraries (x86)</String>
        <String Name="Culture">en</String>
        <String Name="AdminRequired">You do not have the permissions required to install Visual C++ 2012 Runtime Libraries (x86). Please contact your administrator.</String>
        <String Name="InvalidPlatformWin9x">Installation of Visual C++ 2012 Runtime Libraries (x86) is not supported on Windows 95. Contact your application vendor.</String>
        <String Name="InvalidPlatformWinNT">Installation of Visual C++ 2012 Runtime Libraries (x86) is not supported on Windows NT 4.0. Contact your application vendor.</String>
        <String Name="GeneralFailure">A failure occurred attempting to install Visual C++ 2012 Runtime Libraries (x86).</String>
    </Strings>
</Package>

<强> product.xml

<?xml version="1.0" encoding="utf-8" ?> 
<Product
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  ProductCode="Microsoft.Visual.C++.12.0.x86"
>
  <PackageFiles>
    <PackageFile Name="vcredist_x86.exe" HomeSite="VCRedistExe"/>
  </PackageFiles>

  <InstallChecks>
    <MsiProductCheck Property="VCRedistInstalled" Product="{DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}"/>
  </InstallChecks>

  <Commands Reboot="Defer">
    <Command PackageFile="vcredist_x86.exe" 
         Arguments=' /q:a ' 
         >

      <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"/>
      </InstallConditions>

      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <ExitCode Value="3010" Result="SuccessReboot"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>

    </Command>
  </Commands>
</Product>