Windows® Installer Internet Download Bootstrapper

Building the sample

The sample can be built by running the following command from the Platform SDK build environment window:

            nmake

In order to build the sample clean, the following commands should be used:

            nmake clean

            nmake

Bootstrapper

Setup.exe is a configurable bootstrap executable. Msistuff.exe, included in the Platform SDK Components for Windows® Installer Developers can be used to configure it. By using Msistuff.exe to configure the resources in Setup.exe, developers can easily create a web installation of a Windows® Installer package.

The minimum installer version required by the bootstrap executable is Windows® Installer version 2.0. Applications can get the installer version by using DllGetVersion. For more information see, How do I determine the Windows Installer Version?

The bootstrap executable provided with the Windows® Installer 3.0 SDK does the following:

·        Calls WinVerifyTrust to verify the digital signature of the .msi file. Windows® Installer version 2.0 and later versions provides a Subject Interface Package (SIP) to enable signing of Windows® Installer packages.

·        If necessary upgrades the version of the Windows® Installer on the machine.

The following resources of Setup.exe can be displayed or configured using Msistuff.exe.

Resource ID

Description

ISETUPPROPNAME_BASEURL

The base URL location of Setup.exe. If no value is specified the location of Setup.exe defaults to removable media. Only URL-based installs are subject to a check with WinVerifyTrust. The trailing forward slash on the URL is optional. This resource is optional.

ISETUPPROPNAME_DATABASE

The name of the .msi file. This is a relative path to the .msi file specified relative to the location of the Setup.exe program. This resource is required if the resource ISETUPPROPNAME_PATCH is not specified. ISETUPPROPNAME_DATABASE and ISETUPPROPNAME_PATCH cannot both be specified. Only one of the two can be specified.

ISETUPPROPNAME_OPERATION

The type of operation to perform. Possible values are INSTALL, MINPATCH, MAJPATCH and INSTALLUPD. The INSTALL value equates to the first time installation of the package. The MINPATCH value indicates that the patch specified in the PATCH property is a small or minor update patch. The MAJPATCH value indicates that the patch specified in the PATCH property is a major update patch. INSTALLUPD indicates that the installation could be a first time installation or an update. Use of INSTALLUPD has the bootstrap check for the presence of the product. If the product is present, then the recache package flag is set and a reinstall is performed; otherwise, a regular installation is performed. Note that INSTALLUPD should only be used for small and minor update packages where the product code is not changing. In a major upgrade, REINSTALL is not required because the product code changes, in essence creating a brand new product. The Upgrade table authoring in addition to the FindRelatedProducts, MigrateFeatureStates, and RemoveExistingProducts actions handle upgrading of the original product. Thus, the INSTALL option is sufficient. If this resource is missing, the INSTALL operation is assumed if the ISETUPPROPNAME_DATABASE property is authored. Otherwise, MINPATCH is assumed if the ISETUPPROPNAME_PATCH property is authored. This is an optional value.

ISETUPPROPNAME_PRODUCTNAME

The name of the product. This is the name used in the banner text in the downloaded user interface. This resource is optional. If omitted, the name defaults to "the product".

ISETUPPROPNAME_MINIMUM_MSI

The minimum version of the Windows® Installer required. If the minimum version of the Windows® Installer is not installed on the computer, the update package is called to upgrade the Windows® Installer. The value of this property has the same format as the PID_PAGECOUNT value.

ISETUPPROPNAME_UPDATELOCATION

The base URL location of the Windows® Installer update package. This resource may be omitted. If this value is omitted, the default location of the update package is the location of Setup.exe.

ISETUPPROPNAME_UPDATE

The name of the Windows® Installer update package. This is a relative path to the update package relative to the location specified by ISETUPPROPNAME_UPDATELOCATION. This resource is required.

ISETUPPROPNAME_PATCH

The name of the .msp file. This is a relative path to the .msp file specified relative to the location of the Setup.exe program. This resource is required if the resource ISETUPPROPNAME_DATABASE is not specified. ISETUPPROPNAME_DATABASE and ISETUPPROPNAME_PATCH cannot both be specified. Only one of the two can be specified.

ISETUPPROPNAME_PROPERTIES

The PROPERTY=VALUE strings. These are the PROPERTY=VALUE pairs to include on the command line. This option is optional.

For example, the following ISETUPPROPNAME_BASEURL and ISETUPPROPNAME_DATABASE values would be used for the following hypothetical package locations.

Actual package location

Resource values

http://www.example.com/Products/Product1/product1.msi

ISETUPPROPNAME_BASEURL = http://www.example.com/Products/Product1

ISETUPPROPNAME_DATABASE = product1.msi

http://www.example.com/Products/Product1/product1.msi

ISETUPPROPNAME_BASEURL = http://www.example.com/Products/Product1

ISETUPPROPNAME_DATABASE = ../Product1/product1.msi

e:\product1.msi

Omit ISETUPPROPNAME_BASEURL.

ISETUPPROPNAME_DATABASE = product1.msi

e:\setup\product1.msi

(The currently running location of Setup.exe is e:\setup.exe.)

Omit ISETUPPROPNAME_BASEURL.

