SMS_Package

The SMS_Package WMI class contains information about its program(s), such as identifying the source files, how the files are copied to the distribution point, and refresh details. You can also identify if the program provides an install status MIF to report status, or simply uses an exit code.

The following syntax is simplified from MOF code and includes all inherited properties.

Class SMS_Package : SMS_BaseClass
{
  uint32 ActionInProgress;
  string Description;
  uint32 ForcedDisconnectDelay;
  boolean ForcedDisconnectEnabled;
  uint32 ForcedDisconnectNumRetries;
  uint8 Icon[];
  uint32 IconSize;
  boolean IgnoreAddressSchedule;
  string Language;
  datetime LastRefreshTime;
  string Manufacturer;
  string MIFFilename;
  string MIFName;
  string MIFPublisher;
  string MIFVersion;
  string Name;
  string PackageID;
  uint32 PkgFlags;
  uint32 PkgSourceFlag;
  string PkgSourcePath;
  string PreferredAddressType;
  uint32 Priority;
  boolean RefreshPkgSourceFlag;
  SMS_ScheduleToken RefreshSchedule[];
  string ShareName;
  uint32 ShareType;
  datetime SourceDate;
  string SourceSite;
  uint32 SourceVersion;
  string StoredPkgPath;
  uint32 StoredPkgVersion;
  string Version;
};

Properties

  • ActionInProgress
    Data type: uint32
    Access type: Read-only

    Current action being performed on the package by SMS. When you delete an instance of SMS_Package, the instance is not deleted until its related components are deleted, such as programs, source files, distribution points, and advertisements. Instead, SMS sets the ActionInProgress property to 3 (delete) to let you know that the package is marked for deletion. To ensure that your query does not return packages that have been deleted (marked for deletion), you should add this case to your WHERE clause.

    This property was added in SMS 2.0, Service Pack 1. Values are:
    DELETE (3)

  • Description
    Data type: string
    Access type: Read/write

    Description of the package.

  • ForcedDisconnectDelay
    Data type: uint32
    Access type: Read/write

    Grace period, in minutes, that SMS waits before forcibly disconnecting users from the distribution point share. The default grace period is five minutes.

  • ForcedDisconnectEnabled
    Data type: boolean
    Access type: Read/write

    Indicates that SMS should forcibly disconnect users from the distribution point share if a share violation occurs while updating, refreshing, or deleting package source files. The default value is FALSE. Use this feature with caution — forcibly disconnecting users can have adverse effects on the client.

  • ForcedDisconnectNumRetries
    Data type: uint32
    Access type: Read/write

    Number of times SMS attempts to disconnect users from the distribution point share. The default number of retries is two.

  • Icon
    Data type: uint8[]
    Access type: Read/write

    Array of bytes that represent the icon to associate with the package. The icon is displayed in the console.

  • IconSize
    Data type: uint32
    Access type: Read-only
    Qualifiers: Lazy

    Size of the icon (bytes).

  • IgnoreAddressSchedule
    Data type: boolean
    Access type: Read/write

    Indicates whether SMS ignores the schedule of the sender specified by PreferredAddressType, or the default sender if none is specified. The default value is FALSE.

  • Language
    Data type: string
    Access type: Read/write

    Used with Manufacturer, Name, and Version to identify a package in the console. For example, you could have an English and a German version of the same package.

  • LastRefreshTime
    Data type: datetime
    Access type: Read-only

    Last date and time the package source files were refreshed.

  • Manufacturer
    Data type: string
    Access type: Read/write

    Manufacturer (publisher) of the package. This is used with Name, Version, and Language to identify a package in the console.

  • MIFFilename
    Data type: string
    Access type: Read/write

    Name of the MIF file that contains the program status. The extension must be .mif. For details, see Remarks.

  • MIFName
    Data type: string
    Access type: Read/write

    Name of this package.

  • MIFPublisher
    Data type: string
    Access type: Read/write

    Publisher of this package.

  • MIFVersion
    Data type: string
    Access type: Read/write

    Version number of this package.

  • Name
    Data type: string
    Access type: Read/write

    Name of the package. This is used with Name, Version, and Language, to identify a package in the console. This is the only property that is required to create a package instance.

  • PackageID
    Data type: string
    Access type: Read-only
    Qualifiers: Key

    Unique, auto-generated key that you use to relate programs, advertisements and distribution points to the package.

  • PkgFlags
    Data type: uint32
    Access type: Read/write
    Qualifiers: Bits

    Flag value that determines if SMS uses MIFName, MIFPublisher, and MIFVersion for MIF status matching. Otherwise, SMS uses Name, Manufacturer, and Version for status matching. For more details, see Remarks. Bit flag:
    USE_SPECIAL_MIF (bit 29)

  • PkgSourceFlag
    Data type: uint32
    Access type: Read/write

    Method of reading the package source files. Values are:

    STORAGE_NEEDS_SPECIFYING (0)
    STORAGE_NO_SOURCE (1)
    STORAGE_DIRECT (2)
    STORAGE_COMPRESS (3)

    Specify STORAGE_NO_SOURCE when your program does not use source files.

    Specify STORAGE_DIRECT when the source files are taken directly from the source without compression. Use this option when the source files are located on the local server or a UNC path has been specified to a persistant storage location.

    Specify STORAGE_COMPRESS when the source files are to be compressed and copied to the site server. Use this option when the package source files are coming from a CD or a non-persistant medium. SMS puts the path to where the files were copied in StoredPkgPath. Note that you cannot specify a refresh schedule when you select this option. If you call the RefreshPkgSource method, the CD or specified source medium must be in a ready state.

  • PkgSourcePath
    Data type: string
    Access type: Read/write

    Location of the package source files. This can be either a full local path or a UNC path. Make sure this location contains all the files and subdirectories needed to complete the program, including any scripts.

  • PreferredAddressType
    Data type: string
    Access type: Read/write

    Preferred sender to use when copying the package source files to the distribution points. SMS determines which sender to use if this value is not specified. Values are:
    "SMS_LAN_SENDER"
    "SMS_COURIER_SENDER"
    "SMS_ASYNC_RAS_SENDER"
    "SMS_ISDN_RAS_SENDER"
    "SMS_X25_RAS_SENDER"
    "SMS_SNA_RAS_SENDER"

  • Priority
    Data type: uint32
    Access type: Read/write

    Sending priority of the package. Values are:
    HIGH(1)
    NORMAL(2)
    LOW(3)

  • RefreshPkgSourceFlag
    Data type: boolean
    Access type: Read/write
    Qualifiers: Lazy

    Indicates that SMS should refresh the package source files. If TRUE, this has the same effect as calling the RefreshPkgSource method. This property always returns FALSE when read. Do not use this property to update the package source files. Instead, use the RefreshPkgSource method.

  • RefreshSchedule
    Data type: SMS_ScheduleToken[]
    Access type: Read/write
    Qualifiers: Lazy, Max(15)

    Defines when SMS updates the package source files on the distribution points. You can only specify a refresh schedule when PkgSourceFlag is STORAGE_DIRECT.

  • ShareName
    Data type: string
    Access type: Read/write

    Share to use on the distribution point. Your share name can include directories. If the directories do not exist, SMS creates them for you. You must specify a share name if you set ShareType to SHARE_SPECIFIC.

  • ShareType
    Data type: uint32
    Access type: Read/write

    Type of share used for the package's distribution point. The default is SHARE_COMMON. If you specify SHARE_SPECIFIC, you must provide a value for ShareName. Values are:
    SHARE_COMMON (1)
    SHARE_SPECIFIC(2)

  • SourceDate
    Data type: datetime
    Access type: Read-only

    Date and time the package source files were last updated on the distribution points.

  • SourceSite
    Data type: string
    Access type: Read-only

    Site code from where the package originated.

  • SourceVersion
    Data type: uint32
    Access type: Read-only

    Incremented when the package is updated or the source files are refreshed.

  • StoredPkgPath
    Data type: string
    Access type: Read-only

    Full path to where SMS stores the compressed version of the source files on the site server. This path is set by SMS when the value of PkgSourceFlag is STORAGE_COMPRESS.

  • StoredPkgVersion
    Data type: uint32
    Access type: Read-only

    Version of the compressed source files.

  • Version
    Data type: string
    Access type: Read/write

    Version of the package. This is used with Manufacturer, Name, and Language to identify a package in the console.

