次の方法で共有


How to Use Scripts with Site Packager

You can use four types of Microsoft Visual Basic scripts with Site Packager: pre-packaging, post-packaging, application, and schema definition scripts.

Pre-packaging Scripts

Site Packager runs a pre-packaging script as soon as the package name is known, before the site is unpacked. Pre-packaging scripts must be named Pre<package name>.vbs, for example, PreCSharp.vbs.

A pre-packaging script is provided with one parameter, mode (/s:) that indicates whether Site Packager is running in silent mode or normal installation mode. For the pre-packaging scripts to run, they must reside in the same folder as the package you are unpacking.

Post-packaging Scripts

Site Packager runs a post-packaging script after all unpacking is complete, but before the Unpacking is complete! page appears. Post-packaging scripts must be named Post<package name>.vbs, for example, PostCSharp.vbs. A post-packaging script is provided with two parameters:

  • Site name in quotation marks ("MySite").

  • Mode (/s:). Silent mode or normal installation mode.

Post-packaging scripts must reside in the same folder as the package you are unpacking for them to run.

Application Scripts

Site Packager can also run application-specific scripts. Application-specific scripts are provided with six parameters:

  • Site name in quotation marks (/n:"MySite").

  • Application name in quotation marks (/r:"MyApp").

  • Server number or the instance number of the IIS Web site to which the application was installed (/i:1).

  • Name of the virtual directory to which the application was installed (/v:"MyRoot").

  • File path in quotation marks where the application files were installed (/d: "C:\inetpub\wwwroot").

  • Mode (/s:). Silent mode or normal installation mode.

Application scripts are run for each application after the following events occur:

  • The application has been installed and the files copied.

  • The IIS properties have been set for the application.

  • The application information has been written to the Administration database.

  • Site Packager has notified the Data Warehouse that the application exists.

Packaging Extended Profile Schema

If you want to create a package that contains an extended profile schema, you must generate the script before you package your site. The following steps outline how to package an extended profile schema:

  1. Use SQL Server to extend the UserObject table by adding your own attributes. For more information, see SQL Books Online.

  2. Add the new data members to the data object. For more information, see How to Add a Data Member to a Data Object.

  3. Use SQL Server to generate and export scripts for your extended profile schema. For more information, see SQL Books Online.

  4. When you package your site, Site Packager prompts you to specify the location of the schema definition script you generated. If you do not specify your script, Site Packager will package the default script. This will not include your extended profile schema.

See Also

Other Resources

How to Customize the Site Packager .ini Files

What Is the Format of the BizData.ini File?

Managing Site Packages