如何为ClickOnce应用程序设置Windows Installer 4.5的引导程序包?

时间:2017-01-17 07:33:34

标签: .net winforms clickonce

Prerequisites标签上的Publish,我选择Download prerequisites from the same location as my application选项。

发布时出错,给了我以下指示:

  

启用'从与我相同的位置下载先决条件   在“先决条件”对话框中,您必须下载文件   项目'Windows的'WindowsInstaller4_5 \ Windows6.0-KB958655-v2-x86.MSU'   安装程序4.5'到您的本地计算机。有关更多信息,请参阅   http://go.microsoft.com/fwlink/?LinkId=616018

知识库文章说要打开Package.xml中语言文件夹(en)中的WindowsInstaller4_5文件,然后

  

找到包含http://go.microsoft.com/fwlink的Name元素,   并复制URL。包括LinkID部分

但是package.xml文件没有http://go.microsoft.com/fwlink的任何条目!其他bootstrapper文件夹在package.xml文件中有此条目,但不包含WindowsInstaller4_5

是否有其他人成功添加了Windows Installer 4.5软件包?你是怎么成功的?

我在Windows 10上使用VS2015。

3 个答案:

答案 0 :(得分:4)

除了操作系统(我在我的deverloper机器上赢得8.1),我的情况几乎和你一样。

您的问题听起来像某人(某人)弄乱了您的product.xml文件。

在下面找到所述文件的原始内容,这对我来说非常有用。

注意

  

在编辑文件之前,请确保备份原始文件!

     

Rootfolder - > C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ SDK \ Bootstrapper \ Packages \ WindowsInstaller4_5

<强> Filecontent

