다음을 통해 공유


PackFolderEx Method

Topic Last Modified: 2006-06-13

Packages an application to either a CAB file or a folder.

Applies To

IExAppInstallerEx Interface

Type Library

Microsoft CDO for Exchange 2000 Library

DLL Implemented In

CDOEX.DLL

Syntax

Sub PackFolderEx(    ByVal bstrSrcFolderURL As String,
        ByVal bstrPackageFullPath As String,
        ByVal fIncludeSubFolders As Boolean,
        ByVal bstrSchemaFilterFile As String,
        ByVal bstrUserName As String,
        ByVal bstrPassword As String,
        ByVal lFileOption As Long,
        ByVal lOverwriteOption As Long,
        ByVal pfnCallBack As Long)
HRESULT PackFolderEx
(
        BSTR bstrSrcFolderURL,
        BSTR bstrPackageFullPath,
        VARIANT_BOOL fIncludeSubFolders,
        BSTR bstrSchemaFilterFile,
        BSTR bstrUserName,
        BSTR bstrPassword,
        long lFileOption,
        long lOverwriteOption,
        long pfnCallBack
);

Parameters

  • bstrSrcFolderURL
    The URL to the Exchange store folder of the application to be packaged.
  • bstrPackageFullPath
    The absolute path and file name for the packaged application on the Microsoft® Windows® file system. This parameter can point either to a CAB file or to a folder containing the contents of the application.
  • fIncludeSubFolders
    If TRUE, instructs the installer to include the subfolders of the application in the package.
  • bstrSchemaFilterFile
    A schema file to include or exclude properties and to fix items with the correct URLs. The default file provided by the Application Deployment Wizard is \Program Files\Exchsrvr\Tools\AppDeployWiz\samplefilter.xml. This file excludes such properties as DAV:parentname that would have no relevance in packaging an application. For SharePoint™ Portal Server 2001, this file is in the \Program Files\Exchange SDK\Tools\AppDeployWiz folder.
  • bstrUserName
    The user name required for authentication.
  • bstrPassword
    The user name required for authentication.
  • lFileOption
    Specify 0 to package the application in a CAB file or 1 to package the application in a folder.
  • lOverwriteOption
    Controls overwrite options if a CAB file or folder exists. Specify 0 to prompt a confirmation, 1 to fail, or 2 to overwrite without a confirmation.
  • pfnCallBack
    Reserved. Specify 0 (zero).

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

This method is an extension of the folder PackageApp method that provided packaging for the application in a CAB file and not in a folder.

Examples

The following example is in Microsoft® Visual Basic®.

Dim obj As New ExAppInstaller
obj.PackFolderEx bstrAppURL, _
               bstrCabFile, _
               fIncludeAllSubFolders, _
               bstrSchemaFilterFile, _
               bstrName, bstrPassword, _
               0,2,0

The following example is in Microsoft Visual C++®.

IExAppInstallerPtr spObject;
hr = spObject.CreateInstance(__uuidof(ExAppInstaller));
if (FAILED(hr)) {
   // error handling code...
}

hr = spObject->PackFolderEx(
   bstrAppURL,
   bstrPackageName,
   fIncludeSubfolders,
   bstrSchemaFilterFile,
   bstrUserName,
   bstrPassword,
   0,2,0 );
if (FAILED(hr)) {
   // error handling code...
}