.net - 在 XP 中安装 .Net 4 之前的 VS 2010 BootStrapper for WIC(Windows Imaging Component)

标签 .net setup-deployment bootstrapper visual-studio-setup-proje wic

我已经在 VS 2010 中为我的 .Net 4 应用程序创建了一个设置和部署项目。在我的先决条件中,我检查了 .Net4 先决条件,但我了解到 .Net4 遗漏了 WIC(Windows 成像组件)以使其更轻.

当我在 Vista/Win7 中运行我的安装程序时,Net4 安装不会给出 WIC 错误,但是当我在 XP 中安装它时,它会给出 WIC 错误。然后我必须先手动安装 WIC,然后运行我的设置。

我需要一个 WIC Bootstrap ,它在 XP 中安装 .Net4 之前运行。请建议如何完成或提供链接。提前致谢。

最佳答案

我很久以前就遇到过这个恼人的问题,并准确地写下了您需要的内容。我的 Bootstrap 在项目中使用了一年多 Grammatica .老实说,我在 pastebin 的某个地方找到了原始版本,但是它太大了并且包含一些错误,我给你我的最终版本。

对于懒惰的人,只需 DOWNLOAD THIS并将其解压缩到“%PROGRAMFILES(x86)%\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages”,然后重新启动 VS 并转到先决条件列表以查看那里的 Windows 成像组件。 如果链接失效:

<Product ProductCode="Windows.Imaging.Component" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
  <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="wic_x86.exe" HomeSite="http://download.microsoft.com/download/f/f/1/ff178bb1-da91-48ed-89e5-478a99387d4f/wic_x86_enu.exe" PublicKey="3082010a0282010100cd819638ae5ca2f2c1dfded0ab958dd63c9d1f8bc35d862e5df0b172f5abac886ab5dab1227b0bc8c8a54b915e2213e9f9f5239db5f46e76aeefeea43cc7c4c0595c3fabb3733326a662816179a162f46e8895d06eddc79fd2a451117661ba708a65a1961689a75d81d04466e5db569e40cafcdc76242e443000e5d67d7b9511d5581da3e84f0bc988dca2d653996cca63ca996a9a925e4c4d11e82fd35b5b5e5f52a3732da5bb84450d8c191576cb08da9aa67015e84dec69fd5db26b8fed295137388bc6464915945098b0f468a4d7de097167749e778c1d856b97eae75f45cce0e6710dd16300937b31988e0bb413bdb3d0eef1df21eea96061ee37433dc30203010001" />
    <PackageFile Name="wic_x64.exe" HomeSite="http://download.microsoft.com/download/6/4/5/645fed5f-a6e7-44d9-9d10-fe83348796b0/wic_x64_enu.exe" PublicKey="3082010a0282010100cd819638ae5ca2f2c1dfded0ab958dd63c9d1f8bc35d862e5df0b172f5abac886ab5dab1227b0bc8c8a54b915e2213e9f9f5239db5f46e76aeefeea43cc7c4c0595c3fabb3733326a662816179a162f46e8895d06eddc79fd2a451117661ba708a65a1961689a75d81d04466e5db569e40cafcdc76242e443000e5d67d7b9511d5581da3e84f0bc988dca2d653996cca63ca996a9a925e4c4d11e82fd35b5b5e5f52a3732da5bb84450d8c191576cb08da9aa67015e84dec69fd5db26b8fed295137388bc6464915945098b0f468a4d7de097167749e778c1d856b97eae75f45cce0e6710dd16300937b31988e0bb413bdb3d0eef1df21eea96061ee37433dc30203010001" />
  </PackageFiles>
  <InstallChecks>
    <FileCheck Property="VersionPMHdll32" FileName="PhotoMetadataHandler.dll" SearchPath="system32" SpecialFolder="WindowsFolder" />
    <FileCheck Property="VersionPMHdll64" FileName="PhotoMetadataHandler.dll" SearchPath="SysWOW64" SpecialFolder="WindowsFolder" />
  </InstallChecks>
  <Commands Reboot="Defer">
    <Command PackageFile="wic_x86.exe"
      Arguments="/quiet /norestart" 
      EstimatedInstalledBytes="1200000" 
      EstimatedTempBytes="3700000"
      EstimatedInstallSeconds="60">
      <InstallConditions>
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" />
        <BypassIf Property="VersionPMHdll32" Compare="VersionGreaterThanOrEqualTo" Value="6.0.5840.16388" />
        <BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="6.0.0" />
        <!-- Requires the user to be an admin user when installing the prerequisite -->
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
      </InstallConditions>
      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <ExitCode Value="1641" Result="SuccessReboot"/>
        <ExitCode Value="3010" Result="SuccessReboot"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>
    </Command>
    <Command PackageFile="wic_x64.exe"
      Arguments="/quiet /norestart" 
      EstimatedInstalledBytes="1200000" 
      EstimatedTempBytes="6400000"
      EstimatedInstallSeconds="60">
      <InstallConditions>
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="AMD64" />
        <BypassIf Property="VersionPMHdll64" Compare="VersionGreaterThanOrEqualTo" Value="6.0.5840.16388"/>
        <BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="6.0.0" />
        <!-- Requires the user to be an admin user when installing the prerequisite -->
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
      </InstallConditions>
      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <ExitCode Value="1641" Result="SuccessReboot"/>
        <ExitCode Value="3010" Result="SuccessReboot"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>
    </Command>
  </Commands>
</Product>

只需转到 %PROGRAMFILES(x86)%\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages, 创建一个名为 WIC 或 smth else 的文件夹,而不是将此 xml 放在那里并将其命名为“product.xml”,将“wic_x86_enu.exe” ' 在它附近,创建一个文件夹“en”并将这个“package.xml”放入其中:

<?xml version="1.0" encoding="utf-8"?>
<Package Name="DisplayName" Culture="Culture" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
  <Strings>
    <String Name="Culture">en</String>
    <String Name="DisplayName">Windows Imaging Component</String>
    <String Name="Anunexpectedexitcodewasr">An unexpected exit code was returned from the installer. The installation failed.</String>
  </Strings>
</Package>  

重新启动您的 Visual Studio,您将在先决条件列表中看到它。

注意:它仅在 .NET 安装需要时安装 WIC。如果系统不需要,它不会安装 WIC。它不会安装 .NET,只会安装 WIC。因此,为了安装 .NET 和 WIC(如果需要),只需添加两个先决条件(我的 WIC 和内置的 .NET)。

关于.net - 在 XP 中安装 .Net 4 之前的 VS 2010 BootStrapper for WIC(Windows Imaging Component),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9188274/

相关文章:

installation - 我需要一个 WIX Bootstrapper 项目来安装我的软件和先决条件

c# - 在 C# 中,枚举上的开关是否需要默认大小写?

c# - .NET Core NuGet 恢复因私有(private) NuGet 提要而失败(VSTS CI 构建)

visual-studio - Visual Studio找不到我的Azure订阅

vb.net-2010 - .net 框架启动的版本与 .net 框架 Bootstrap 项目不匹配

visual-studio-2010 - 带有空格和其他字符的 Wix 变量名称格式

c# - Visual Studio 2010的Bootstrapper Manifest Generator

.net - 智能单元测试: What's the right way to reference Microsoft. Pex.Framework.dll?

c# - 是否有一种简洁的内置方法可以通过索引获取列表项而不会引发异常?

tomcat - Tomcat 6 和 OpenEJB 3.1.4 中的 EJB 2.0 Jar