<?xml version="1.0" encoding="utf-8" ?>
<!-- Windows Installer 4.5 VS Bootstrapper : product.xml : Language neutral information -->
<Product
    xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
    ProductCode="Microsoft.Windows.Installer.4.5">
  <!-- The package does not contain an IncludesProduct element for Windows Installer 3.1. -->
  <!-- This ommision is by design in order to achive a specific sequencing of bootstrapper packages -->
  <!-- to reduce the number of potential reboots under certain conditions. -->

  <!-- Defines list of files to be copied on build -->
  <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="WindowsXP-KB942288-v3-x86.exe" HomeSite="Msi45XPx86exe"
                 PublicKey="3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001"/>
    <PackageFile Name="WindowsXP-KB958655-v2-x86-ENU.exe" HomeSite="Msi45UpdateXPx86exe"
                 PublicKey="3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001"/>
    <PackageFile Name="WindowsServer2003-KB942288-v4-x86.exe" HomeSite="Msi452K3x86exe"
                 PublicKey="3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001"/>
    <PackageFile Name="WindowsServer2003-KB958655-v2-x86-ENU.exe" HomeSite="Msi45Update2K3x86exe"
                 PublicKey="3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001"/>
    <PackageFile Name="WindowsServer2003-KB942288-v4-x64.exe" HomeSite="Msi45XP2K3x64exe"
                 PublicKey="3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001"/>
    <PackageFile Name="WindowsServer2003.WindowsXP-KB958655-v2-x64-ENU.exe" HomeSite="Msi45UpdateXP2K3x64exe"
                 PublicKey="3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001"/>
    <PackageFile Name="Windows6.0-KB958655-v2-x86.MSU" HomeSite="Msi45Vistax86msu"
                 PublicKey="3082010a0282010100bd3fd09234a458fda782a9fe41d4ba38708cf6307f3aa5780711ae2441263938cf7b39608fc5bf6b62cb70b5c933f3dd5de42ed7ba6739a4eeb784ee293a4e2e80d161e99a33b71a44d92ac78423059e42c50d77a92ac932bdd5cd4d47809ca376716519ff1e9eff947b20b1079ccd5d837469cd9ddf9504c24270fd8ad8db20f255c4f436c0c4f6a365b2dac139a35644f6e763149c4d43d952d2fbb44bb04d13f370289a7be16c27b9bfdfdd16905d60f8fe2744d9a4bc89d272c73fcd41cf8269926a511f43e5159294f0f5e471c6d90f4b79d04d832012590c9334205c629dd9e45c601a0cf9c802f7a184861d62847ae87cd6c6474fc7ed79837faa12f90203010001"/>
    <PackageFile Name="Windows6.0-KB958655-v2-x64.MSU" HomeSite="Msi45Vistax64msu"
                 PublicKey="3082010a0282010100bd3fd09234a458fda782a9fe41d4ba38708cf6307f3aa5780711ae2441263938cf7b39608fc5bf6b62cb70b5c933f3dd5de42ed7ba6739a4eeb784ee293a4e2e80d161e99a33b71a44d92ac78423059e42c50d77a92ac932bdd5cd4d47809ca376716519ff1e9eff947b20b1079ccd5d837469cd9ddf9504c24270fd8ad8db20f255c4f436c0c4f6a365b2dac139a35644f6e763149c4d43d952d2fbb44bb04d13f370289a7be16c27b9bfdfdd16905d60f8fe2744d9a4bc89d272c73fcd41cf8269926a511f43e5159294f0f5e471c6d90f4b79d04d832012590c9334205c629dd9e45c601a0cf9c802f7a184861d62847ae87cd6c6474fc7ed79837faa12f90203010001"/>
  </PackageFiles>

  <InstallChecks>
    <FileCheck Property="VersionMsiDll" FileName="msi.dll" SearchPath="System32" SpecialFolder="WindowsFolder" />
  </InstallChecks>
  <!-- Defines how to invoke the setup for the Windows installer 4.5 redist -->
  <Commands Reboot="Immediate">
    <!-- Defines installation command for:
                  Windows XP Service Pack 2 and later
                  on x86 platform -->
    <Command PackageFile="WindowsXP-KB942288-v3-x86.exe"
             Arguments= "/quiet /norestart"
             EstimatedInstalledBytes="3327000"
             EstimatedInstallSeconds="120" >
      <InstallConditions>
        <BypassIf Property="VersionMsi" Compare="VersionGreaterThanOrEqualTo" Value="4.5" />
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" />
        <BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="5.2.0" />
        <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
        <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.1.2" String="InvalidPlatform"/>
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
      </InstallConditions>
      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <!-- Defer reboot until MSI 4.5 update below -->
        <ExitCode Value="1641" Result="Success"/>
        <ExitCode Value="3010" Result="Success"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>
    </Command>

    <Command PackageFile="WindowsXP-KB958655-v2-x86-ENU.exe"
             Arguments= "/quiet /norestart"
             EstimatedInstalledBytes="1506160"
             EstimatedInstallSeconds="120" >
      <InstallConditions>
        <BypassIf Property="VersionMsiDll" Compare="VersionGreaterThanOrEqualTo" Value="4.5.6001.22299" />
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" />
        <BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="5.2.0" />
        <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
        <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.1.2" String="InvalidPlatform"/>
        <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>

    <!-- Defines installation command for:
                  Windows 2003 Service Pack 1 or later
                  on x86 platform -->
    <Command PackageFile="WindowsServer2003-KB942288-v4-x86.exe"
             Arguments= "/quiet /norestart"
             EstimatedInstalledBytes="3071512"
             EstimatedInstallSeconds="120" >
      <InstallConditions>
        <BypassIf Property="VersionMsi" Compare="VersionGreaterThanOrEqualTo" Value="4.5" />
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" />
        <BypassIf Property="VersionNT" Compare="VersionLessThan" Value="5.2.0"/>
        <BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="6.0"/>
        <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
        <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.0" String="InvalidPlatform"/>
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
      </InstallConditions>
      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <!-- Defer reboot until MSI 4.5 update below -->
        <ExitCode Value="1641" Result="Success"/>
        <ExitCode Value="3010" Result="Success"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>
    </Command>

    <Command PackageFile="WindowsServer2003-KB958655-v2-x86-ENU.exe"
             Arguments= "/quiet /norestart"
             EstimatedInstalledBytes="1502584"
             EstimatedInstallSeconds="120" >
      <InstallConditions>
        <BypassIf Property="VersionMsiDll" Compare="VersionGreaterThanOrEqualTo" Value="4.5.6001.22299" />
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" />
        <BypassIf Property="VersionNT" Compare="VersionLessThan" Value="5.2.0"/>
        <BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="6.0"/>
        <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
        <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.0" String="InvalidPlatform"/>
        <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>

    <!-- Defines installation command for:
                  Windows XP Service Pack 2 and later
                  Windows 2003 Service Pack 1 or later
                  on x64 platform -->
    <Command PackageFile="WindowsServer2003-KB942288-v4-x64.exe"
             Arguments= "/quiet /norestart"
             EstimatedInstalledBytes="4691480"
             EstimatedInstallSeconds="120" >
      <InstallConditions>
        <BypassIf Property="VersionMsi" Compare="VersionGreaterThanOrEqualTo" Value="4.5" />
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64" />
        <BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="6.0"/>
        <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
        <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.1.2" String="InvalidPlatform"/>
        <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.0" String="InvalidPlatform"/>
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
      </InstallConditions>
      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <!-- Defer reboot until MSI 4.5 update below -->
        <ExitCode Value="1641" Result="Success"/>
        <ExitCode Value="3010" Result="Success"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>
    </Command>

    <Command PackageFile="WindowsServer2003.WindowsXP-KB958655-v2-x64-ENU.exe"
             Arguments= "/quiet /norestart"
             EstimatedInstalledBytes="2904952"
             EstimatedInstallSeconds="120" >
      <InstallConditions>
        <BypassIf Property="VersionMsiDll" Compare="VersionGreaterThanOrEqualTo" Value="4.5.6001.22299" />
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64" />
        <BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="6.0"/>
        <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
        <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.1.2" String="InvalidPlatform"/>
        <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.0" String="InvalidPlatform"/>
        <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>

    <!-- Defines installation command for:
                  Vista RTM and later
                  Windows Server 2008 RTM and later
                  on x86 platform -->
    <Command PackageFile="Windows6.0-KB958655-v2-x86.MSU"
             Arguments= "/quiet /norestart"
             EstimatedInstalledBytes="1960465"
             EstimatedInstallSeconds="120" >
      <InstallConditions>
        <BypassIf Property="VersionMsiDll" Compare="VersionGreaterThanOrEqualTo" Value="4.5.6001.22308" />
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" />
        <BypassIf Property="VersionNT" Compare="VersionLessThan" Value="6.0" />
        <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
        <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>

    <!-- Defines installation command for:
                  Vista RTM and later
                  Windows Server 2008 RTM and later
                  on x64 platform -->
    <Command PackageFile="Windows6.0-KB958655-v2-x64.MSU"
             Arguments= "/quiet /norestart"
             EstimatedInstalledBytes="3342348"
             EstimatedInstallSeconds="120" >
      <InstallConditions>
        <BypassIf Property="VersionMsiDll" Compare="VersionGreaterThanOrEqualTo" Value="4.5.6001.22308" />
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64" />
        <BypassIf Property="VersionNT" Compare="VersionLessThan" Value="6.0" />
        <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
        <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>

  <!-- Defines Homesite locations for each of the downloads -->
  <Strings>
    <String Name="Msi45XPx86exe">http://go.microsoft.com/fwlink/?LinkID=118633</String>
    <String Name="Msi45UpdateXPx86exe">http://go.microsoft.com/fwlink/?LinkID=161053</String>
    <String Name="Msi452K3x86exe">http://go.microsoft.com/fwlink/?LinkID=119115</String>
    <String Name="Msi45Update2K3x86exe">http://go.microsoft.com/fwlink/?LinkID=161054</String>
    <String Name="Msi45XP2K3x64exe">http://go.microsoft.com/fwlink/?LinkID=118636</String>
    <String Name="Msi45UpdateXP2K3x64exe">http://go.microsoft.com/fwlink/?LinkID=161055</String>
    <String Name="Msi45Vistax86msu">http://go.microsoft.com/fwlink/?LinkID=161056</String>
    <String Name="Msi45Vistax64msu">http://go.microsoft.com/fwlink/?LinkID=161057</String>
  </Strings>
