add IsDirectory and support Delete actions
This commit is contained in:
@@ -8,5 +8,6 @@ Public Class UpdateAction
|
|||||||
Public Property DestPath As String
|
Public Property DestPath As String
|
||||||
Public Property SrcPath As String
|
Public Property SrcPath As String
|
||||||
Public Property DownloadUrl As String
|
Public Property DownloadUrl As String
|
||||||
|
Public Property IsDirectory As Boolean
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -180,8 +180,14 @@ Public Class UpdateInstaller
|
|||||||
sRemote.Close()
|
sRemote.Close()
|
||||||
fs.Close()
|
fs.Close()
|
||||||
Case UpdateActionType.Delete
|
Case UpdateActionType.Delete
|
||||||
If File.Exists(destFilePath) Then
|
If action.IsDirectory Then
|
||||||
File.Delete(destFilePath)
|
If Directory.Exists(destFilePath) Then
|
||||||
|
Directory.Delete(destFilePath, True)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If File.Exists(destFilePath) Then
|
||||||
|
File.Delete(destFilePath)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Case UpdateActionType.Copy
|
Case UpdateActionType.Copy
|
||||||
Dim srcFilePath As String = Path.Combine(localPath, action.SrcPath)
|
Dim srcFilePath As String = Path.Combine(localPath, action.SrcPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user