install: begin rework
This commit is contained in:
9
ModpackUpdater.Model/InstallAction.vb
Normal file
9
ModpackUpdater.Model/InstallAction.vb
Normal file
@@ -0,0 +1,9 @@
|
||||
Imports Newtonsoft.Json.Converters
|
||||
|
||||
Public Class InstallAction
|
||||
|
||||
Public Property DestPath As String
|
||||
Public Property DownloadUrl As String
|
||||
Public Property IsZip As Boolean
|
||||
|
||||
End Class
|
||||
11
ModpackUpdater.Model/InstallInfos.vb
Normal file
11
ModpackUpdater.Model/InstallInfos.vb
Normal file
@@ -0,0 +1,11 @@
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
Public Class InstallInfos
|
||||
|
||||
Public ReadOnly Property Actions As New List(Of InstallAction)
|
||||
|
||||
Public Shared Function Parse(content As String) As InstallInfos
|
||||
Return JsonConvert.DeserializeObject(Of InstallInfos)(content)
|
||||
End Function
|
||||
|
||||
End Class
|
||||
15
ModpackUpdater.Model/ModpackConfig.vb
Normal file
15
ModpackUpdater.Model/ModpackConfig.vb
Normal file
@@ -0,0 +1,15 @@
|
||||
Imports System.Net.Http
|
||||
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
Public Class ModpackConfig
|
||||
|
||||
Public Property UpdateUrl As String
|
||||
Public Property InstallUrl As String
|
||||
|
||||
Public Shared Function LoadFromUrl(url As String)
|
||||
Dim result As String = New HttpClient().GetStringAsync(url).Result
|
||||
Return JsonConvert.DeserializeObject(Of ModpackConfig)(result)
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -1,22 +0,0 @@
|
||||
Imports System.IO
|
||||
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
Imports Pilz.Cryptography
|
||||
|
||||
Public Class UpdateConfig
|
||||
|
||||
Public Property UpdateUrl As String
|
||||
Public Property WebdavURL As SecureString
|
||||
Public Property WebdavUsername As SecureString
|
||||
Public Property WebdavPassword As SecureString
|
||||
|
||||
Public Sub SaveToFile(filePath As String)
|
||||
File.WriteAllText(filePath, JsonConvert.SerializeObject(Me))
|
||||
End Sub
|
||||
|
||||
Public Shared Function LoadFromFile(filePath As String) As UpdateConfig
|
||||
Return JsonConvert.DeserializeObject(Of UpdateConfig)(File.ReadAllText(filePath))
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user