Skip to content

Commit

Permalink
Fixed #19 and #20
Browse files Browse the repository at this point in the history
  • Loading branch information
Krutonium committed Feb 14, 2015
1 parent 7141d07 commit 1c61a02
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Launcher/Launcher/Extras.Designer.vb

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

16 changes: 16 additions & 0 deletions Launcher/Launcher/Extras.vb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Public Class Extras
'End Chunk

Dim DropboxPath As String = GetDropBoxPath()

Dim OpenRCT2Folder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "/OpenRCT2"

Private Sub Extras_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Icon = My.Resources.cat_paw
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
Expand Down Expand Up @@ -112,10 +115,21 @@ Public Class Extras
Next
Catch ex As Exception
'If there is no pre-existing files or the directory does not exist this will error out.
End Try
Try
For Each Save In Directory.EnumerateFiles(OpenRCT2Folder & "/save")
File.Copy(Save, DropBoxSavePath & "/" & Path.GetFileName(Save), True)
Next
Catch ex As Exception

End Try
Try
Directory.Delete(SavePathOriginal, True)
Catch ex As Exception
End Try
Try
Directory.Delete(OpenRCT2Folder & "/save", True)
Catch ex As Exception

End Try
Dim CreateSymLink As New ProcessStartInfo
Expand All @@ -124,6 +138,8 @@ Public Class Extras
CreateSymLink.Verb = ("runas")
CreateSymLink.WorkingDirectory = ""
Process.Start(CreateSymLink)
CreateSymLink.Arguments = ("/c mklink /J """ & OpenRCT2Folder & "/save" & """ """ & DropBoxSavePath & """")
Process.Start(CreateSymLink)
MsgBox("Saves moved to Dropbox and Linked!", , "Saves Moved!")
ElseIf Response = DialogResult.No Then
'They answered no... so no.
Expand Down
15 changes: 11 additions & 4 deletions Launcher/Launcher/Form1.vb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Public Class frmLauncher
If link Like "http://cdn.limetric.com/games/openrct2*.zip" Then
RemoteVer = link
Exit For
Else
RemoteVer = "NONE"
End If
Next
Catch ex As Exception 'because I want to grab the Download URL at the same time.
Expand Down Expand Up @@ -144,10 +146,15 @@ Public Class frmLauncher
End Sub

Private Sub DownloadUpdate()
cmdLaunchGame.Enabled = False
cmdForceUpdate.Enabled = False 'Added these because we may as well not keep calling them over and over.
Dim Download = New Thread(AddressOf ActualDownload)
Download.Start()
If RemoteVer = "NONE" Then
MsgBox("Your internet connection appears to be not working correctly, please re-start the Launcher.")
Else
cmdLaunchGame.Enabled = False
cmdForceUpdate.Enabled = False 'Added these because we may as well not keep calling them over and over.
Dim Download = New Thread(AddressOf ActualDownload)
Download.Start()
End If

End Sub

Private Sub ActualDownload()
Expand Down

0 comments on commit 1c61a02

Please sign in to comment.