Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27221

VS 2010 Auto Update and Delete File

$
0
0
Hello,

I use this code to download a new version of my program but what i was wondering
is it possible to download the new version and delete the older version once the new
one has been downloaded this is the code that i use?.

code Code:
  1. Public Sub CheckForUpdates()
  2.  
  3.         Dim file As String = Application.StartupPath & ""
  4.         Dim MyVer As String = My.Application.Info.Version.ToString
  5.  
  6.         If My.Computer.FileSystem.FileExists(file) Then
  7.             My.Computer.FileSystem.DeleteFile(file)
  8.         End If
  9.  
  10.         My.Computer.Network.DownloadFile("", file)
  11.         Dim LastVer As String = My.Computer.FileSystem.ReadAllText(file)
  12.  
  13.         If Not MyVer = LastVer Then
  14.             MsgBox("There is an update available")
  15.             My.Computer.Network.DownloadFile("", "")
  16.         Else
  17.             'MsgBox("Your up to date")
  18.         End If
  19.  
  20.  
  21.     End Sub

Viewing all articles
Browse latest Browse all 27221


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>