initial implementation

This commit is contained in:
2023-06-01 12:23:23 +02:00
parent ab6b2aea62
commit e5c1059bb5
7 changed files with 252 additions and 4 deletions

View File

@@ -1,7 +1,39 @@
Imports System
Imports System.IO
Imports System.Net
Imports System.Net.Http
Module Program
Sub Main(args As String())
Console.WriteLine("Hello World!")
Private master As String = "https://master.alterware.dev"
Sub download_and_run(game As String)
Dim filename As String = game & ".exe"
Dim remote_path As String = If(game = "iw4-sp", "/iw4/", "/iw5/")
Console.WriteLine("Downloading " & game & "...")
Using wc As New WebClient
wc.DownloadFile(master & remote_path & filename, filename)
End Using
Console.WriteLine("Starting " & game)
Process.Start(filename)
End
End Sub
End Module
Sub Main(args As String())
Dim game As String
Try
game = args(0)
Catch ex As Exception
If File.Exists("iw4sp.exe") Or File.Exists("iw4mp.exe") Then
game = "iw4-sp"
ElseIf File.Exists("iw5sp.exe") Or File.Exists("iw5mp.exe") Or File.Exists("iw5mp_server.exe") Then
game = "iw5-mod"
Else
Console.WriteLine("No game specified nor found in local directory")
Console.ReadLine()
Return
End If
End Try
download_and_run(game)
End Sub
End Module