向Visual Studio 2015添加先决条件

问题描述:

我想向Visual Studio 2015添加新的先决条件,但找不到解决方案:

I want to add new prerequisites to visual studio 2015 but can not find out the solution:

如您所见,Visual Studio 2015缺少必备组件Visual C ++ 2010运行时库(x86)和Windows Installer 3.1.我正在使用Windows 8.1,因此无法安装旧版本的Visual C ++运行时库(x86)和Windows Installer.

As you can see, the visual studio 2015 lack of Prerequisites Visual C++ 2010 Runtime Library (x86) and Windows Installer 3.1. I'm using windows 8.1 so i can not install the old version of Visual C++ Runtime Library (x86) and Windows Installer.

我遇到了同样的问题.您应该按照将Bootstrapper packages添加到Visual Studio 2015文件夹中的步骤进行操作.

I've run in the same problem. You should follow the steps for adding Bootstrapper packages into your Visual Studio 2015 folder.

我将解释我添加Microsoft C++ 2013 x86所使用的步骤(在您的情况下,这些步骤将是相似的).

I'll explain the step used by me to add Microsoft C++ 2013 x86 (the steps in your case would be similar).

首先导航到C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\文件夹(对于Visual Studio的早期版本或自定义路径,这可以有所不同).

First navigate to C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\ folder (for previous versions of Visual Studio or custom paths this can be different).

找到Packages文件夹后,您可以通过创建一个名为vc_redist_2013_x86的新文件夹(在您的情况下为vc_redist_2010_x86)开始. 从Microsoft网站下载Redistribution程序包,并将其放置在此文件夹中.您可以从此处和2010 x86下载2013版本从此处.

Once located the Packages folder you can start by creating a new folder called vc_redist_2013_x86 (in your case vc_redist_2010_x86). Download the Redistribution package from Microsoft site and place it in this folder. You can download the 2013 version from here and 2010 x86 from here.

现在将文件从vcredist_x86复制到您的文件夹(它应该是product.xml文件和带有package.xml文件的en文件夹).现在将其删除为只读标志,并在任何文本编辑器中打开.

Now copy the files from the vcredist_x86 to your folder (it should be a product.xml file and a en folder with a package.xml file). Now remove them the read-only flag and open in any text editor.

如果是product.xml,则应替换以下内容:

In case of the product.xml you should replace the following:

  • ProductCode转换为:"Microsoft.Visual.C ++.12.0.x86"(您将拥有C ++.10.0.x86)
  • PackageFile Name ="vcredist_x86.exe"将被命名为您从Microsoft网站下载的可执行文件.
  • PublicKey需要根据exe文件之一进行更改.为了找到它,您必须执行以下步骤:
    • 右键单击exe文件(在我的情况下为vcredist.exe)
    • 选择属性"
    • 选择数字签名"
    • 选择顶部签名(sha1)
    • 按详细信息"
    • 按查看证书"
    • 选择详细信息标签"
    • 选择公钥"
    • 从下面复制值,并在删除空格后获得搜索值
    • ProductCode to: "Microsoft.Visual.C++.12.0.x86" (you will have C++.10.0.x86)
    • PackageFile Name="vcredist_x86.exe" will be named as the executable file that you've downloaded from Microsoft site.
    • PublicKey needs to be changed according to the one of the exe file. In order to find it you have to do the following steps:
      • right click the exe-file (in my case vcredist.exe)
      • choose 'properties'
      • select 'digital-signatures'
      • select the top signature (sha1)
      • press 'Details'
      • press 'View Certificate'
      • select 'Details tab'
      • select 'Public Key'
      • copy value from below and after removing spaces you have the searched value

      保存文件并移至package.xml文件.在这里,您必须将"Visual C ++"14"替换为您使用的版本.我将其替换为"Microsoft Visual C ++ 2013 Redistributable(x86)".

      Save file and move to the package.xml file. Here you have to replace the 'Visual C++ "14"' to your used version. I replaced it with 'Microsoft Visual C++ 2013 Redistributable (x86)'.

      完成此步骤后.您应该能够在Visual Studio 2015的先决条件"列表下看到Microsoft Visual C++ 2013 Redistributable (x86).

      Once this steps done. You should be able to see the Microsoft Visual C++ 2013 Redistributable (x86) under the Prerequisites list in your Visual Studio 2015.

      如果您需要在其上工作的模型,我将在下面发布两个文件.

      I'll post the two files below in case you need a model on which to work on.

      Product.xml

      <Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="Microsoft.Visual.C++.12.0.x86">
      
        <!-- Defines list of files to be copied on build -->
        <PackageFiles CopyAllPackageFiles="false">
          <PackageFile Name="vcredist_x86.exe" HomeSite="VCRedistExe" PublicKey="3082010a028201010096715ded0646fa84cb9d5bb746c7b0e1b4113903adb11573609ceba7b66e1a3c3fff65e334f1a6a5215e56996c58e492a10a5cc2d3dc522f0c659a20614053319c6c8f217dbaf9fe13505260953a5bb958a5746141a994e0ad264e4ca1977049275e7c67ca4f1e718446bc1d4bb6e20fc5c627c907e67a0aa51700194c7045382d81b450aac567d1fa79bcc5cca1729bf4253498f854df123938122fa46ba59a7ec762d1dccfed3d34f8b9df3530baec7932a9e1a9ac554d4c7f4c56c3130b76f107f9cc47acfb88d552a51e28fa3d2dcfcf849886716511cf85c9094486e16fe7b1fcac4044a5a98b233f82499dd596595013591873ff430cad2bd47f3040670203010001" />
        </PackageFiles>
      
        <InstallChecks>
          <MsiProductCheck Property="VCRedistInstalled" Product="{f65db027-aff3-4070-886a-0d87064aabb1}"/>
        </InstallChecks>
      
        <!-- Defines how to invoke the setup for the Visual C++ 14.0 redist -->
        <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 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>
      

      Package.xml

      <Package
          xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
          Name="DisplayName"
          Culture="Culture"
          >
      
          <!-- Defines a localizable string table for error messages-->
          <Strings>
              <String Name="DisplayName">Microsoft Visual C++ 2013 Redistributable (x86)</String>
              <String Name="Culture">en</String>
              <String Name="AdminRequired">You do not have the permissions required to install Microsoft Visual C++ 2013 Redistributable (x86). Please contact your administrator.</String>
              <String Name="InvalidPlatformWin9x">Installation of Microsoft Visual C++ 2013 Redistributable (x86) is not supported on Windows 95. Contact your application vendor.</String>
              <String Name="InvalidPlatformWinNT">Installation of Microsoft Visual C++ 2013 Redistributable (x86) is not supported on Windows NT 4.0. Contact your application vendor.</String>
              <String Name="GeneralFailure">A failure occurred attempting to install Microsoft Visual C++ 2013 Redistributable (x86).</String>
              <String Name="VCRedistExe">http://go.microsoft.com/fwlink/?LinkID=800028&amp;clcid=0x409</String>
          </Strings>
      
      </Package>
      

      希望它会有所帮助,并且很容易遵循这一漫长的过程.

      Hope it helps and it is easy to follow this long process.