首页 » 计算机与 Internet » Win32_SoftwareElement Class (Windows)

Win32_SoftwareElement Class (Windows)

Win32_SoftwareElement Class
The Win32_SoftwareElement WMI class represents a software element, part of a software feature (a distinct subset of a product which may contain one or more elements). Each software element is defined in a Win32_SoftwareElement instance, and the association between a feature and its Win32_SoftwareFeature instance is defined in the Win32_SoftwareFeatureSoftwareElements association class.
Note For more information about support or requirements for installation on a specific operating system, see Operating System Availability of WMI Components.
The following syntax is simplified from Managed Object Format (MOF) code and includes all inherited properties. Properties and methods are in alphabetic order, not MOF order.

class Win32_SoftwareElement : CIM_SoftwareElement
{
uint16 Attributes;
string BuildNumber;
string Caption;
string CodeSet;
string content:encoded;
string IdentificationCode;
datetime InstallDate;
sint16 InstallState;
string LanguageEdition;
string Manufacturer;
string Name;
string OtherTargetOS;
string Path;
string SerialNumber;
string SoftwareElementID;
uint16 SoftwareElementState;
string Status;
uint16 TargetOperatingSystem;
string Version;
};
Methods
The Win32_SoftwareElement class does not define any methods.
Properties
The Win32_SoftwareElement class has the following properties.
Attributes
Data type: uint16
Access type: Read-only
Bitmap that contains the remote execution options for the software element.
BuildNumber
Data type: string
Access type: Read-only
Number of the build.
Caption
Data type: string
Access type: Read-only
Short textual content:encoded (one-line string) of the object.
CodeSet
Data type: string
Access type: Read-only
Code set used by the software element.
content:encoded
Data type: string
Access type: Read-only
content:encoded of the object.
IdentificationCode
Data type: string
Access type: Read-only
Manufacturer??s identifier for this software element. Often this is a stock keeping unit (SKU) or part number.
InstallDate
Data type: datetime
Access type: Read-only
Object was installed. This property does not need a value to indicate that the object is installed.
InstallState
Data type: sint16
Access type: Read-only
Current installed state for the software element.
ValueMeaning
-7Not Used
-6Bad Configuration
-4Source Absent
-1Error
2Absent
3Local
4Source

LanguageEdition
Data type: string
Access type: Read-only
Language edition of this software element. The language codes defined in ISO 639 should be used. Where the software element represents multi-lingual or international version of a product, the string multilingual should be used.
Manufacturer
Data type: string
Access type: Read-only
Manufacturer of the software element.
Name
Data type: string
Access type: Read-only
Name used to identify the software element.
OtherTargetOS
Data type: string
Access type: Read-only
Records the manufacturer and operating system type for a software element when the TargetOperatingSystem property has a value of 1 (Other). When TargetOperatingSystem has a value of 1, OtherTargetOS must have a non-null value. For all other values of TargetOperatingSystem, OtherTargetOS is NULL.
Path
Data type: string
Access type: Read-only
Path to the installed software element. If the component is a registry key, the registry roots are represented numerically. For example, a registry path of
HKEY_CURRENT_USER
SOFTWARE
Microsoft
would be returned as 01:SOFTWAREMicrosoft. The registry roots returned are defined as follows: ValueMeaning
00HKEY_CLASSES_ROOT
01HKEY_CURRENT_USER
02HKEY_LOCAL_MACHINE
03HKEY_USERS

SerialNumber
Data type: string
Access type: Read-only
Assigned serial number of the software element.
SoftwareElementID
Data type: string
Access type: Read-only
Identifier for the software element and is designed to be used in conjunction with other keys to create a unique representation of this Win32_SoftwareElement instance.
SoftwareElementState
Data type: uint16
Access type: Read-only
Various states of a software element??s life cycle. A software element in the deployable state describes the details necessary to successful distribute it and the details (conditions and actions) required to create a software element in the installable state (that is, the next state). A software element in the installable state describes the details necessary to successfully install it and details conditions and actions required to create a software element in the executable state (that is, the next state). A software element in the executable state describes the details necessary to successfully start it and details conditions and actions required to create a software element in the running state (that is, the next state). A software element in the running state describes the details necessary to monitor and operate on a start element.
ValueMeaning
1Deployable
2Installable
3Executable
4Running

Status
Data type: string
Access type: Read-only
Current status of the object. Various operational and non-operational statuses can be defined. Operational statuses include: OK, Degraded, and Pred Fail (an element, such as a SMART-enabled hard drive, can function properly but predict a failure in the near future). Non-operational statuses include: Error, Starting, Stopping, and Service. Examples of Service could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is on-line, yet the managed element is neither OK nor in one of the other states.
Values are:
"OK"

"Error"

"Degraded"

"Unknown"

"Pred Fail"

"Starting"

"Stopping"

"Service"

TargetOperatingSystem
Data type: uint16
Access type: Read-only
Provider??s choice of operating system environment. The value of this property does not ensure binary executable. Two other pieces of information are needed. First, the version of the OS must be specified using the OS version check. The second piece of information is the architecture the OS runs on. The combination of these constructs allows the provider to clearly identify the level of OS required for a particular software element. The possible values for this property are as follows.
ValueMeaning
0Unknown
1Other
2MACOS
3ATTUNIX
4DGUX
5DECNT
6Digital Unix
7OpenVMS
8HPUX
9AIX
10MVS
11OS400
12OS/2
13JavaVM
14MSDOS
15WIN3x
16WIN95
17WIN98
18WINNT
19XP
20NCR3000
21NetWare
22OSF
23DC/OS
24Reliant UNIX
25SCO UnixWare
26SCO OpenServer
27Sequent
28IRIX
29Solaris
30SunOS
31U6000
32ASERIES
33TandemNSK
34TandemNT
35BS2000
36LINUX
37Lynx
38XENIX
39VM/ESA
40Interactive UNIX
41BSDUNIX
42FreeBSD
43NetBSD
44GNU Hurd
45OS9
46MACH Kernel
47Inferno
48QNX
49EPOC
50IxWorks
51VxWorks
52MiNT
53BeOS
54HP MPE
55NextStep
56PalmPilot
57Rhapsody

Version
Data type: string
Access type: Read-only
Version of the software element. Values should be in the form [Major].[Minor].[Revision] or [Major].[Minor][l
etter][revision].
Remarks
Any component can be shared between two or more Win32_SoftwareFeature instances. If two or more features reference the same component, that component is selected for installation if any of these features are selected.
The Win32_SoftwareElement class is derived from CIM_SoftwareElement.
Example Code
For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.
For C++ code examples, see WMI C++ Application Examples.
Requirements
ClientRequires Windows Vista, Windows XP, Windows 2000 Professional, or Windows NT Workstation 4.0 SP4 and later.
ServerRequires Windows Server 2008, Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0 SP4 and later.
MOFDeclared in Msi.mof.
DLLRequires Msiprov.dll.
NamespaceDefined in rootcimv2.

See Also
Installed Applications Classes

本文转自
http://msdn2.microsoft.com/en-us/library/aa394453(VS.85).aspx

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google photo

You are commenting using your Google account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s