[Help]Autoupdater????

Posts 1–15 of 16 · Page 1 of 2
[Help]Autoupdater????
could someone help me make a program that auto updates????
I have a nice multitool. Someone explain now to do this plzzzzz!
use your damt search function
So you want your program to auto update. Well, here's the easy way I coded

First, make a new project. I suggest making a project first to test it out THEN adding it in to your program.

Now, add a WebBrowser. Make it Visible = false.

Next, add 2 Web Clients. To get a Web Client, first right click on one of your controls/blank space in the GENERAL SECTION(very important!) in the Toolbox and click Choose Items.
http://j.image*********/0811/chooseitems.png < view me!


Then, scroll down to the bottom. Scroll up a TINY bit from there and you will see a checkbox marked WebClient.
[img]http://h.image*********/0453/webclient.png[/img]

Check it and click OK.

You should see something like this:
[img]http://h.image*********/0289/webclientinsection.png[/img]

Now click on that and drag in to your form 2 (2!) times. DO NOT RENAME THEM!


Now add two labels.

Arrange the labels like this:

Status: Checking for updates...

and put them anywhere on your form. I prefer the bottom but you can put them anywhere.


Now, add a button. This button can be anywhere and should say "Download Updates" noquotes. Make Enabled=False.


Now for the tricky part.

Double click your form. You should be in the Coding window. You should also be in Form1_Load.

Copy&paste this in: (exactly!)

Code:
WebClient1.DownloadFileAsync(New Uri("http://www.yourftpsite.com/version.txt"), "C:\version.txt")
What this will do is when you open the program it will download a small text file that has the version of your program. (ex. 1.0.0.0)
You must get a FTP server - online or offline - to use this correctly. I will use 110mb.com for this tutorial, it's easy to make an account and go into the FTP.

When you have created your account, go into the FTP. It should look like this on 110mb.

[img]http://j.image*********/0050/ftp.png[/img]

Click the small blue arrow. You should be in a site called "110MBPANEL". You've just gotten into the FTP server, good job.

Now click "New File". You will be presented with a textbox. Type in "version.txt" noquotes and press OK. You will be taken to a large text entry box. However, just type in "1.0.0.0" noquotes for the moment. We will change this later. Now click Save at the bottom and then Back at the bottom.

Go into the coding window of your project again. Add this code underneath Form1_Load.

Code:
Private Sub WebClient1_DownloadFileCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WebClient1.DownloadFileCompleted
		Dim Read As String = My.Computer.FileSystem.ReadAllText("C:\version.txt")
		If Not Read = Application.ProductVersion Then
			'If it reads blank, then the internet connection is faulty.
			If Read = "" Then
				MsgBox("ERROR: Please check your internet connection or try later.", MsgBoxStyle.Critical, "ERROR")
			Else
				Label2.Text = "Update ready to download!"
				Button1.Enabled = True
				Label2.ForeColor = Color.Green
			End If
		Else
			Button1.Enabled = False
			Button1.Text = "Up to date."
			Label2.Text = "Up to date."
			Label2.ForeColor = Color.Green

		End If
	End Sub

Add underneath that:


Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		MsgBox("Downloading new update!")
		WebClient2.DownloadFileAsync(New Uri("http://www.yourftpsite.com/link.txt"), "C:\link.txt")
	End Sub
Go back into the FTP site again and create a new file, "link.txt" noquotes. Add inside it the DIRECT link to the new updated program. (ex. "www.blahblahblah.com/UpdatedProgram.zip")

THIS PROGRAM HAS TO BE IN A ZIP FILE!!! HAS TO BE!!!! SO PUT IT IN A ZIP FILE!!!!



Ok, now add that ZIP file wherever you put the link to. Try and add it in your FTP server on 110MB.


If it is not in a zip file the webclient will NOT download it. So put it in.

Now add beneath that code in the Coding Window:

Code:
	Private Sub WebClient2_DownloadFileCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WebClient2.DownloadFileCompleted
		Dim Link As String = My.Computer.FileSystem.ReadAllText("C:\link.txt")
MsgBox("Please unzip the application and place in an easily accessible place.")
		WebBrowser1.Navigate(Link)
		Button1.Enabled = False
		Button1.Text = "Update already downloaded."
		Label2.Text = "Update already downloaded."
		Label2.ForeColor = Color.Red

	End Sub


You're done!

All that you need to do whenever you get an update is modify LINK.txt to the new update.ZIP!!!!!!!!! and modify version.txt to your new version. Also, go into your project properties and change the version whenever you update.



You're welcome, if anyone needs ANY help with this just post here and it will be fixed by me or someone else. THANKS FOR VIEWING!

PRESS THANKS!
Quote Originally Posted by xFalcon View Post
So you want your program to auto update. Well, here's the easy way I coded

First, make a new project. I suggest making a project first to test it out THEN adding it in to your program.

Now, add a WebBrowser. Make it Visible = false.

Next, add 2 Web Clients. To get a Web Client, first right click on one of your controls/blank space in the GENERAL SECTION(very important!) in the Toolbox and click Choose Items.
http://j.image*********/0811/chooseitems.png < view me!