Methods

The following table lists the methods in SMS_Package.

Method Description
GetNextID Reserved.
RefreshPkgSource Causes a refresh of the package source files. It is used when the package properties have not changed.
SetNextID Reserved.
Unlock Reserved.

Remarks

If you set the USE_SPECIAL_MIF flag of the PkgFlags property, SMS looks in the %TEMP% directory or the %windir% directory for the install status MIF that you specified in the MIFFileName property. If SMS does not find the file, SMS searches for all MIF files in those directories. A case-insensitive comparison is made of the values for MIFName, MIFPublisher, and MIFVersion to those specified in the MIF file. If a match is found, the status specified in the MIF file is used as the install status for the program.

If SMS cannot find a match, or you did not specify the USE_SPECIAL_MIF flag, SMS uses the program's exit code to set the program's install status (whether the program successfully executed). An exit code of zero is considered successful. Any other values are considered application-specific error codes.

You use a status MIF to generate detailed status reporting. To generate a status MIF, you must call the InstallStatusMIF function. For details, see Status MIF Functions.

The values you provide when you create a package are entirely dependent on the programs that it contains. For example, if your package contains a simple program that does not use source files and does not generate a status MIF, you can create a package instance that simply contains a value for Name.

Changing ShareName or PkgSourcePath causes the Distribution Manager to delete and re-create the package on all distribution points of the current site. In addition, when PkgSourcePath is updated, the package is recompressed (if PkgSourceFlag has the STORAGE_COMPRESS bit set) and sent to all child sites that have a distribution point defined for the package. This can be an expensive process, so use discretion when you update these fields.

Note  You can also use the GetPDFData method in class SMS_PDF_Package to generate an SMS_Package instance.

See Also

Creating a Package and Programs Using SMS Classes, Software Distribution Classes, SMS_AdvertisementStatusSummarizer, SMS_DistributionPoint, SMS_PackageStatusDetailSummarizer, SMS_PDF_Package, SMS_Program