create dest directory if not exists
This commit is contained in:
@@ -173,6 +173,7 @@ Public Class UpdateInstaller
|
||||
|
||||
Select Case action.Type
|
||||
Case UpdateActionType.Update
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(destFilePath))
|
||||
Dim sRemote As Stream = Await httpClient.GetStreamAsync(action.DownloadUrl)
|
||||
Dim fs As New FileStream(destFilePath, FileMode.Create, FileAccess.ReadWrite)
|
||||
Await sRemote.CopyToAsync(fs)
|
||||
@@ -185,11 +186,13 @@ Public Class UpdateInstaller
|
||||
Case UpdateActionType.Copy
|
||||
Dim srcFilePath As String = Path.Combine(localPath, action.SrcPath)
|
||||
If File.Exists(srcFilePath) Then
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(destFilePath))
|
||||
File.Copy(srcFilePath, destFilePath, True)
|
||||
End If
|
||||
Case UpdateActionType.Move
|
||||
Dim srcFilePath As String = Path.Combine(localPath, action.SrcPath)
|
||||
If File.Exists(srcFilePath) Then
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(destFilePath))
|
||||
File.Move(srcFilePath, destFilePath, True)
|
||||
End If
|
||||
End Select
|
||||
|
||||
Reference in New Issue
Block a user