1. Home
  2. Docs
  3. Scense Embedded Scripting...
  4. Scense Native Scriptable ...
  5. App-V 4

App-V 4

The App-V object can be used to manipulate Microsoft Application Virtualization version 4.5 or 4.6 Applications. (for the App-V 5 scriptable object see the next chapter…)

The ‘Base’ object is ‘ScenseAppV’. The ScenseAppV object provides general administrative functions.

ScenseAppV

Properties Description
Applications Reference to the Applications collection
Packages Reference to the Packages collection
Methods Description
AddApplication

 

Adds an application to the App-V client

Function AddApplication(Application As String, OsdPathName As String) As Boolean
GetLastError Retrieve the latest error text

Function GetLastError() As String
InstallApplication

 

Fully loads the specified application into the client cache

Function InstallApplication(Application As String) As Boolean
LaunchApplication

 

Launches the specified application and automatically stream it into the client cache

Function LaunchApplication(Application As String) As Boolean
LoadApplication

 

Fully loads the specified application into the client cache

Function LoadApplication(Application As String) As Boolean
LockApplication

 

Locks the specified application in the client cache

Function LockApplication(Application As String) As Boolean
Refresh

 

 

Refresh the Applications- and Packages collections.
If a computer name is specified, the applications and packages from this (remote) computer will be loaded.

Sub Refresh(Optional Computer As String)
RefreshServer

 

Triggers the desktop configuration to be refreshed from the server

Function RefreshServer(ServerName As String) As Boolean
RemoveApplication

 

Removes the specified application from the App-V client

Function RemoveApplication(Application As String) As Boolean
ResetApplication

 

Resets the specified application to its original state.

Function ResetApplication(Application As String) As Boolean
SetApplicationIcon

 

Changes the icon associated with the specified application

Function SetApplicationIcon(Application As String, IconPathName As String) As Boolean
UnloadApplication

 

Unloads the specified application from the client cache.

Function UnloadApplication(Application As String) As Boolean
UnlockApplication

 

Unlocks the specified application in the client cache.

Function UnlockApplication(Application As String) As Boolean

Application

The Applications collection of the ScenseAppV object consists of one or more Application objects.

Properties Description
Name Application name
Version Application version
PackageGUID Globally Unique Identifier for the associated Package
IsLoading Indicates if the application is in the process of ‘Loading’
OriginalOSDPath Path from where the original OSD file was taken
CachedOSDPath Path to the currently cached copy of the OSD file
GlobalRunningCount Number of application instances currently running on this computer
LastLaunchOnSystem Timestamp of most recent application launch on this computer
Package

 

Reference to the associated Package object

 

Methods Description
Delete Delete this Application
Launch Launch this Application
Load Fully load this Application
Repair Repair this Application
SetIcon

 

Modify the icon associated with this Application

Function SetIcon(IconPathName As String) As Boolean
Unload Unload this Application

Package

The Packages collection of the ScenseAppV object consists of one or more Package objects.

Properties Description
Name Package name
Version Package version
VersionGUID Globally Unique Identifier for this Version
PackageGUID Globally Unique Identifier for this Package
SftPath Path to the ‘SFT-file’
TotalSize Size in bytes of the entire package
CachedSize Size in bytes of the portion of the package that has already been cached
LaunchSize
CachedLaunchSize
InUse Indicates if the package is currently in use
Locked Indicated if the package is currently locked
CachedPercentage Indicates the percentage of the package that is currently cached
Applications

 

Collection of Application objects associated with this Package

 

Methods Description
Delete Delete this Package
Load Fully load this Package
SetAutoLoadTarget

 

 

Set the autoload target for this Package

Function SetAutoLoadTarget(Target As enAutoLoadTarget) As Boolean
Public Enum enAutoLoadTarget
    none = 0
    All
    PreviouslyUsed
End Enum
SetAutoLoadTrigger

 

 

 

 

Set the autoload trigger for this Package
Triggers can be used in combination with each other, like OnRefresh + OnLogin

Function SetAutoLoadTrigger(Trigger As enAutoLoadTrigger) As Boolean
Public Enum enAutoLoadTrigger
    never = 0
    OnRefresh
    OnLogin
    OnLaunch
End Enum
Unload Unload this Package
Unpublish

 

Unpublish this Package

Function Unpublish(Optional RemoveUserSettings As Boolean, Optional UnpublishForAllUsers As Boolean) As Boolean

Usage:

Sub Scense_Main()
    Dim Pkg
    Dim App

    ScenseAppV.Refresh
    
    For Each Pkg In ScenseAppV.Packages
        WriteScenseLog Pkg.CachedPercentage, Pkg.SftPath

        For Each App In Pkg.Applications
            WriteScenseLog "    " & App.Name & “, “ & App.Version
        Next
    Next
End Sub