Skip to content
This repository has been archived by the owner on Mar 29, 2021. It is now read-only.

Commit

Permalink
Fixed Batch Saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon Grünewald committed Dec 28, 2015
1 parent 64fb6a3 commit a797a0c
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 57 deletions.
24 changes: 18 additions & 6 deletions SteamCMDui/Form1.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

136 changes: 85 additions & 51 deletions SteamCMDui/Form1.vb
Expand Up @@ -114,6 +114,9 @@ Public Class Form1

For Each Item In CheckedListBox1.CheckedItems

TempString = Nothing
TempStrArr = Nothing

TempStrArr = Item.ToString.Split("-")

TempString = "+app_update " + TempStrArr(0) + "validate "
Expand Down Expand Up @@ -142,8 +145,6 @@ Public Class Form1

Try

Debug.Print(TempString)

Process.Start(New ProcessStartInfo(My.Application.Info.DirectoryPath + "\SteamCMD.exe", TempString))

Catch ex As Exception
Expand All @@ -158,7 +159,8 @@ Public Class Form1

'Search Bar

TempString = ""
TempString = Nothing
TempStrArr = Nothing

CheckedListBox1.Items.Clear()
RW = 0
Expand Down Expand Up @@ -217,7 +219,8 @@ Public Class Form1

'Prepare Mod Start Arguments

TempString = ""
TempString = Nothing
TempStrArr = Nothing

If Not ComboBox1.Text = Nothing Then

Expand All @@ -238,81 +241,109 @@ Public Class Form1
TempString = "+login " + TextBox2.Text + " " + TextBox3.Text + " " + TempString

End If
End If

If Not CheckBox3.Checked Then
If Not CheckBox3.Checked Then

TempString = TempString + "+quit"
TempString = TempString + "+quit"

End If
End If

Debug.Print(TempString)
Try

Try
Process.Start(New ProcessStartInfo(My.Application.Info.DirectoryPath + "\SteamCMD.exe", TempString))

Process.Start(New ProcessStartInfo(My.Application.Info.DirectoryPath + "\SteamCMD.exe", TempString))
Catch ex As Exception

Catch ex As Exception
MsgBox(ex.Message)

MsgBox(ex.Message)
End Try

End Try
Else

MsgBox("Please choose a mod.", MsgBoxStyle.Exclamation & MsgBoxStyle.OkOnly)

End If
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click

'Save File Dialog
SaveFileDialog1.ShowDialog()

'Prepare Start Arguments
For Each Item In CheckedListBox1.CheckedItems
'Preapre Start Arguments

TempString = Nothing
TempStrArr = Nothing

TempString = ""
For Each Item In CheckedListBox1.CheckedItems

TempStrArr = Item.ToString.Split("-")

TempString = "+app_update " + TempStrArr(0) + "validate "
TempString = TempString + "+app_update " + TempStrArr(0) + "validate "

If CheckBox1.Checked Then
Next

TempString = "+force_install_dir " + TextBox1.Text + " " + TempString
If CheckBox1.Checked Then

End If
TempString = "+force_install_dir " + TextBox1.Text + " " + TempString

If CheckBox2.Checked Then
End If

TempString = "+login anonymous " + TempString
If CheckBox2.Checked Then

Else
TempString = "+login anonymous " + TempString

TempString = "+login " + TextBox2.Text + " " + TextBox3.Text + " " + TempString
Else

End If
TempString = "+login " + TextBox2.Text + " " + TextBox3.Text + " " + TempString

If Not CheckBox3.Checked Then
End If

TempString = TempString + "+quit"
If Not CheckBox3.Checked Then

End If
TempString = TempString + "+quit"

TempString = "SteamCMD.exe " + TempString + vbCrLf
End If

TempString = "SteamCMD.exe " + TempString + vbCrLf

If My.Computer.FileSystem.FileExists(SaveFileDialog1.FileName) Then

Try

'Write in file
My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, TempString, True)
My.Computer.FileSystem.DeleteFile(SaveFileDialog1.FileName)

Catch ex As Exception

MsgBox(ex.Message)

End Try
Next
End If

'Preapre Mod Start Arguments
Try

'Write in file
My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, TempString, True)

Catch ex As Exception

MsgBox(ex.Message)

End Try
End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click

If Not ComboBox1.Text = Nothing Then

'Save File Dialog
SaveFileDialog1.ShowDialog()

'Prepare Mod Start Arguments

TempString = Nothing
TempStrArr = Nothing

TempString = "+app_set_config 90 mod " + ComboBox1.Text + " +app_update 90 "

If CheckBox1.Checked Then
Expand All @@ -330,40 +361,43 @@ Public Class Form1
TempString = "+login " + TextBox2.Text + " " + TextBox3.Text + " " + TempString

End If
End If

If Not CheckBox3.Checked Then
If Not CheckBox3.Checked Then

TempString = TempString + "+quit"
TempString = TempString + "+quit"

End If
End If

TempString = "SteamCMD.exe " + TempString + vbCrLf
TempString = "SteamCMD.exe " + TempString + vbCrLf

'Write in file
If My.Computer.FileSystem.FileExists(SaveFileDialog1.FileName) Then

If My.Computer.FileSystem.FileExists(SaveFileDialog1.FileName) Then
Try

My.Computer.FileSystem.DeleteFile(SaveFileDialog1.FileName)

Catch ex As Exception

MsgBox(ex.Message)

End Try
End If

Try

My.Computer.FileSystem.DeleteFile(SaveFileDialog1.FileName)
'Write in file
My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, TempString, True)

Catch ex As Exception

MsgBox(ex.Message)

End Try
End If

Try

My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, TempString, True)

Catch ex As Exception

MsgBox(ex.Message)
Else

End Try
MsgBox("Please choose a mod.", MsgBoxStyle.Exclamation & MsgBoxStyle.OkOnly)

End If
End Sub
End Class

0 comments on commit a797a0c

Please sign in to comment.