Then, scroll down to the bottom. Scroll up a TINY bit from there and you will see a checkbox marked WebClient.
[img]http://h.image*********/0453/webclient.png[/img]

Check it and click OK.

You should see something like this:
[img]http://h.image*********/0289/webclientinsection.png[/img]

Now click on that and drag in to your form 2 (2!) times. DO NOT RENAME THEM!


Now add two labels.

Arrange the labels like this:

Status: Checking for updates...

and put them anywhere on your form. I prefer the bottom but you can put them anywhere.


Now, add a button. This button can be anywhere and should say "Download Updates" noquotes. Make Enabled=False.


Now for the tricky part.

Double click your form. You should be in the Coding window. You should also be in Form1_Load.

Copy&paste this in: (exactly!)

Code:
WebClient1.DownloadFileAsync(New Uri("http://www.yourftpsite.com/version.txt"), "C:\version.txt")
What this will do is when you open the program it will download a small text file that has the version of your program. (ex. 1.0.0.0)
You must get a FTP server - online or offline - to use this correctly. I will use 110mb.com for this tutorial, it's easy to make an account and go into the FTP.

When you have created your account, go into the FTP. It should look like this on 110mb.

[img]http://j.image*********/0050/ftp.png[/img]

Click the small blue arrow. You should be in a site called "110MBPANEL". You've just gotten into the FTP server, good job.

Now click "New File". You will be presented with a textbox. Type in "version.txt" noquotes and press OK. You will be taken to a large text entry box. However, just type in "1.0.0.0" noquotes for the moment. We will change this later. Now click Save at the bottom and then Back at the bottom.

Go into the coding window of your project again. Add this code underneath Form1_Load.

Code:
Private Sub WebClient1_DownloadFileCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WebClient1.DownloadFileCompleted
		Dim Read As String = My.Computer.FileSystem.ReadAllText("C:\version.txt")
		If Not Read = Application.ProductVersion Then
			'If it reads blank, then the internet connection is faulty.
			If Read = "" Then
				MsgBox("ERROR: Please check your internet connection or try later.", MsgBoxStyle.Critical, "ERROR")
			Else
				Label2.Text = "Update ready to download!"
				Button1.Enabled = True
				Label2.ForeColor = Color.Green
			End If
		Else
			Button1.Enabled = False
			Button1.Text = "Up to date."
			Label2.Text = "Up to date."
			Label2.ForeColor = Color.Green

		End If
	End Sub

Add underneath that:


Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		MsgBox("Downloading new update!")
		WebClient2.DownloadFileAsync(New Uri("http://www.yourftpsite.com/link.txt"), "C:\link.txt")
	End Sub
Go back into the FTP site again and create a new file, "link.txt" noquotes. Add inside it the DIRECT link to the new updated program. (ex. "www.blahblahblah.com/UpdatedProgram.zip")

THIS PROGRAM HAS TO BE IN A ZIP FILE!!! HAS TO BE!!!! SO PUT IT IN A ZIP FILE!!!!



Ok, now add that ZIP file wherever you put the link to. Try and add it in your FTP server on 110MB.


If it is not in a zip file the webclient will NOT download it. So put it in.

Now add beneath that code in the Coding Window:

Code:
	Private Sub WebClient2_DownloadFileCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WebClient2.DownloadFileCompleted
		Dim Link As String = My.Computer.FileSystem.ReadAllText("C:\link.txt")
MsgBox("Please unzip the application and place in an easily accessible place.")
		WebBrowser1.Navigate(Link)
		Button1.Enabled = False
		Button1.Text = "Update already downloaded."
		Label2.Text = "Update already downloaded."
		Label2.ForeColor = Color.Red

	End Sub


You're done!

All that you need to do whenever you get an update is modify LINK.txt to the new update.ZIP!!!!!!!!! and modify version.txt to your new version. Also, go into your project properties and change the version whenever you update.



You're welcome, if anyone needs ANY help with this just post here and it will be fixed by me or someone else. THANKS FOR VIEWING!

PRESS THANKS!
Wow, gtfo. That was just an exact copy and paste of GodHack2's thread ON THIS PAGE. .
Quote Originally Posted by xFalcon View Post
So you want your program to auto update. Well, here's the easy way I coded

First, make a new project. I suggest making a project first to test it out THEN adding it in to your program.

Now, add a WebBrowser. Make it Visible = false.

Next, add 2 Web Clients. To get a Web Client, first right click on one of your controls/blank space in the GENERAL SECTION(very important!) in the Toolbox and click Choose Items.
http://j.image*********/0811/chooseitems.png < view me!


Then, scroll down to the bottom. Scroll up a TINY bit from there and you will see a checkbox marked WebClient.
[img]http://h.image*********/0453/webclient.png[/img]

Check it and click OK.

You should see something like this:
[img]http://h.image*********/0289/webclientinsection.png[/img]

Now click on that and drag in to your form 2 (2!) times. DO NOT RENAME THEM!


Now add two labels.

Arrange the labels like this:

Status: Checking for updates...

