Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CheckForUpdates()
End Sub
Public Sub CheckForUpdates()
Dim file As String = Application.StartupPath & "/version.txt"
Dim MyVer As String = My.Application.Info.Version.ToString
If My.Computer.FileSystem.FileExists(file) Then
My.Computer.FileSystem.DeleteFile(file)
End If
My.Computer.Network.DownloadFile("http://your.url/version.txt", file)
Dim LastVer As String = My.Computer.FileSystem.ReadAllText(file)
If Not MyVer = LastVer Then
MsgBox("Update Available")
'My.Computer.Network.DownloadFile("http://your.url/program.exe", "")
Me.Close()
Else
MsgBox("Program is up to date")
End If
End Sub
End Class
Public Class myupdater
Dim Web As New System.Net.WebClient
Dim EnteredSerial As String
Dim newVersion As String = ""
Dim Retry As Integer
Private Sub myupdater_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim myVersion As String
myVersion = My.Computer.FileSystem.ReadAllText("C:\mypath\version.txt")
''
newVersion = Web.DownloadString("http://my.url/version.txt")
If Not newVersion.Contains(myVersion) Then
Label1.ForeColor = Color.Red
Label1.Text = "Updating."
If My.Computer.FileSystem.DirectoryExists("C:\mypath\") Then
If My.Computer.FileSystem.FileExists("C:\mypath\my_Tool.exe") Then
IO.File.Delete("C:\mypath\my_Tool.exe")
My.Computer.Network.DownloadFile("http://my.url/my_Tool.exe", "C:\mypath\my_Tool.exe")
'System.Diagnostics.Process.Start("C:\mypath\my_Tool.exe")
Else
My.Computer.Network.DownloadFile("http://my.url/my_Tool.exe", "C:\mypath\my_Tool.exe")
'System.Diagnostics.Process.Start("C:\mypath\my_Tool.exe")
End If
If My.Computer.FileSystem.FileExists("C:\mypath\version.txt") Then
IO.File.Delete("C:\mypath\version.txt")
My.Computer.Network.DownloadFile("http://my.url/version.txt", "C:\mypath\version.txt")
'System.Diagnostics.Process.Start("C:\mypath\my_Tool.exe")
Else
My.Computer.Network.DownloadFile("http://my.url/version.txt", "C:\mypath\version.txt")
'System.Diagnostics.Process.Start("C:\mypath\my_Tool.exe")
End If
Else
My.Computer.FileSystem.CreateDirectory("C:\mypath\")
My.Computer.Network.DownloadFile("http://my.url/my_Tool.exe", "C:\mypath\my_Tool.exe")
My.Computer.Network.DownloadFile("http://my.url/version.txt", "C:\mypath\version.txt")
'System.Diagnostics.Process.Start("C:\mypath\my_Tool.exe")
End If
System.Diagnostics.Process.Start("C:\mypath\my_Tool.exe")
Me.Close()
Else
System.Diagnostics.Process.Start("C:\mypath\my_Tool.exe")
'newVersion.Show()
Me.Close()
End If
Catch Ex As Exception
MsgBox("Ein Fehler ist aufgetreten:" & vbCrLf & Ex.Message)
End Try
End Sub
End Class
Then add this to your main programm:
Under your "Public Class"
Code:
Dim Web As New System.Net.WebClient
Dim EnteredSerial As String
Dim newVersion As String = ""
Dim Retry As Integer
Into your Form1_load:
Code:
Try
Dim myVersion As String
myVersion = My.Computer.FileSystem.ReadAllText("C:\mypath\version.txt")
''
newVersion = Web.DownloadString("http://my.url/version.txt")
If Not newVersion.Contains(myVersion) Then
msgBox("A newer Version is available, the Programm will close now.")
System.Diagnostics.Process.Start("C:\mypath\Updater.exe")
End
End if
End Try
You just have to change the paths, names, etc.. to yours.
And you have to add a Label.
Thats really a bad idea to depend on an external file, which u need to know the filepath.
Update method is bad too, why do u want to update your whole application instead of just the part who really needs the update ?
Thats really a bad idea to depend on an external file, which u need to know the filepath.
Update method is bad too, why do u want to update your whole application instead of just the part who really needs the update ?
Is this really the best way in VB.NET?
it's my version and it works good
but you could also check if it is existing, if it is deleted then the programm should tell the message that the programm needs to be reinstalled boh1
but you could also check if it is existing, if it is deleted then the programm should tell the message that the programm needs to be reinstalled boh1
your app -> maybe 100kb - 1mb ?
sure lets reinstall the whole application.
someone else project -> maybe 100mb -> 10 gb?
wo00t? 1 patch and i need to download/reinstall 1gb+, naaah bullshitbingo software
a good developer tries to break his own product to see how good/bad the results are...
for yours, i dont even need to know the source/part of it, to break your whole application into pieces.
your app -> maybe 100kb - 1mb ?
sure lets reinstall the whole application.
someone else project -> maybe 100mb -> 10 gb?
wo00t? 1 patch and i need to download/reinstall 1gb+, naaah bullshitbingo software
a good developer tries to break his own product to see how good/bad the results are...
for yours, i dont even need to know the source/part of it, to break your whole application into pieces.
just try to improve
A 100mb/10gb project is most likely programmed in c++ or another language, and for this there is more than just one file.
When there are updates only a few parts will get updated, like 1-5mb
Zygor Guide Updates and Updates 02/09/2018 - WoW Guides & Templates - 5 Replies Hy guys!
Zygor Guides 3.0.1692:
Last Updated On:
January 14th, 2011
Horde Guides Change Log:
(Northrend 70-72) - Step 103 - Guide now instructs players to deliver the Orphaned Mammoth Calf and tracks its completion before telling them to turn in the quest "Khu-nok Will Know". This was added for clarification purposes.
(Northrend 70-71) - Moved the ding steps for 71
Combat Arms Mod [Wöchentliche Updates / Weekly Updates] 03/23/2011 - Combat Arms - 4 Replies Combat Arms Mod
_________________________________________________ _______________
Deutsch:
Hier sind alle Mods in Übersicht
(Konas sind nicht dabei).
Englisch:
Here are all Mods
Tq program works! check 05/11/2006 - CO2 Exploits, Hacks & Tools - 23 Replies text2schild.php?smilienummer=1&text= and 1 karma's ARE Welcome' border='0' alt=' and 1 karma's ARE Welcome' />