简体   繁体   English

Visual Studio先决条件将安装已安装的程序包

[英]Visual Studio Prerequisites installs already installed packages

I am using VS 2015 where there is no prerequisite for Visual C++ Redistributable for visual studio 2012. So I created a custom bootstrapper and stored in the VS bootstrapping folder. 我使用的是VS 2015,Visual Studio 2012不需要Visual C ++可再发行组件。因此,我创建了一个自定义引导程序,并将其存储在VS引导文件夹中。

package.xml package.xml

<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>
        <String Name="VCRedistExe">https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x86.exe</String>

    </Strings>
</Package>

Here is the product.xml 这是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" PublicKey="3082010a0282010100e8af5ca2200df8287cbc057b7fadeeeb76ac28533f3adb407db38e33e6573fa551153454a5cfb48ba93fa837e12d50ed35164eef4d7adb137688b02cf0595ca9ebe1d72975e41b85279bf3f82d9e41362b0b40fbbe3bbab95c759316524bca33c537b0f3eb7ea8f541155c08651d2137f02cba220b10b1109d772285847c4fb91b90b0f5a3fe8bf40c9a4ea0f5c90a21e2aae3013647fd2f826a8103f5a935dc94579dfb4bd40e82db388f12fee3d67a748864e162c4252e2aae9d181f0e1eb6c2af24b40e50bcde1c935c49a679b5b6dbcef9707b280184b82a29cfbfa90505e1e00f714dfdad5c238329ebc7c54ac8e82784d37ec6430b950005b14f6571c50203010001" />
  </PackageFiles>

  <InstallChecks>
    <MsiProductCheck Property="VCRedistInstalled" Product="{6C772996-BFF3-3C8C-860B-B3D48FF05D65} "/>
  </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>

The setup downloads and installs the Visual c++ redistributable for visual studio 2012. But the problem is that even after it installs it, it I run the setup again it again downloads and tries to install the C++ redistribution. 该安装程序下载并安装了Visual Studio 2012的Visual c ++可再发行组件。但是问题是,即使安装了它,我也再次运行安装程序,再次下载并尝试安装C ++重新发行版。 I thin the problem lies in the product.xml . 我认为问题出在product.xml。 Any way to resolve this?? 有什么办法解决这个问题?

After small research I found that "Visual C++ 2012 Runtime Libraries (x86)" has version 11.0, not 12.0 as you mention. 经过少量研究,我发现“ Visual C ++ 2012运行时库(x86)”的版本为11.0,而不是您提到的12.0。 Try this in your product.xml: 在您的product.xml中尝试以下操作:

<Product
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  ProductCode="Microsoft.Visual.C++.11.0.x86"
>

Or see this answer if it still doesn't work: Missing prerequisites for Visual C++ in Visual Studio 2012 或者,如果仍然无法解决,请查看此答案: Visual Studio 2012中缺少Visual C ++的先决条件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM