开发者

Bootstrapper Package not showing in Prerequisites Menu

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>


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


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.


I had a similar issue, took me an age to realise I'd named my package.xml file product.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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