Page tree
Skip to end of metadata
Go to start of metadata

Description

Sets the status for a unit package relation.


Syntax

SetUnitPackageStatus( Byval  UnitName as String, Byval  UnitType as String, Byval  PackageName as String, Byval  PackageVersion as String, Byval  PackageType as Integer, Byval  Status as String, Byval changelogComment As String ) as Boolean


Parameters

UnitName (String)

The name of the unit , or the uuid of the unit

UnitType (String)

Type of Unit

  • "Computer"
  • "User"

PackageName (String)

The name of the package

PackageVersion (String)

The package version

PackageType (String)

  • "1" (Computer)
  • "2" (User)

Status (String)
Accepted values for package status:
    • "Waiting"
      • When changed to waiting, the package will be installed according to its schedule. You can change the schedule with the function SetPackageSchedule.
    • "Failed"
    • "Installed"
    • "Uninstall"
      • To change the status to uninstall it requires that the current status is Installed, and that the package has an uninstall script.
    • "Cancel"


ChangelogComment (String)

A comment that will be added to the changelog entry on the package and the unit.


Return Value

Boolean. The function returns True if successful, otherwise false.


Example

VBScript
Set oCMS = CreateObject("CapaInstaller.SDK") 
Set aList = CreateObject("System.Collections.ArrayList") 

Wscript.echo oCMS.SetDefaultManagementPoint("1")
Wscript.echo oCMS.SetUnitPackageStatus("Client1", "Computer", "7-Zip", "v2", "Computer", "Uninstall", "Uninstalled with SDK")
 
Set aList = oCMS.GetPackageStatus("AEEC7B69-34A4-4A40-B39D-2FB469E37EB8","Computer")
For Each item In aList 
  arr = Split(item,"|")
  Wscript.echo "Computer Name: " & arr(0) & ". Package Name: " & arr(1) & ". Version: " & arr(2) 
  Select Case(arr(3)) 
    Case 0 
      sPackageStatus = "Installing"
    Case 1 
      sPackageStatus = "Waiting"
    Case 2 
      sPackageStatus = "Failed"
      Wscript.echo oCMS.SetStatusUnitPackage(arr(0), "Computer", arr(1), arr(2), "Computer", "Waiting", "Failed package set to waiting")
    Case 4 
      sPackageStatus = "Installed"
    Case 5 
      sPackageStatus = "Uninstall"
    Case 6 
      sPackageStatus = "Post"
    Case 7 
      sPackageStatus = "Disabled"
    Case 8 
     sPackageStatus = "Not Compliant"
    Case 9 
     sPackageStatus = "Advertised"
   End Select
   Wscript.echo "Status: " & sPackageStatus 
   Wscript.echo "***************************"
Next




  • No labels