1. Home
  2. Docs
  3. Scense Embedded Scripting...
  4. Scense Native Scriptable ...
  5. Virtual Layer

Virtual Layer

The Virtual Layer object can be used to manipulate AltirisVirtual Software Layers.
The object structure is somewhat more complex due to the construction of the Virtual Layers.
The ‘Base’ object is ‘ScenseSVS’. The ScenseSVS object provides general administrative functions.

ScenseSVS

Properties Description
Layers Reference to the Layers collection
Versions

 

Reference to the Versions collection

 

Methods Description
Import

 

 

Import a layer from a Virtual Software Archive (VSA-file).
The function passes a reference to the newly imported layer object.

Function Import(FileName As String, Result As Long, Optional Overwrite As Boolean = False, Optional LocalCopy As Boolean = False)
IgnoreProcess Instructs the Driver to completely ignore the current process. The current process will no longer see any layers.
EndIgnoreProcess Instructs the driver to resume normal operation with the current process. The current process will see active layers again.
Refresh Refreshes the Layers collection.
StartCapture

 

 

Capture an application installation.
The function returns a resultcode that can be translated with ‘TranslateError’

Function StartCapture(LayerNameOrGUID As String, PathToExe As String, Parameters As String)
StopCapture Stop a previously started capture
TranslateError

 

Translate an error code to legible text.

Function TranslateError(errorCode As Long)

 

Version

The Versions collection of the ScenseSVS object consists of one or more Version objects.

Properties Description
Feature Feature within the versions collection
Version Version of this feature

Usage:

Sub Scense_Main()
    Dim v
    For Each v In ScenseSVS.Versions
        WriteScenseLog v.Feature & ": " & v.Version
    Next
End Sub

 

Layer

The Layers collection of the ScenseSVS object consists of Layer objects.
The Layer objects can be used to manage a virtual layer.

Properties Description
Excludes Reference to the Excludes collection of a Layer object
Active Boolean value, True indicates an active layer
ActivateOnStart Boolean value, True indicates the layer is activated on system startup
AutoDeactivate Boolean value, True indicates the layer will be deactivated when the last process running in this layer is terminated.
CreatedTime Date value indicating the creation timestamp
GUID Global Unique Identifier acting as the LayerID
LastRefreshed Date value indicating the timestamp of last Reset action
LastActivated Date value indicating the timestamp of last activation
LayerVersion Version number of this layer
LayerType Type of this layer
Name Name or description for this layer
Peers Reference to the Peers collection of this layer
Priority Normal layer priority
PriorityHKCR HKey_Classes_Root priority for this layer
VisibilityFlags Flags bitmap indicating the visibility and isolation for this layer
UserFilesPath Path for the user file in the redirection area
UserRegistryPath

 

Path for the user registry in the redirection area

 

Methods Description
Activate

 

 

Activate this layer.
The function returns a result code.

Function Activate(Optional RunStartUpFolder As Boolean = False)
Deactivate

 

 

Deactivate this layer.
The function returns a result code.

Function Deactivate(Optional Force As Boolean = False)
Delete Delete this layer.
The function returns a result code.
Export

 

 

Export this layer to a VSA-file.
The function returns a result code.

Function Export(FilePath As String, Optional Overwrite As Boolean = False)
Rename

 

 

Rename this layer.
The function returns a result code.

Function Rename(NewName As String)
RemoveFTAs

 

 

Remove the File Type Associations from this layer.
The function returns a result code.

Function RemoveFTAs()
RemoveShortcuts

 

 

Remove the Shortcuts from this layer.
The function returns a result code.

Function RemoveShortcuts()
Reset

 

 

Reset this layer.
The function returns a result code.

Function Reset(Optional Force As Boolean = False)
ResetPriority

 

 

Reset the priority.
The function returns a result code.

Function ResetPriority(PriorityType As PriorityType)
RestoreUserData Restore the user specific data stored in the layer.
The function returns a result code.
SaveUserData Save the user specific data stored in the layer.
The function returns a result code.
SetAutoActivate

 

 

Set the auto activate property of this layer.
The function returns a result code.

Function SetAutoActivate(Activate As Boolean)

 

SetAutoDeactivate

 

 

Set the auto deactivate property of this layer.
The function returns a result code.

Function SetAutoDeactivate(AutoDeactivate As Boolean)
SetProcessContext

 

 

Set the current process to either run inside or outside this layers context.
The function returns a result code.

Function SetProcessContext(RunInLayer As Boolean)
SetPriority

 

 

Set the normal- or the HKCR-priority for this layer.
The function returns a result code.

Function SetPriority(PriorityType As PriorityType, ByVal Level As String)

Usage:

Sub Scense_Main()
    Dim l

    For Each l In ScenseSVS.Layers
        'Check if the layer is active
        If Not l.Active Then
            'It Is Not active, so we activate it
            If l.Activate Then
                WriteScenseLog l.Name & " was activated"
            Else
                WriteScenseLog l.Name & " could not be activated"
            End If
        Else
            'It Is active, so we Do Nothing
            WriteScenseLog l.Name & " was already active"
        End If
    Next
End Sub

 

Excludes

The Excludes collection of the Layer object consists of Exclude objects.
Excludes determine which files and locations should not be stored within the virtual layer.

Methods Description
Add

 

Adds a new exclude to the collection. This function returns a reference to the newly added exclude object.

Function Add(Path As String, ExcludeType As ExcludeType)
Remove

 

Removes an exclude from the excludes collection.

Sub Remove(IndexKey As Variant)

Exclude

The Excludes collection of the Layer object consists of Exclude objects.

Properties Description
ExcludeType Type of exclude (Directory, Directory with subdirs, or a file extension)
Path Path or file extension that is excluded

Usage:

Sub Scense_Main()
    Dim e

    WriteScenseLog "Excludes for " & ScenseSVS.Layers(1).Name
    
    'Enumerate All excludes for the 1st layer
    For Each e In ScenseSVS.Layers(1).Excludes
        WriteScenseLog e.Path
    Next
End Sub

 

Peer

The Peers collection of the Layer object consists of 2 Peer objects.
The 2 peers are; the Read-Only peer and the Read-Write peer.

Properties Description
ID Peer identification
Key Unique identifier for the peer
FileRedirect File Redirection path
RegistryRedirect Registry redirection path

Usage:

Sub Scense_Main()
    Dim p

    WriteScenseLog "Peers for " & ScenseSVS.Layers(1).Name
    
    'Enumerate All peers for the 1st layer
    For Each p In ScenseSVS.Layers(1).Peers
        WriteScenseLog p.ID & ", " & p.FileRedirect
    Next
End Sub