Windows Installer API (SDK)

RemoveIniFile Table

Referenz » RemoveIniFile Table | Microsoft Docs


VBS class RemoveIniFile


Class classRemoveIniFileTable
Private mRemoveIniFile, mFileName, mDirProperty, mSection, mKey, mValue, mAction, mComponent

    Public Property Get pRemoveIniFile
        pRemoveIniFile = mRemoveIniFile
    End Property
    Public Property Let pRemoveIniFile(strRemoveIniFile)
        mRemoveIniFile = strRemoveIniFile
    End Property
    Public Property Get pFileName
        pFileName = mFileName
    End Property
    Public Property Let pFileName(strFileName)
        mFileName = strFileName
    End Property
    Public Property Get pDirProperty
        pDirProperty = mDirProperty
    End Property
    Public Property Let pDirProperty(strDirProperty)
        mDirProperty = strDirProperty
    End Property
    Public Property Get pSection
        pSection = mSection
    End Property
    Public Property Let pSection(strSection)
        mSection = strSection
    End Property
    Public Property Get pKey
        pKey = mKey
    End Property
    Public Property Let pKey(strKey)
        mKey = strKey
    End Property
    Public Property Get pValue
        pValue = mValue
    End Property
    Public Property Let pValue(strValue)
        mValue = strValue
    End Property
    Public Property Get pAction
        pAction = mAction
    End Property
    Public Property Let pAction(intAction)
        mAction = intAction
    End Property
    Public Property Get pComponent
        pComponent = mComponent
    End Property
    Public Property Let pComponent(strComponent)
        mComponent = strComponent
    End Property

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

    Public Function ModifyRemoveIniFileRecord()
    Dim strSQL, objView, objTableRow

    strSQL = "SELECT * FROM RemoveIniFile"

    Set objView = objDatabase.OpenView(strSQL)
    objView.Execute
    Do 
        Set objTableRow = objView.Fetch
        If objTableRow Is Nothing Then
            Set objTableRow = objInstaller.CreateRecord(8)
            objTableRow.StringData(1) = mRemoveIniFile
            objTableRow.StringData(2) = mFileName
            objTableRow.StringData(3) = mDirProperty
            objTableRow.StringData(4) = mSection
            objTableRow.StringData(5) = mKey
            objTableRow.StringData(6) = mValue
            objTableRow.IntegerData(7) = mAction
            objTableRow.StringData(8) = mComponent
            objView.Modify msiViewModifyAssign, objTableRow
            Exit Do
        End If
            objTableRow.StringData(1) = mRemoveIniFile
            objTableRow.StringData(2) = mFileName
            objTableRow.StringData(3) = mDirProperty
            objTableRow.StringData(4) = mSection
            objTableRow.StringData(5) = mKey
            objTableRow.StringData(6) = mValue
            objTableRow.IntegerData(7) = mAction
            objTableRow.StringData(8) = mComponent
            objView.Modify msiViewModifyAssign, objTableRow
    Loop
    objDatabase.Commit()
    objView.Close
    Set objView = Nothing

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

    Public Function DeleteRemoveIniFileRecord()
    Dim strSQL, objView, objTableRow

    strSQL = "SELECT * FROM RemoveIniFile"

    Set objView = objDatabase.OpenView(strSQL)
    objView.Execute
    Do 
        Set objTableRow = objView.Fetch
        If objTableRow Is Nothing Then Exit Do
        
        If objTableRow.StringData(8) = mComponent Then _
           objView.Modify msiViewModifyDelete, objTableRow
    Loop
    objDatabase.Commit()
    objView.Close
    Set objView = Nothing

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

    Public Function DeleteAllRecords()
    Dim strSQL, objView

    strSQL = "DELETE FROM RemoveIniFile"

    Set objView = objDatabase.OpenView(strSQL)
        objView.Execute
    objDatabase.Commit()
        objView.Close
    Set objView = Nothing

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

    Public Function DropTable()
    Dim strSQL, objView

    strSQL = "DROP TABLE RemoveIniFile"

    Set objView = objDatabase.OpenView(strSQL)
        objView.Execute
    objDatabase.Commit()
        objView.Close
    Set objView = Nothing

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

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