Sie sind auf Seite 1von 4

http://msdn.microsoft.com/en-us/library/ee335701.

aspx
United States (English) | Sign in | |

1/4

Home Library Learn Community Forums


MSDN Library

Samples

Downloads

Support

Search MSDN with Bing

Development Tools and Languages Visual Studio 2012 Application Development in Visual Studio Deploying Applications and Components Application Deployment Prerequisites Deploying 64-bit Applications Creating Bootstrapper Packages How to: Create a Product Manifest How to: Create a Package Manifest How to: Create a Localized Bootstrapper Package Walkthrough: Creating a Custom Bootstrapper to Show a Privacy Prompt Product and Package Schema Reference

How to: Create a Product Manifest


Visual Studio 2012
Other Versions 0 out of 1 rated this helpful - Rate this topic To deploy prerequisites for your application, you can create a bootstrapper package. A bootstrapper package contains a single product manifest file but a package manifest for each locale. The package manifest contains localization-specific aspects of your package. This includes strings, end-user license agreements, and the language packs. For more information about product manifests, see How to: Create a Package Manifest.

Creating the Product Manifest To create the product manifest


1. Create a directory for the bootstrapper package. This example uses C:\package. 2. In Visual Studio, create a new XML file called product.xml, and save it to the C:\package folder. 3. Add the following XML to describe the XML namespace and product code for the package. Replace the product code with a unique identifier for the package.

<Product xmlns="http://schemas.microsoft.com/de veloper/2004/01/bootstrapper" ProductCode="Custom.Bootstrapper.Packa ge">

4. Add XML to specify that the package has a dependency. This example uses a dependency on Microsoft Windows Installer 3.1.

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

5. Add XML to list all the files that are in the bootstrapper package. This example uses the package file name CorePackage.msi.

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

6. Copy or move the CorePackage.msi file to the C:\package folder. 7. Add XML to install the package by using bootstrapper commands. The bootstrapper automatically adds the /qn flag to the .msi file, which will install silently. If the file is an

http://msdn.microsoft.com/en-us/library/ee335701.aspx
.exe, the bootstrapper runs the .exe file by using the shell. The following XML shows no arguments to CorePackage.msi, but you can put command line argument into the Arguments attribute.

2/4

<Commands> <Command PackageFile="CorePack age.msi" Arguments="">

8. Add the following XML to check if this bootstrapper package is installed. Replace the product code with the GUID for the redistributable component.

<InstallChecks> <MsiProductCheck Property="IsMsiInstall ed" Product="{XXXXXXX-XXXX -XXXX-XXXX-XXXXXXXXXXXX}"/> </InstallChecks>

9. Add XML to change the bootstrapper behavior depending on if the bootstrapper component is already installed. If the component is installed, the bootstrapper package does not run. The following XML checks if the current user is an administrator because this component requires administrative privileges.

<InstallConditions> <BypassIf Property="IsMsiInstalle d" Compare="ValueGreaterTh an" Value="0"/> <FailIf Property="AdminUse r" Compare="ValueNotEqual To" Value="True" String="NotAnAdmin"/> </InstallConditions>

10. Add XML to set exit codes if the installation is successful and if a reboot is necessary. The following XML demonstrates the Fail and FailReboot exit codes, which indicate that the bootstrapper will not continue installing packages.

<ExitCodes> <ExitCode Value="0" Result ="Success"/> <ExitCode Value="1641" Res ult="SuccessReboot"/> <ExitCode Value="3010" Res ult="SuccessReboot"/> <DefaultExitCode Result="F ail" String="GeneralFailure"/> </ExitCodes>

11. Add the following XML to end the section for bootstrapper commands.

</Command> </Commands>

12. Move the C:\package folder to the Visual Studio bootstrapper directory. For Visual Studio 2010, this is the \Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages directory.

http://msdn.microsoft.com/en-us/library/ee335701.aspx

3/4

Example
The product manifest contains installation instructions for custom prerequisites.

<?xml version="1.0" encoding="utf-8" ?> <Product xmlns="http://schemas.microsoft.com/devel oper/2004/01/bootstrapper" ProductCode="Custom.Bootstrapper.Package" > <RelatedProducts> <DependsOnProduct Code="Microsoft.Windo ws.Installer.3.1" /> </RelatedProducts> <PackageFiles> <PackageFile Name="CorePackage.msi"/> </PackageFiles> <InstallChecks> <MsiProductCheck Product="IsMsiInstalle d" Property="{XXXXXXXX-XXXX-XXXX-XXXX-XX XXXXXXXXXX}"/> </InstallChecks> <Commands> <Command PackageFile="CorePackage.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="Succ essReboot"/> <ExitCode Value="3010" Result="Succ essReboot"/> <DefaultExitCode Result="Fail" Stri ng="GeneralFailure"/> </ExitCodes> </Command> </Commands> </Product>

See Also
Reference
Product and Package Schema Reference

Did you find this helpful?

Yes

No

TOOLS Visual Studio Expression ASP.NET Silverlight

PLATFORMS Visual Studio Windows Windows Phone Windows Azure

SERVERS Windows Server Exchange Server SQL Server Biz Talk Server

DEVELOPER RESOURCES MSDN Subscriptions MSDN Magazine MSDN Flash Newsletter Code Samples

GET STARTED FOR FREE MSDN evaluation center BizSpark (for startups) DreamSpark (for students) WebsiteSpark (for web devs)

http://msdn.microsoft.com/en-us/library/ee335701.aspx
Office Data MSDN Forums School faculty

4/4

Newsletter | Contact Us | Privacy Statement | Terms of Use | Trademarks

| Site Feedback

2012 Microsoft. All rights reserved.

Das könnte Ihnen auch gefallen