引导程序包未显示在先决条件菜单中

发布于 2024-10-27 13:00:00 字数 2205 浏览 4 评论 0原文

我正在尝试将自定义引导程序包添加到 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>

包.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>

I am trying to add a custom bootstrapper package to a clickonce install in Visual Studio 2010, but the package is not showing up in the Prerequisites menu. I have added a folder in the "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages" directory for my package.

I have opened both my product.xml and package.xml in Visual Studio and neither showed any errors.

I tried to check the registry to verify that I was placing my files in the correct location, but neither HKLM\Software\Microsoft\GenericBootstrapper nor HKCU\Software\Microsoft\GenericBootstrapper were in the registry.

I have also tried a full reboot after adding the files.

Here are my XML files:
product.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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

旧人九事 2024-11-03 13:00:00

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

I was able to resolve this issue by using the Bootstrapper Manifest Generator tool to generate the xml rather than doing it by hand.

月牙弯弯 2024-11-03 13:00:00

在您的product.xml 文件中,您永远不会向我们显示您正在使用的产品代码。它位于文件的最顶部,如下所示:

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

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

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

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

In your product.xml file, you never show us what product code you're using. It's at the very top of the file, and looks like this:

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

Bear in mind that for every bootstrapper package, the product code must be unique. If two bootstrappers have the same product code, then only one of them will be displayed in the prerequisites list.

If you got that product file by copying and pasting it from another bootstrapper and then changing the values that were relevant for you, it's possible that you didn't change the product code, so your newly-added package isn't going to be registered.

This happened to me. I took my product.xml and package.xml files from another bootstrapper and then just edited them to work for my purposes, but I neglected the product code and my package never showed up in the prerequisites dialog. Once I went back and changed the product code to a new, unique value, it appeared.

千柳 2024-11-03 13:00:00

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

I had a similar issue, took me an age to realise I'd named my package.xml file product.xml

吐个泡泡 2024-11-03 13:00:00

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

Like other have implied, anything malformed about your XML file will cause it not to show in the Prerequisites checklist. I had a single space at the start of my XML file; after removing this it showed up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文