【问题标题】:Visual C++ 14 redist package prerequisite - configure from visual studio setup projVisual C++ 14 redist 软件包先决条件 - 从 Visual Studio 安装程序配置
【发布时间】:2016-06-11 11:03:49
【问题描述】:

我有一个 Visual Studio 安装项目,它安装了一个需要 VC++ 14 Redist 包的 x64 程序。

我根据图片选择了选项并在里面创建了一个文件夹结构:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages

我创建了 vcredist_x64 文件夹,其中包含:

vcredist_x64.exe
product.xml
en folder

在我的文件夹内:

package.xml

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.x64"
  >

  <!-- Defines list of files to be copied on build -->
  <PackageFiles>
  <PackageFile Name="vcredist_x64.exe" HomeSite="VCRedistExe"/>
  </PackageFiles>
  <InstallChecks>
    <MsiProductCheck Property="VCRedistInstalled" Product="{e46eca4f-393b-40df-9f49-076faf788d83}"/>
   </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>

en\package.xml 的内容:

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

<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">Visual C++ "14" Runtime Libraries (x64)</String>
        <String Name="Culture">en</String>
        <String Name="AdminRequired">You do not have the permissions required to install Visual C++  Runtime Libraries (x64). Please contact your administrator.</String>
        <String Name="InvalidOS">Installation of Visual C++  Runtime Libraries (x64) is supported only on x64 machines.</String>
        <String Name="GeneralFailure">A failure occurred attempting to install Visual C++  Runtime Libraries (x64).</String>
          <String Name="VCRedistExe">http://go.microsoft.com/fwlink/?LinkID=210622&amp;clcid=0x409</String>
     </Strings>

    </Package>

当我构建安装项目时,它没有给出任何错误。

最初,当我没有那个文件夹结构以及 xmls 时,我在构建时遇到了错误:

enable 'Download prerequisites from the same location as my application'   in the Prerequisites dialog box, you must download file 'vcredist_x64\vcredist_x64.exe' for item 'Visual C++ "14" Runtime Libraries (x64)' to your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=616018.

但是我现在没有错误。问题是它没有安装 VC 可再发行依赖项。

我认为 xml 中的 productcode 和其他参数不正确。此外,VCRedistExe 链接适用于 VC++2010,但在安装过程中不会下载任何内容。但是请注意,我的文件夹结构中有 vcredist_x64.exe,即 VC++14 redist。

请帮助我,因为我也尝试了许多其他选项,但这个“官方”选项似乎不起作用(我找不到 Visual C++ Redistributable for Visual Studio 2015 的相关信息)。

只要安装了先决条件,任何一个选项都适合我(从网站下载或从与我的应用相同的位置下载)。

【问题讨论】:

  • 在 Windows 8 上使用 Visual Studio 2015。

标签: installation vcredist


【解决方案1】:
【解决方案2】:

对于 32 位操作系统,请使用 regedit 检查此注册表项 HKLM\Software\Microsoft\GenericBootstrapper\

对于 64 位操作系统, HKLM\Software\Wow6432Node\Microsoft\GenericBootstrapper

路径值是您需要放置可再发行组件的位置。

例如,如果你想放置你的 VC++ 64 位可再发行组件(vc_redist.x64.exe)..

如果路径值中的位置是“C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\”,

将 vc_redist.x64.exe 文件放在“C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vc_redistx64\”中。

重建项目,现在可以正常工作了

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多