• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2097
  • Last Modified:

Custom Bootstrapper for SQL Native Client msi

I've started the process for a Custom Bootstrapper for adding prerequisites to my Setup and Deploy installation project.
- I created a CustomPackage in 'C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\'.
- Put an 'en' folder there with a eula.txt and Package.xml file in that.
- Put a Product.xml file in the CustomPackage folder.
- Put the sqlncli.msi in the CustomPackage folder.

The xml code in Product and Package is as below.  That's where I think I need the help.
The 'Custom Bootstrapper Package' shows up as a Prerequisite in VS, but it doesn't run the installation when I install the Main program.  It may have to do with the InstallChecks?  Do I actually need a RegKey # in there instead of X's?  If so which one?  Or is that what it installs the first time?
----Product.xml----
<?xml version="1.0" encoding="utf-8" ?>
<Product
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  ProductCode="Custom.Bootstrapper.Package">
 
  <RelatedProducts>
    <DependsOnProduct Code="Microsoft.Windows.Installer.3.1" />
  </RelatedProducts>
 
  <PackageFiles>
    <PackageFile Name="sqlncli.msi"/>
  </PackageFiles>
 
  <InstallChecks>
    <MsiProductCheck Product="IsMsiInstalled"
      Property="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"/>
  </InstallChecks>
 
  <Commands>
    <Command PackageFile="sqlncli.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"
  LicenseAgreement="eula.txt">
 
  <PackageFiles>
    <PackageFile Name="eula.txt"/>
  </PackageFiles>
 
  <Strings>
    <String Name="DisplayName">Custom Bootstrapper Package</String>
    <String Name="Culture">en</String>
    <String Name="NotAnAdmin">You must be an administrator to install this package.</String>
    <String Name="GeneralFailure">
      A general error has occurred while
      installing this package.
    </String>
  </Strings>
</Package>

Open in new window

0
dreinmann
Asked:
dreinmann
  • 2
  • 2
1 Solution
 
dreinmannAuthor Commented:
Ok, I've changed the Product.xml and Package.xml as reflected below.

It shows up in the Prerequisites, but it doesn't run on installation.  Can't figure out why?
----PRODUCT.XML----
<?xml version="1.0" encoding="utf-8" ?>
<Product
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  ProductCode="Microsoft.Sql.Client.9.0">
 
  <PackageFiles>
    <PackageFile Name="sqlncli.msi"/>
  </PackageFiles>
 
  <RelatedProducts>
    <DependsOnProduct Code="Microsoft.Windows.Installer.3.1" />
  </RelatedProducts>
 
  <InstallChecks>
    <RegistryCheck Property="SQLCliInstalled" Key="HKLM\SOFTWARE\Microsoft\Microsoft SQL Native Client\CurrentVersion" Value="Version" />
  </InstallChecks>
 
  <Commands Reboot="Defer">
    <Command PackageFile="sqlncli.msi"
      Arguments=' /q:a /c:"install /q /l"'
	     EstimatedInstalledBytes="4200000"
	     EstimatedInstallSeconds="60">
      <InstallConditions>
        <BypassIf Property="SQLCliInstalled" Compare="ValueEqualTo" Value="9.00.1399.06"/>
        <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>
 
 
----PACKAGE.XML----
<?xml version="1.0" encoding="utf-8" ?>
<Package
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  Name="DisplayName"
  Culture="Culture"
  LicenseAgreement="eula.txt">
 
  <PackageFiles>
    <PackageFile Name="eula.txt"/>
  </PackageFiles>
 
  <Strings>
    <String Name="DisplayName">SQL Native Client</String>
    <String Name="Culture">en</String>
    <String Name="AdminRequired">Administrator permissions are required to install the SQL Native Client 9.0. Contact your administrator.</String>
    <String Name="GeneralFailure">A general error has occurred while installing this package.</String>
   </Strings>
</Package>

Open in new window

0
 
Mark WillsTopic AdvisorCommented:
OK, (have you gone through : http://msdn.microsoft.com/en-us/library/ms165429.aspx   (sounds like you have)

Then Chris Smith wrote a tech paper and MS then published : http://msdn.microsoft.com/en-us/library/aa730839.aspx

And, I have seen this before and wondered about it - might be something that will help you : http://www.codeproject.com/KB/aspnet/Add_Custom_Prerequisite.aspx
0
 
dreinmannAuthor Commented:
Duh...simple mistake.  I had it all right in the first place, but I had the email link (sent to remote cpu) for program install pointed to the .msi file instead of the setup.exe file.  The msi file is just for the Program...the setup.exe file checks for prereq's and installs main program.

The Bootstrapper Manifest Generator is what helped me to see this, it works great btw.  After I created a custom bootstrapper with it, and it didn't work, I started checking other things and found the link problem.

Simple Problems:  Hate 'em / Love 'em
    Hate 'em because they never should have happened in the first place and could have gotten something else done!
    Love 'em because through all the research to fix the problem is a great learning process.  (I'm pretty confident now on manually creating custom bootstrappers)
0
 
Mark WillsTopic AdvisorCommented:
That manifest generator is a great tool... nd it is often those simple mistakes that catches us all out. Happy I could help out.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now