NAnt SDK Documentation - v0.92

SysInfoTask Class

Sets properties with system information.

For a list of all members of this type, see SysInfoTask Members.

System.Object
   NAnt.Core.Element
      NAnt.Core.Task
         NAnt.Core.Tasks.SysInfoTask

[Visual Basic]
<TaskName(Name:="sysinfo")>
Public Class SysInfoTask
    Inherits Task
[C#]
[TaskName(Name="sysinfo")]
public class SysInfoTask : Task

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

Sets a number of properties with information about the system environment. The intent of this task is for nightly build logs to have a record of system information so that the build was performed on.

Property Value
<Prefix>.clr.version Common Language Runtime version number.
<Prefix>.env.* Environment variables (e.g., <Prefix>.env.PATH).
<Prefix>.os.platform Operating system platform ID.
<Prefix>.os.version Operating system version.
<Prefix>.os Operating system version string.
<Prefix>.os.folder.applicationdata The directory that serves as a common repository for application-specific data for the current roaming user.
<Prefix>.os.folder.commonapplicationdata The directory that serves as a common repository for application-specific data that is used by all users.
<Prefix>.os.folder.commonprogramfiles The directory for components that are shared across applications.
<Prefix>.os.folder.desktopdirectory The directory used to physically store file objects on the desktop. Do not confuse this directory with the desktop folder itself, which is a virtual folder.
<Prefix>.os.folder.programfiles The Program Files directory.
<Prefix>.os.folder.system The System directory.
<Prefix>.os.folder.temp The temporary directory.

When the name of an environment variable is not a valid property name, the task will fail. In that case, set FailOnError to true to allow that environment variable to be skipped.

Note    we advise you to use the following functions instead:
Function Description
GetOperatingSystem Gets a OperatingSystem object that identifies this operating system.
GetFolderPath Gets the path to a system special folder.
GetVariable Returns the value of a environment variable.
GetTempPath Gets the path to the temporary directory.
GetVersion Gets the Common Language Runtime version.

Example

Register the properties with the default property prefix.

    
<sysinfo />
    
  

Register the properties without a prefix.

    
<sysinfo prefix="" />
    
  

Register properties and display a summary.

    
<sysinfo verbose="true" />
    
  

Requirements

Namespace: NAnt.Core.Tasks

Assembly: NAnt.Core (in NAnt.Core.dll)

See Also

SysInfoTask Members | NAnt.Core.Tasks Namespace