ISETUPPROPNAME_DATABASE = Setup\product1.msi

Command Line Parameters

The following table lists the command options that can be used with the Setup.exe that is shipped with the Platform SDK Components for Windows® Installer Developers. When invoked without any command line options, Setup.exe defaults to the behavior specified via the configured resources. The command line options are mutually exclusive — only one of them can be used at a time.

Option

Usage

Meaning

/a

setup.exe /a

Initiates an administrative installation.

If the ISETUPPROPNAME_DATABASE property is configured in Setup.exe, then this option can be used to perform an administrative installation of the product. This command line option is not supported if the ISETUPPROPNAME_PATCH resource is configured.

/a

setup.exe /a <full-path to an existing administrative install>

If the ISETUPPROPNAME_PATCH property is configured in Setup.exe, then this option can be used to patch an existing administrative installation of the product. This command line option is not supported if the ISETUPPROPNAME_DATABASE resource is configured.

/v

setup.exe /v <full path to a file>

Verifies the signature on the file using WinVerifyTrust. No UI is displayed when this option is used. In this case, the result of the trust check is the return value obtained from the execution of Setup.exe.

/?

 

Displays a help dialog indicating the valid arguments. Note: The help dialog is also displayed if invalid arguments are supplied.

For more information, see A URL Based Windows Installer Installation Example.

Windows® Installer 3.0 Redistributable

Windows® Installer 3.0 redistributable is a software update package: WindowsInstaller-KB884016-x86.exe. The following table shows the released versions of Windows® Installer. For more information about the value of operating system properties, see Operating System Property Values.

 

Released version

Version

Description

Windows® Installer 1.0

1.00.5104.0

Released with Office 2000 and as a redistributable.

Windows® Installer 1.1

1.10.1029.0

Released with Windows® 2000.

 

1.10.1029.1

Released as a redistributable.

Windows® Installer 1.11

1.11.1314.0

Released with Windows® 2000 Service Pack 1.

 

1.11.2405.0

Released with Windows® 2000 Service Pack 2.

Windows® Installer 1.2

1.20.1410.0

Released with Windows® Millennium Edition.

 

1.20.1827.1

Released as a redistributable.

Windows® Installer 2.0

2.0.2600.0

Released with Windows® XP.

 

2.0.2600.1

Released with Windows® 2000 Service Pack 3.

 

2.0.2600.1183

Released with Windows® 2000 Service Pack 4.

 

2.0.2600.2

Released as a redistributable.

 

2.0.2600.1106

Released with Windows® XP Service Pack 1.

 

2.0.3790.0

Released with Windows® Server 2003 family.

Windows® Installer 3.0

3.0.3790.2180

Released with Windows® XP Service Pack 2.

 

Syntax

WindowsInstaller-KB884016-x86.exe options

Command Line Parameters

Option

Description

/norestart

Prevents WindowsInstaller-KB884016-x86.exe from asking the user to reboot even if it had to replace files that were in use during the installation. If the update package is invoked with this option, it returns ERROR_SUCCESS_REBOOT_REQUIRED if it had to replace files that were in use. If it did not have to replace files that were in use, it returns ERROR_SUCCESS.

See the remarks section for additional information on delayed reboots.

/quiet

For use by applications that redistribute the Windows® Installer as part of a bootstrapping application. No UI is presented to the user. The bootstrapping application should check the return code to determine whether a reboot is needed to complete the installation of the Windows® Installer.

/help

Displays help on all the available options.

 

Remarks

Bootstrapping applications that use WindowsInstaller-KB884016-x86.exe to install the Windows® Installer with another application may require an extra system reboot. This is potentially an extra reboot in addition to any reboots needed to install the application.

 

The delayed reboot option is only recommended for setup developers who want to eliminate an extra reboot caused by using WindowsInstaller-KB884016-x86.exe with a setup application that installs files that are in use.

 

Developers should do the following in their setup application to use the delayed reboot option.

 

To use the delayed reboot option:

  1. Call WindowsInstaller-KB884016-x86.exe with the /norestart command line option.
  2. Treat the return of either ERROR_SUCCESS or ERROR_SUCCESS_REBOOT_REQUIRED as meaning success.
  3. Invoke Msiexec on the application's package and run other setup code specific to the application. If the setup application uses MsiInstallProduct, then the application must load MSI.DLL from the system directory.

Note   Applications that call LoadLibrary on the new MSI.DLL after WindowsInstaller-KB884016-x86.exe returns successfully, must ensure that an older version of MSI.DLL has not already been loaded within the process. If an older version of MSI.DLL was loaded within the process, it must be unloaded from the process address space prior to the LoadLibrary call for the new MSI.DLL.

  1. If step (3) does not require a reboot and if WindowsInstaller-KB884016-x86.exe had returned ERROR_SUCCESS_REBOOT_REQUIRED in step (1), prompt the user for a reboot to complete the setup of the Windows® Installer binaries on the system. However, if a reboot occurs in step (3), no additional steps are required.

 

To learn about the requirements for installing Windows Installer 3.0, please refer to the KB article on Windows® Installer 3.0 redistributable available at http://go.microsoft.com/fwlink/?LinkId=33342.