我想新的前提條件添加到Visual Studio 2015,但不能找出解決辦法: 添加先決條件到Visual Studio 2015
正如你所看到的,在Visual Studio 2015沒有先決條件的Visual C++ 2010運行時庫(x86)和Windows Installer 3.1。我使用的是Windows 8.1,因此我無法安裝舊版本的Visual C++運行時庫(x86)和Windows Installer。
我想新的前提條件添加到Visual Studio 2015,但不能找出解決辦法: 添加先決條件到Visual Studio 2015
正如你所看到的,在Visual Studio 2015沒有先決條件的Visual C++ 2010運行時庫(x86)和Windows Installer 3.1。我使用的是Windows 8.1,因此我無法安裝舊版本的Visual C++運行時庫(x86)和Windows Installer。
我在同一個問題中運行。您應該按照步驟將Bootstrapper packages
添加到您的Visual Studio 2015
文件夾中。
我會解釋一下我使用的步驟來添加Microsoft C++ 2013 x86
(您的案例中的步驟是相似的)。
首先導航到C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\
文件夾(對於以前版本的Visual Studio
或自定義路徑,這可以是不同的)。
一旦找到Packages
文件夾,您可以創建一個名爲vc_redist_2013_x86
的新文件夾(在您的案例中爲vc_redist_2010_x86
)。 從Microsoft站點下載重新分發包並將其放入此文件夾中。您可以從here和2010xxx從here下載2013版本。
現在將文件從vcredist_x86
複製到您的文件夾(它應該是一個product.xml文件和具有package.xml文件的en文件夾)。現在刪除它們的只讀標誌並在任何文本編輯器中打開。
在product.xml
的情況下,應替換以下:
{f65db027-aff3-4070-886a-0d87064aabb1}
,2010年的x86爲{1D5E3C0FEDA1E123187686FED06E995A}
。保存文件並移動到package.xml
文件。在這裏,您必須將'Visual C++'14''替換爲您使用的版本。我用'Microsoft Visual C++ 2013 Redistributable(x86)'替換了它。
一旦完成此步驟。您應該能夠在Visual Studio 2015
的先決條件列表下看到Microsoft Visual C++ 2013 Redistributable (x86)
。
我會發佈下面的兩個文件,以防您需要一個模型來處理。
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&clcid=0x409</String>
</Strings>
</Package>
希望它能幫助,很容易遵循這個漫長的過程。