Windows Installer API (SDK)

Shortcut Table

Referenz » Shortcut Table | Microsoft Docs


VBS class Shortcut


Class classShortcutTable
Private mShortcut, mDirectory, mName, mComponent, mTarget, mArguments
Private mDescription, mHotkey, mIcon, mIconIndex, mShowCmd, mWkDir
Private mDisplayResourceDLL, mDisplayResourceId, mDescriptionResourceDLL, mDescriptionResourceId

    Public Property Get pShortcut
        pShortcut = mShortcut
    End Property
    Public Property Let pShortcut(strShortcut)
        mShortcut = strShortcut
    End Property
    Public Property Get pDirectory
        pDirectory = mDirectory
    End Property
    Public Property Let pDirectory(strDirectory)
        mDirectory = strDirectory
    End Property
    Public Property Get pName
        pName = mName
    End Property
    Public Property Let pName(strName)
        mName = strName
    End Property
    Public Property Get pComponent
        pComponent = mComponent
    End Property
    Public Property Let pComponent(strComponent)
        mComponent = strComponent
    End Property
    Public Property Get pTarget
        pTarget = mTarget
    End Property
    Public Property Let pTarget(strTarget)
        mTarget = strTarget
    End Property
    Public Property Get pArguments
        pArguments = mArguments
    End Property
    Public Property Let pArguments(strArguments)
        mArguments = strArguments
    End Property
    Public Property Get pDescription
        pDescription = mDescription
    End Property
    Public Property Let pDescription(strDescription)
        mDescription = strDescription
    End Property
    Public Property Get pHotkey
        pHotkey = mHotkey
    End Property
    Public Property Let pHotkey(strHotkey)
        mHotkey = strHotkey
    End Property
    Public Property Get pIcon
        pIcon = mIcon
    End Property
    Public Property Let pIcon(strIcon)
        mIcon = strIcon
    End Property
    Public Property Get pIconIndex
        pIconIndex = mIconIndex
    End Property
    Public Property Let pIconIndex(strIconIndex)
        mIconIndex = strIconIndex
    End Property
    Public Property Get pShowCmd
        pShowCmd = mShowCmd
    End Property
    Public Property Let pShowCmd(strShowCmd)
        mShowCmd = strShowCmd
    End Property
    Public Property Get pWkDir
        pWkDir = mWkDir
    End Property
    Public Property Let pWkDir(strWkDir)
        mWkDir = strWkDir
    End Property
    Public Property Get pDisplayResourceDLL
        pDisplayResourceDLL = mDisplayResourceDLL
    End Property
    Public Property Let pDisplayResourceDLL(strDisplayResourceDLL)
        mDisplayResourceDLL = strDisplayResourceDLL
    End Property
    Public Property Get pDisplayResourceId
        pDisplayResourceId = mDisplayResourceId
    End Property
    Public Property Let pDisplayResourceId(intDisplayResourceId)
        mDisplayResourceId= intDisplayResourceId
    End Property
    Public Property Get pDescriptionResourceDLL
        pDescriptionResourceDLL = mDescriptionResourceDLL
    End Property
    Public Property Let pDescriptionResourceDLL(strDescriptionResourceDLL)
        mDescriptionResourceDLL = strDescriptionResourceDLL
    End Property
    Public Property Get pDescriptionResourceId
        pDescriptionResourceId = mDescriptionResourceId
    End Property
    Public Property Let pDescriptionResourceId(intDescriptionResourceId)
        mDescriptionResourceId = intDescriptionResourceId
    End Property

    Private Sub Class_Initialize
        'Anweisungen
    End Sub
    ' -----------------------------------------------------------------

    Public Function ModifyShortcutRecord()
    Dim strSQL, objView, objTableRow

    strSQL = "SELECT * FROM Shortcut"

    Set objView = objDatabase.OpenView(strSQL)
    objView.Execute
    Do 
        Set objTableRow = objView.Fetch
        If objTableRow Is Nothing Then
            Set objTableRow = objInstaller.CreateRecord(16)
            objTableRow.StringData(1) = mShortcut
            objTableRow.StringData(2) = mDirectory
            objTableRow.StringData(3) = mName
            objTableRow.StringData(4) = mComponent
            objTableRow.StringData(5) = mTarget
            objTableRow.StringData(6) = mArguments
            objTableRow.StringData(7) = mDescription
            objTableRow.IntegerData(8) = mHotkey
            objTableRow.StringData(9) = mIcon
            objTableRow.IntegerData(10) = mIconIndex
            objTableRow.IntegerData(11) = mShowCmd
            objTableRow.StringData(12) = mWkDir
            objTableRow.StringData(13) = mDisplayResourceDLL
            objTableRow.IntegerData(14) = mDisplayResourceId
            objTableRow.StringData(15) = mDescriptionResourceDLL
            objTableRow.IntegerData(16) = mDescriptionResourceId
            objView.Modify msiViewModifyAssign, objTableRow
            Exit Do
        End If
            objTableRow.StringData(1) = mShortcut
            objTableRow.StringData(2) = mDirectory
            objTableRow.StringData(3) = mName
            objTableRow.StringData(4) = mComponent
            objTableRow.StringData(5) = mTarget
            objTableRow.StringData(6) = mArguments
            objTableRow.StringData(7) = mDescription
            objTableRow.IntegerData(8) = mHotkey
            objTableRow.StringData(9) = mIcon
            objTableRow.IntegerData(10) = mIconIndex
            objTableRow.IntegerData(11) = mShowCmd
            objTableRow.StringData(12) = mWkDir
            objTableRow.StringData(13) = mDisplayResourceDLL
            objTableRow.IntegerData(14) = mDisplayResourceId
            objTableRow.StringData(15) = mDescriptionResourceDLL
            objTableRow.IntegerData(16) = mDescriptionResourceId
            objView.Modify msiViewModifyAssign, objTableRow
    Loop
    objDatabase.Commit()
    objView.Close
    Set objView = Nothing

    End Function
    ' -----------------------------------------------------------------

    Private Sub Class_Terminate()
        'Anweisungen
    End Sub
End Class
' ---------------------------------------------------------------------