</Product>

答案 1 :(得分:4)

我在Windows 7中遇到与VS2015相同的问题。 最后,我找到了解决方案,下载Windows Installer 4.5的安装包并将它们复制到下一个路径:“C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ SDK \ Bootstrapper \ Packages \ WindowsInstaller4_5”。 在此之后,安装项目编译工作。

如图所示,有必要复制Windows Installer 4.5的所有版本:

enter image description here

答案 2 :(得分:2)

在链接的MSDN文章中明确提到:

  

注意

如果没有Name元素包含http://go.microsoft.com/fwlink,请在根文件夹中打开先决条件的Product.xml文件,然后找到fwlink字符串。< / p>

它就在那里,文件的底部。请注意,您收到的消息有点误导,您必须将 8个安装程序下载到您的计算机上。用户实际使用哪一个取决于他的Windows版本。

我强烈建议你做这样做。对于用户来说,如果他从Microsoft服务器或您的服务器下载安装程序,它就没有任何区别。除了一个细节,如果他实际上需要安装程序,那么他不会使用Windows Update更新他的机器。

这些天不太可能,谢天谢地,但是如果你遇到这样的用户那么他就会,我怎么能优雅地说出来......,你后端的一个主要痛苦。当部署安装此安装程序时,他会期望提供支持,因为它是您提供它的计算机。而且必然如此,他无法获得微软的支持。实际上你也不能提供这样的支持,你不知道机器的形状是什么。