[Tutorial] How to do an autopatch with Visual Basic 2008

12/31/2010 15:17 pablito7#1
Add to your form one Button.

Delete the code from the button and put this:

Quote:
Imports System.Net
Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Web As New WebClient
Dim Update As String = Web.DownloadString(“[Only registered and activated users can see links. Click Here To Register...])
If Update.Contains(“New Version”) Then
MsgBox(“New Version Available”)
Button1.Visible = True
Else
MsgBox(“No Actualizations available”)
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
My.Computer.Network.DownloadFile(“[Only registered and activated users can see links. Click Here To Register...], “C:\Auto Patcher\file.zip”)
End Sub
End Class
Explanation of the code:

Quote:
Dim Web As New WebClient
Dim Update As String = Web.DownloadString(“[Only registered and activated users can see links. Click Here To Register...])
If Update.Contains(“New Version Available”) Then
MsgBox(“New Version Avalable!”)
Button1.Visible = True
Else
MsgBox(“No actualizations available!”)
End If
This Verify if the [Only registered and activated users can see links. Click Here To Register...] contains New Version Available.If it haves It gona show New Version Avalable!.

If the FIle doesn't contains New Version Available it gona show No actualizations available!

Quote:
My.Computer.Network.DownloadFile(“[Only registered and activated users can see links. Click Here To Register...], “C:\Auto Patcher\Ficheiro.zip”)
This gona Download (if it exists) to the folder C:\Auto Patcher.

If you want to do a better auto patcher Then Use Skins of the oficials Clients.

Cumpz. pablito7
12/31/2010 15:34 'Haseo#2
nice tut but there are already 2 or more tutorials
but you still can add some screens ^^
12/31/2010 15:36 .Resistance#3
stimmt aber bei den anderen tuts musst du jede datei, die gepatcht werden soll einzelnd in dem code eintragen glaub ich.
der hiet ließt es aus einer txt datei raus
12/31/2010 15:43 pablito7#4
I gona do a tutorial!!!
12/31/2010 16:01 'Haseo#5
Quote:
Originally Posted by poll7979 View Post
stimmt aber bei den anderen tuts musst du jede datei, die gepatcht werden soll einzelnd in dem code eintragen glaub ich.
der hiet ließt es aus einer txt datei raus
ne derr lädt nur die zip runter also komplette zip ^^
12/31/2010 16:03 .Resistance#6
achso na dann^^
12/31/2010 17:34 |R.o.x|#7
That is very simple, but I would add a Progressbar, which compares the listed files in the .txt with the files in the client...
01/21/2011 05:13 gantu21#8
Thank Dudez