and put them anywhere on your form. I prefer the bottom but you can put them anywhere.


Now, add a button. This button can be anywhere and should say "Download Updates" noquotes. Make Enabled=False.


Now for the tricky part.

Double click your form. You should be in the Coding window. You should also be in Form1_Load.

Copy&paste this in: (exactly!)

Code:
WebClient1.DownloadFileAsync(New Uri("http://www.yourftpsite.com/version.txt"), "C:\version.txt")
What this will do is when you open the program it will download a small text file that has the version of your program. (ex. 1.0.0.0)
You must get a FTP server - online or offline - to use this correctly. I will use 110mb.com for this tutorial, it's easy to make an account and go into the FTP.

When you have created your account, go into the FTP. It should look like this on 110mb.

[img]http://j.image*********/0050/ftp.png[/img]

Click the small blue arrow. You should be in a site called "110MBPANEL". You've just gotten into the FTP server, good job.

Now click "New File". You will be presented with a textbox. Type in "version.txt" noquotes and press OK. You will be taken to a large text entry box. However, just type in "1.0.0.0" noquotes for the moment. We will change this later. Now click Save at the bottom and then Back at the bottom.

Go into the coding window of your project again. Add this code underneath Form1_Load.

Code:
Private Sub WebClient1_DownloadFileCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WebClient1.DownloadFileCompleted
		Dim Read As String = My.Computer.FileSystem.ReadAllText("C:\version.txt")
		If Not Read = Application.ProductVersion Then
			'If it reads blank, then the internet connection is faulty.
			If Read = "" Then
				MsgBox("ERROR: Please check your internet connection or try later.", MsgBoxStyle.Critical, "ERROR")
			Else
				Label2.Text = "Update ready to download!"
				Button1.Enabled = True
				Label2.ForeColor = Color.Green
			End If
		Else
			Button1.Enabled = False
			Button1.Text = "Up to date."
			Label2.Text = "Up to date."
			Label2.ForeColor = Color.Green

		End If
	End Sub

Add underneath that:


Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		MsgBox("Downloading new update!")
		WebClient2.DownloadFileAsync(New Uri("http://www.yourftpsite.com/link.txt"), "C:\link.txt")
	End Sub
Go back into the FTP site again and create a new file, "link.txt" noquotes. Add inside it the DIRECT link to the new updated program. (ex. "www.blahblahblah.com/UpdatedProgram.zip")

THIS PROGRAM HAS TO BE IN A ZIP FILE!!! HAS TO BE!!!! SO PUT IT IN A ZIP FILE!!!!



Ok, now add that ZIP file wherever you put the link to. Try and add it in your FTP server on 110MB.


If it is not in a zip file the webclient will NOT download it. So put it in.

Now add beneath that code in the Coding Window:

Code:
	Private Sub WebClient2_DownloadFileCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WebClient2.DownloadFileCompleted
		Dim Link As String = My.Computer.FileSystem.ReadAllText("C:\link.txt")
MsgBox("Please unzip the application and place in an easily accessible place.")
		WebBrowser1.Navigate(Link)
		Button1.Enabled = False
		Button1.Text = "Update already downloaded."
		Label2.Text = "Update already downloaded."
		Label2.ForeColor = Color.Red

	End Sub


You're done!

All that you need to do whenever you get an update is modify LINK.txt to the new update.ZIP!!!!!!!!! and modify version.txt to your new version. Also, go into your project properties and change the version whenever you update.



You're welcome, if anyone needs ANY help with this just post here and it will be fixed by me or someone else. THANKS FOR VIEWING!

PRESS THANKS!
wdf man at least give credits !!!
Hmm, maybe give credits there, champ?

You know, leeching = ban nowadays.
lol there was a topic about this posted um 2 days ago i think before you ask a question maybe you should look threw the posts
Quote Originally Posted by Lonely Tedy Bear View Post
lol there was a topic about this posted um 2 days ago i think before you ask a question maybe you should look threw the posts
Lol we all just said that
Quote Originally Posted by Jason View Post


Lol we all just said that
He was just trolling. No need to get serious !!
Quote Originally Posted by Jason View Post


Lol we all just said that
ya i know that now lol most the time i just open a topic then go do something and come back and respond to it so there was none when i had it open /
xFalcon, I'm gonna warn you that if you don't give credits for a tutorial once more I'm gonna have you banned.
OMFG

I WAS THE ONE WHO POSTED THAT

PLEASE GIVE A LINK

I POSTED ON A DIFF SITE AS STEVE323

PM ME FOR THE ORIGINAL POST

I AM NOT TROLLING OR LEECHING
Quote Originally Posted by xFalcon View Post
OMFG

I WAS THE ONE WHO POSTED THAT

PLEASE GIVE A LINK

I POSTED ON A DIFF SITE AS STEVE323

PM ME FOR THE ORIGINAL POST

I AM NOT TROLLING OR LEECHING
For some reason, I think you are right.
Erm

1st read the rules, no auto updater unless made by a staff member, because of safety, the updater can feed virus's through the auto updater.

this is dangerous this thread should be closed.
Posts 1–15 of 16 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us