mirror of
https://github.com/alterware/alterware-launcher.git
synced 2025-12-04 07:17:50 +00:00
initial implementation
This commit is contained in:
38
Program.vb
38
Program.vb
@@ -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
|
||||
Reference in New Issue
Block a user