Program Updater(vb2008)


/ Published in: VB.NET
Save to your folder(s)

Variable/Parameter Discussion :
msg = Do you want to display a message box if you have the current version? (true/false)
currentversion = The version of the program
txtdocumentaddress = The text document web address containing the most updated version
exeaddress = the location of the updater .exe [You can make this with WINRAR - To learn how to do this goto : http://www.hotlinkfiles.com/files/2799514_xsw67/tut.txt


\This is my first snipplr post, Hope you enjoy/
This coding is used in *Brandons Timer 9* and *Brandons HTML-Ide*


Copy this code and paste it in your HTML
  1. 'Updater code for Visual Basic 2008 Express Edition - Coded by brandonio21 @variables - Find them at the website below
  2. 'This code is at build 154 [Currently working 100%]
  3. 'If you are having problems with this code, please consult : http://snipplr.com/view/19324/program-updatervb2008/
  4. Private Sub updatecheck(ByVal msg As Boolean, ByVal currentversion As String, ByVal txtdocumentaddress As String, ByVal exeaddress As String)
  5. If My.Computer.FileSystem.FileExists(CurDir() & "/updater.exe") Then
  6. My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.exe")
  7. End If
  8. If My.Computer.FileSystem.FileExists(CurDir() & "/updater.txt") Then
  9. My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.txt")
  10. End If
  11. If My.Computer.Network.IsAvailable = True Then
  12. My.Computer.Network.DownloadFile(txtdocumentaddress, CurDir() & "/updater.txt")
  13. Dim lolz As New TextBox
  14. lolz.Text = My.Computer.FileSystem.ReadAllText(CurDir() & "/updater.txt")
  15.  
  16. curver = currentversion
  17. If curver = lolz.Text Then
  18. If msg = True Then
  19. MsgBox("You have the most recent version!")
  20. Else
  21.  
  22. End If
  23. Else
  24. My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.txt")
  25. My.Computer.Network.DownloadFile(exeaddress, CurDir() & "/updater.exe")
  26. Shell(CurDir() & "/updater.exe")
  27. End
  28. End If
  29. Else
  30. End If
  31. End Sub

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.