【问题标题】:Bootstrapper Package not showing in Prerequisites Menu引导程序包未显示在先决条件菜单中
【发布时间】:2011-03-30 17:14:20
【问题描述】:

我正在尝试将自定义引导程序包添加到 Visual Studio 2010 中的 clickonce 安装,但该包未显示在先决条件菜单中。我在“C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages”目录中为我的包添加了一个文件夹。

我在 Visual Studio 中打开了我的 product.xml 和 package.xml 都没有显示任何错误。

我尝试检查注册表以确认我将文件放置在正确的位置,但注册表中既没有 HKLM\Software\Microsoft\GenericBootstrapper 也没有 HKCU\Software\Microsoft\GenericBootstrapper。

我也尝试在添加文件后完全重启。

这是我的 XML 文件: 产品.xml

<?xml version="1.0" encoding="utf-8" ?>
<Product
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  ProductCode="RedemptionDLL">

  <RelatedProducts>
    <DependsOnProduct Code="Microsoft.Windows.Installer.3.1" />
  </RelatedProducts>

  <PackageFiles>
    <PackageFile Name="RedemptionDLL.msi"/>
  </PackageFiles>

  <Commands>
    <Command PackageFile="RedemptionDLL.msi" Arguments="">

      <InstallConditions>
        <BypassIf Property="IsMsiInstalled"
          Compare="ValueGreaterThan" Value="0"/>
        <FailIf Property="AdminUser" 
          Compare="ValueNotEqualTo" Value="True"
         String="NotAnAdmin"/>
      </InstallConditions>

      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <ExitCode Value="1641" Result="SuccessReboot"/>
        <ExitCode Value="3010" Result="SuccessReboot"/>
        <DefaultExitCode Result="Fail" String="GeneralFailure"/>
      </ExitCodes>
    </Command>
  </Commands>
</Product>

package.xml

<?xml version="1.0" encoding="utf-8" ?>
<Package
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  Name="DisplayName"
  Culture="Culture"

  <Strings>
    <String Name="DisplayName">RedemptionDLL</String>
    <String Name="Culture">en</String>
    <String Name="NotAnAdmin">You must be an administrator to install this package.  Please contact your administrator.</String>
    <String Name="GeneralFailure">A general error has occurred while 
installing this package.</String>
  </Strings>
</Package>

【问题讨论】:

    标签: visual-studio-2010 clickonce bootstrapper


    【解决方案1】:

    我能够通过使用 Bootstrapper Manifest Generator 工具生成 xml 而不是手动来解决这个问题。

    【讨论】:

      【解决方案2】:

      在您的 product.xml 文件中,您从未向我们展示您使用的产品代码。它位于文件的最顶部,如下所示:

      <Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
       ProductCode="Your.Product.Code">
      

      请记住,对于每个引导程序包,产品代码必须是唯一的。如果两个引导程序具有相同的产品代码,则在先决条件列表中只会显示其中一个。

      如果您通过从另一个引导程序复制并粘贴该产品文件,然后更改与您相关的值来获得该产品文件,则可能您没有更改产品代码,因此您的新添加的包不会运行注册。

      这发生在我身上。我从另一个引导程序中获取了我的 product.xml 和 package.xml 文件,然后只是编辑它们以用于我的目的,但我忽略了产品代码,我的包从未出现在先决条件对话框中。一旦我返回并将产品代码更改为一个新的唯一值,它就会出现。

      【讨论】:

        【解决方案3】:

        我遇到了类似的问题,我花了很长时间才意识到我将我的 package.xml 文件命名为 product.xml

        【讨论】:

          【解决方案4】:

          就像其他人暗示的那样,您的 XML 文件的任何格式错误都会导致它不会显示在先决条件清单中。我的 XML 文件开头有一个空格;删除后它出现了。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2014-10-09
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多